summaryrefslogtreecommitdiff
path: root/odb-tests/evolution/data/testscript
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2024-02-02 18:37:48 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2024-02-07 16:21:33 +0300
commit567871f6803756cec9eb0793ad937579d4864c51 (patch)
treed23718571621b63b0bc795992b9462dd4dd9107d /odb-tests/evolution/data/testscript
parent01bf760a937cc80901dac5b14fa8d165761ebd11 (diff)
Add evolution tests to odb-tests
Also clean up some buildfiles and manifests.
Diffstat (limited to 'odb-tests/evolution/data/testscript')
-rw-r--r--odb-tests/evolution/data/testscript54
1 files changed, 54 insertions, 0 deletions
diff --git a/odb-tests/evolution/data/testscript b/odb-tests/evolution/data/testscript
new file mode 100644
index 0000000..5c91396
--- /dev/null
+++ b/odb-tests/evolution/data/testscript
@@ -0,0 +1,54 @@
+# file : evolution/data/testscript
+# license : GNU GPL v2; see accompanying LICENSE file
+
+.include ../../database-options.testscript
+.include ../../$db-schema.testscript
+
+test.arguments += $($(db)_options)
+
+: basics
+:
+if! $sqlite
+{
+ ss =; # Schema modification base file names.
+
+ # Drop everything.
+ #
+ for s: $schemas
+ ss =+ $s
+ end;
+
+ # Add base schema.
+ #
+ ss += test3-002-pre test3-002-post;
+
+ # Add migration.
+ #
+ ss += test3-003-pre test3-003-post;
+
+ # Run tests.
+ #
+ for s: $ss
+ f = $out_base/"$s".sql
+
+ if $mysql
+ cat $f | $create_schema_cmd
+ elif $pgsql
+ $create_schema_cmd -f $f
+ end
+
+ if ($s == 'test3-002-post')
+ $* 1
+ elif ($s == 'test3-003-pre')
+ $* 2
+ elif ($s == 'test3-003-post')
+ $* 3
+ end
+ end
+}
+else
+{
+ $* 1 &odb-test.db;
+ $* 2;
+ $* 3
+}