summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2024-01-30 20:12:18 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2024-01-31 20:52:06 +0300
commit1c7f67f47770a0c8591aeff7c54766c6f5d00cca (patch)
treeadbbec4b12716ce6a83b22a54c40a9e5f832905c
parentb576c62064542d3d1f4f4e5aa400b8e106e2490c (diff)
Add odb-tests package to repository
-rw-r--r--libodb-mysql/manifest24
-rw-r--r--libodb-pgsql/manifest22
-rw-r--r--libodb-sqlite/manifest27
l---------odb-tests/NEWS1
-rw-r--r--odb-tests/build/root.build40
-rw-r--r--odb-tests/manifest28
-rw-r--r--packages.manifest2
7 files changed, 117 insertions, 27 deletions
diff --git a/libodb-mysql/manifest b/libodb-mysql/manifest
index 437bebf..692b609 100644
--- a/libodb-mysql/manifest
+++ b/libodb-mysql/manifest
@@ -13,9 +13,6 @@ doc-url: https://www.codesynthesis.com/products/odb/doc/manual.xhtml
src-url: https://git.codesynthesis.com/cgit/odb/odb/
email: odb-users@codesynthesis.com
build-warning-email: odb-builds@codesynthesis.com
-builds: all
-builds: -wasm
-builds: -( +windows &gcc ) ; MinGW GCC is not supported by libmysqlclient.
requires: c++11
depends: * build2 >= 0.16.0-
depends: * bpkg >= 0.16.0-
@@ -23,3 +20,24 @@ depends: * bpkg >= 0.16.0-
depends: libmysqlclient >= 5.0.3
depends: libodb == $
depends: * cli ^1.2.0- ? ($config.libodb_mysql.develop)
+
+#tests: odb-tests == $ \
+#? (!$defined(config.odb_tests.database)) config.odb_tests.database=mysql
+
+# @@ TMP
+#
+builds: all
+#builds: all mysql
+builds: -wasm
+builds: -( +windows &gcc ) ; MinGW GCC is not supported by libmysqlclient.
+
+# Only build this package configuration where it can be tested via odb-tests
+# package (see its manifest for details).
+#
+#multi-builds: mysql
+#multi-build-config:
+#\
+#{ 'config.odb_tests.database=mysql sqlite' }+ odb-tests
+#;
+#Enable testing in dynamic multi-database mode.
+#\
diff --git a/libodb-pgsql/manifest b/libodb-pgsql/manifest
index 83b1a10..32d5920 100644
--- a/libodb-pgsql/manifest
+++ b/libodb-pgsql/manifest
@@ -13,11 +13,29 @@ doc-url: https://www.codesynthesis.com/products/odb/doc/manual.xhtml
src-url: https://git.codesynthesis.com/cgit/odb/odb/
email: odb-users@codesynthesis.com
build-warning-email: odb-builds@codesynthesis.com
-builds: all
-builds: -wasm
requires: c++11
depends: * build2 >= 0.16.0-
depends: * bpkg >= 0.16.0-
depends: libpq >=7.4.0
depends: libodb == $
depends: * cli ^1.2.0- ? ($config.libodb_pgsql.develop)
+
+#tests: odb-tests == $ \
+#? (!$defined(config.odb_tests.database)) config.odb_tests.database=pgsql
+
+# @@ TMP
+#
+builds: all
+#builds: all pgsql
+builds: -wasm
+
+# Only build this package configuration where it can be tested via odb-tests
+# package (see its manifest for details).
+#
+#multi-builds: pgsql
+#multi-build-config:
+#\
+#{ 'config.odb_tests.database=pgsql sqlite' }+ odb-tests
+#;
+#Enable testing in dynamic multi-database mode.
+#\
diff --git a/libodb-sqlite/manifest b/libodb-sqlite/manifest
index 5863a54..12cc414 100644
--- a/libodb-sqlite/manifest
+++ b/libodb-sqlite/manifest
@@ -13,10 +13,35 @@ doc-url: https://www.codesynthesis.com/products/odb/doc/manual.xhtml
src-url: https://git.codesynthesis.com/cgit/odb/odb/
email: odb-users@codesynthesis.com
build-warning-email: odb-builds@codesynthesis.com
-builds: all
requires: c++11
depends: * build2 >= 0.16.0-
depends: * bpkg >= 0.16.0-
depends: libsqlite3 ^3.6.18
depends: libodb == $
depends: * cli ^1.2.0- ? ($config.libodb_sqlite.develop)
+
+tests: odb-tests == $ \
+? (!$defined(config.odb_tests.database)) config.odb_tests.database=sqlite
+
+# @@ TMP
+#
+builds: all
+#builds: all sqlite
+
+# Only build this package configuration where it can be tested via odb-tests
+# package (see its manifest for details).
+#
+# @@ TMP
+#
+multi-builds: all
+#multi-builds: sqlite
+multi-builds: -( +windows -gcc )
+multi-builds: &gcc
+multi-builds: &gcc-5+
+multi-builds: -static
+multi-build-config:
+\
+{ config.odb_tests.multi_database=true }+ odb-tests
+;
+Enable testing in dynamic multi-database mode.
+\
diff --git a/odb-tests/NEWS b/odb-tests/NEWS
new file mode 120000
index 0000000..0fae0f8
--- /dev/null
+++ b/odb-tests/NEWS
@@ -0,0 +1 @@
+../NEWS \ No newline at end of file
diff --git a/odb-tests/build/root.build b/odb-tests/build/root.build
index 5336399..402be67 100644
--- a/odb-tests/build/root.build
+++ b/odb-tests/build/root.build
@@ -10,18 +10,30 @@ ixx{*}: extension = ixx
txx{*}: extension = txx
cxx{*}: extension = cxx
+define sql: file
+sql{*}: extension = sql
+
+define xml: file
+xml{*}: extension = xml
+
+skeleton = ($build.mode == 'skeleton')
+
# List of the identifiers of the databases to compile and run the tests
# against. The valid identifiers are mysql, sqlite, pgsql, oracle, and mssql.
#
-# @@ TODO: change to string_set once available.
+# Note: can be specified by the user but is also conditionally reflected by
+# the libodb-* libraries' tests manifest values.
+#
+# @@ TODO: make it of the string_set type once available.
#
config [strings] config.odb_tests.database
-assert ($defined(config.odb_tests.database) && \
- $size($config.odb_tests.database) > 0) \
-'at least one database must be configured via config.odb_tests.database variable'
+databases = ($defined(config.odb_tests.database) \
+ ? $config.odb_tests.database \
+ : )
-databases = $config.odb_tests.database
+assert ($skeleton || $size($databases) > 0) \
+'at least one database must be configured via config.odb_tests.database variable'
mysql = false
sqlite = false
@@ -53,13 +65,21 @@ for db: $databases
}
}
+# @@ TMP Remove once string_set is available.
+#
+databases = ($mysql ? 'mysql' : ) \
+ ($sqlite ? 'sqlite' : ) \
+ ($pgsql ? 'pgsql' : ) \
+ ($oracle ? 'oracle' : ) \
+ ($mssql ? 'mssql' : )
+
# If true, then build and run the test drivers in the dynamic multi-database
# mode.
#
config [bool] config.odb_tests.multi_database ?= ($size($databases) > 1)
multi = $config.odb_tests.multi_database
-assert ($multi || $size($databases) == 1) \
+assert ($multi || $size($databases) < 2) \
'only one database can be configured if config.odb_tests.multi_database value is false'
# Database connections.
@@ -122,13 +142,7 @@ config [uint64] config.odb_tests.mysql.port
#
config [path] config.odb_tests.mysql.socket
-define sql: file
-sql{*}: extension = sql
-
-define xml: file
-xml{*}: extension = xml
-
-if ($build.mode != 'skeleton')
+if! $skeleton
{
if ($cxx.target.system == 'win32-msvc')
cxx.poptions += -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS
diff --git a/odb-tests/manifest b/odb-tests/manifest
index 858baa7..f033324 100644
--- a/odb-tests/manifest
+++ b/odb-tests/manifest
@@ -12,11 +12,15 @@ doc-url: https://www.codesynthesis.com/products/odb/doc/manual.xhtml
src-url: https://git.codesynthesis.com/cgit/odb/odb/
email: odb-users@codesynthesis.com ; Mailing list
+# @@ TMP
+#
+builds: all
+#builds: mysql sqlite pgsql oracle mssql
+#
# @@ BUILD2 The odb dependency can only be built with GCC. However, shouldn't
# we test that the odb-generated mappings can be compiled by other
# compilers and properly run afterwards?
#
-builds: default
builds: -( +windows -gcc ) ; Requires MinGW GCC.
builds: &gcc ; Requires GCC with plugin support enabled.
builds: &gcc-5+ ; Requires GCC 5 or later.
@@ -25,19 +29,27 @@ builds: -static ; Implementation uses plugins and requires -fPIC.
depends: * build2 >= 0.16.0
depends: * bpkg >= 0.16.0
-depends: * odb [2.5.0-b.26.1 2.5.0-b.27)
+depends: * odb == $
-depends: libodb [2.5.0-b.26.1 2.5.0-b.27)
-depends: libodb-mysql [2.5.0-b.26.1 2.5.0-b.27) ? ($mysql)
-depends: libodb-sqlite [2.5.0-b.26.1 2.5.0-b.27) ? ($sqlite)
-depends: libodb-pgsql [2.5.0-b.26.1 2.5.0-b.27) ? ($pgsql)
-depends: libodb-oracle [2.5.0-b.26.1 2.5.0-b.27) ? ($oracle)
-depends: libodb-mssql [2.5.0-b.26.1 2.5.0-b.27) ? ($mssql)
+depends: libodb == $
+depends: libodb-mysql == $ ? ($mysql)
+depends: libodb-sqlite == $ ? ($sqlite)
+depends: libodb-pgsql == $ ? ($pgsql)
+depends: libodb-oracle == $ ? ($oracle)
+depends: libodb-mssql == $ ? ($mssql)
# Reflect whether libodb-pgsql is likely to support bulk operations. This is
# normally the case on POSIX platforms if libodb-pgsql is linked against libpq
# of the version 14 or above.
#
+# Note, though, that this approach doesn't work well for libodb-pgsql
+# configured as a system package, since the version of libpq it is linked to
+# may not be the same as what we can get from the repository. Also note that
+# the following depends clause (without alternatives) is required to avoid the
+# 'unable to select dependency alternative' failure when libodb-pgsql is
+# configured as a system package.
+#
+depends: libpq ? ($pgsql)
depends: libpq >= 14.0.0 ? ($pgsql) config.odb_tests.pgsql.bulk_default=true | \
libpq >= 7.4.0 ? ($pgsql) config.odb_tests.pgsql.bulk_default=false
diff --git a/packages.manifest b/packages.manifest
index fd29ced..f8b39c4 100644
--- a/packages.manifest
+++ b/packages.manifest
@@ -8,3 +8,5 @@ location: libodb-mysql/
location: libodb-sqlite/
:
location: libodb-pgsql/
+:
+location: odb-tests/