summaryrefslogtreecommitdiff
path: root/odb-tests/evolution/embedded/buildfile
diff options
context:
space:
mode:
Diffstat (limited to 'odb-tests/evolution/embedded/buildfile')
-rw-r--r--odb-tests/evolution/embedded/buildfile59
1 files changed, 59 insertions, 0 deletions
diff --git a/odb-tests/evolution/embedded/buildfile b/odb-tests/evolution/embedded/buildfile
new file mode 100644
index 0000000..095e476
--- /dev/null
+++ b/odb-tests/evolution/embedded/buildfile
@@ -0,0 +1,59 @@
+# file : evolution/embedded/buildfile
+# license : GNU GPL v2; see accompanying LICENSE file
+
+if ($build.meta_operation != 'dist')
+ assert (!$multi) "multi-database mode is not supported by this test"
+
+db = ($databases[0])
+
+import libodb = libodb%lib{odb}
+
+import libs = libodb-$db%lib{odb-$db}
+import libs += lib{common}
+
+hdrs = test1 test2 test3
+
+exe{driver}: {hxx cxx}{* -*-odb} testscript
+
+# Introduce the metadata library target to make sure the libodb library is
+# resolved for the odb_compile ad hoc rule (see build/root.build for details).
+#
+libue{test-meta}: $libodb
+
+for h: $hdrs
+ exe{driver}: {hxx ixx cxx}{$h-odb}: hxx{$h} libue{test-meta} hxx{model}
+
+# Make sure testN.hxx are compiled serially since they share the changelog.
+#
+# @@ TODO: make order-only when supported by build2.
+#
+{hxx ixx cxx}{test3-odb}: {hxx ixx cxx}{test2-odb}: {hxx ixx cxx}{test1-odb}
+
+exe{driver}: libue{test-meta} $libs
+
+# Specify the ODB custom options to be used by the odb_compile ad hoc rule
+# (see build/root.build for details).
+#
+odb_options = --table-prefix evo_embedded_ \
+ --schema-version-table evo_embedded_sv \
+ --generate-schema \
+ --schema-format embedded \
+ --generate-query \
+ --at-once \
+ --changelog $out_base/model.xml
+
+<{hxx ixx cxx}{test1-odb}>: odb_options += --init-changelog
+<{hxx ixx cxx}{test2-odb}>: odb_options += --omit-create --suppress-migration
+<{hxx ixx cxx}{test3-odb}>: odb_options += --omit-create
+
+cxx.poptions =+ "-I$out_base" "-I$src_base"
+
+# Testscript's run-time prerequisites.
+#
+exe{driver}: ../../alias{database-client}: include = adhoc
+
+testscript@./:
+{
+ db = $db
+ schemas = $hdrs
+}