aboutsummaryrefslogtreecommitdiff
path: root/evolution/tester.bat
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2013-04-03 11:22:42 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2013-04-10 18:46:46 +0200
commit516523183fad016a26c7400d784eb9c0343b7964 (patch)
treeb2e5df0194c28df2b9bcaf822f6f06b92a267118 /evolution/tester.bat
parente7f6315882ef16939f99dd757eaf800b9f12e92b (diff)
Generate add/drop table migration statements
Diffstat (limited to 'evolution/tester.bat')
-rw-r--r--evolution/tester.bat82
1 files changed, 82 insertions, 0 deletions
diff --git a/evolution/tester.bat b/evolution/tester.bat
new file mode 100644
index 0000000..ea40b35
--- /dev/null
+++ b/evolution/tester.bat
@@ -0,0 +1,82 @@
+@echo off
+rem file : evolution/tester.bat
+rem copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC
+rem license : GNU GPL v2; see accompanying LICENSE file
+
+rem
+rem Run an evolution test. The test directory is the current directory.
+rem
+rem %1 database
+rem %2 configuration, for example, Debug or Release
+rem %3 platform, for example Win32 or x64
+rem topdir variable containing the path to top project directory
+rem
+
+setlocal
+
+set "PATH=%topdir%\libcommon\bin64;%topdir%\libcommon\bin;%PATH%"
+
+if "_%3_" == "_Win32_" (
+ set "dir=%2"
+) else (
+ set "dir=%3\%2"
+)
+
+if exist test*.sql (
+ rem Standalone schema.
+ rem
+
+ rem Drop everything.
+ rem
+ call %topdir%\%1-driver.bat test1.sql
+ if errorlevel 1 goto error
+
+ call %topdir%\%1-driver.bat test2.sql
+ if errorlevel 1 goto error
+
+ rem Base schema (-post is always empty).
+ rem
+ call %topdir%\%1-driver.bat test2-002-pre.sql
+ if errorlevel 1 goto error
+
+ %dir%\driver.exe --options-file %topdir%\%1.options 1
+ if errorlevel 1 goto error
+
+ rem Migration.
+ rem
+ call %topdir%\%1-driver.bat test2-003-pre.sql
+ if errorlevel 1 goto error
+
+ %dir%\driver.exe --options-file %topdir%\%1.options 2
+ if errorlevel 1 goto error
+
+ call %topdir%\%1-driver.bat test2-003-post.sql
+ if errorlevel 1 goto error
+
+ rem Current schema.
+ rem
+ %dir%\driver.exe --options-file %topdir%\%1.options 3
+ if errorlevel 1 goto error
+
+) else (
+
+ rem Embedded schema. Just run the driver.
+ rem
+ %dir%\driver.exe --options-file %topdir%\%1.options 1
+ if errorlevel 1 goto error
+
+ %dir%\driver.exe --options-file %topdir%\%1.options 2
+ if errorlevel 1 goto error
+
+ %dir%\driver.exe --options-file %topdir%\%1.options 3
+ if errorlevel 1 goto error
+)
+
+goto end
+
+:error
+endlocal
+exit /b 1
+
+:end
+endlocal