diff options
Diffstat (limited to 'libodb-oracle/tests')
-rw-r--r-- | libodb-oracle/tests/.gitignore | 1 | ||||
-rw-r--r-- | libodb-oracle/tests/basics/buildfile | 6 | ||||
-rw-r--r-- | libodb-oracle/tests/basics/driver.cxx | 37 | ||||
-rw-r--r-- | libodb-oracle/tests/build/.gitignore | 3 | ||||
-rw-r--r-- | libodb-oracle/tests/build/bootstrap.build | 8 | ||||
-rw-r--r-- | libodb-oracle/tests/build/root.build | 23 | ||||
-rw-r--r-- | libodb-oracle/tests/buildfile | 4 |
7 files changed, 82 insertions, 0 deletions
diff --git a/libodb-oracle/tests/.gitignore b/libodb-oracle/tests/.gitignore new file mode 100644 index 0000000..e54525b --- /dev/null +++ b/libodb-oracle/tests/.gitignore @@ -0,0 +1 @@ +driver diff --git a/libodb-oracle/tests/basics/buildfile b/libodb-oracle/tests/basics/buildfile new file mode 100644 index 0000000..e963685 --- /dev/null +++ b/libodb-oracle/tests/basics/buildfile @@ -0,0 +1,6 @@ +# file : tests/basics/buildfile +# license : ODB NCUEL; see accompanying LICENSE file + +import libs = libodb-oracle%lib{odb-oracle} + +exe{driver}: {hxx cxx}{*} $libs diff --git a/libodb-oracle/tests/basics/driver.cxx b/libodb-oracle/tests/basics/driver.cxx new file mode 100644 index 0000000..38ec6d2 --- /dev/null +++ b/libodb-oracle/tests/basics/driver.cxx @@ -0,0 +1,37 @@ +// file : tests/basics/driver.cxx +// license : ODB NCUEL; see accompanying LICENSE file + +// Basic test to make sure the library is usable. Functionality testing +// is done in the odb-tests package. + +#include <cassert> +#include <sstream> + +#include <odb/oracle/database.hxx> +#include <odb/oracle/exceptions.hxx> +#include <odb/oracle/transaction.hxx> + +using namespace odb::oracle; + +int +main () +{ + { + std::ostringstream os; + database::print_usage (os); + assert (!os.str ().empty ()); + } + + // We can't really do much here since that would require a database. We can + // create a fake database object as long as we don't expect to get a valid + // connection. + // + database db ("john", "secret", "dummy whammy"); + + try + { + transaction t (db.begin ()); + assert (false); + } + catch (const database_exception&) {} +} diff --git a/libodb-oracle/tests/build/.gitignore b/libodb-oracle/tests/build/.gitignore new file mode 100644 index 0000000..4a730a3 --- /dev/null +++ b/libodb-oracle/tests/build/.gitignore @@ -0,0 +1,3 @@ +config.build +root/ +bootstrap/ diff --git a/libodb-oracle/tests/build/bootstrap.build b/libodb-oracle/tests/build/bootstrap.build new file mode 100644 index 0000000..895126c --- /dev/null +++ b/libodb-oracle/tests/build/bootstrap.build @@ -0,0 +1,8 @@ +# file : tests/build/bootstrap.build +# license : ODB NCUEL; see accompanying LICENSE file + +project = # Unnamed subproject. + +using config +using dist +using test diff --git a/libodb-oracle/tests/build/root.build b/libodb-oracle/tests/build/root.build new file mode 100644 index 0000000..bbd3781 --- /dev/null +++ b/libodb-oracle/tests/build/root.build @@ -0,0 +1,23 @@ +# file : tests/build/root.build +# license : ODB NCUEL; see accompanying LICENSE file + +cxx.std = latest + +using cxx + +hxx{*}: extension = hxx +cxx{*}: extension = cxx + +if ($cxx.target.system == 'win32-msvc') + cxx.poptions += -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS + +if ($cxx.class == 'msvc') + cxx.coptions += /wd4251 /wd4275 /wd4800 + +# Every exe{} in this subproject is by default a test. +# +exe{*}: test = true + +# Specify the test target for cross-testing. +# +test.target = $cxx.target diff --git a/libodb-oracle/tests/buildfile b/libodb-oracle/tests/buildfile new file mode 100644 index 0000000..fd73adc --- /dev/null +++ b/libodb-oracle/tests/buildfile @@ -0,0 +1,4 @@ +# file : tests/buildfile +# license : ODB NCUEL; see accompanying LICENSE file + +./: {*/ -build/} |