aboutsummaryrefslogtreecommitdiff
path: root/tester.bat
blob: 9cee8ea0ec91198c6c0ea4e53e56f6575a85b888 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
@echo off
rem file      : tester.bat
rem copyright : Copyright (c) 2009-2012 Code Synthesis Tools CC
rem license   : GNU GPL v2; see accompanying LICENSE file

rem
rem Run an ODB 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 "_%DIFF%_" == "__" set DIFF=fc

if "_%3_" == "_Win32_" (
  set "dir=%2"
) else (
  set "dir=%3\%2"
)

rem Globbing returns files in alphabetic order.
rem
if exist test*.sql (
  for %%f in (test*.sql) do (
    call %topdir%\%1-driver.bat %%f
    if errorlevel 1 goto error
  )
)

if exist test.std (
  %dir%\driver.exe --options-file %topdir%\%1.options >test.out
  if errorlevel 1 goto error
  %DIFF% test.std test.out

  if errorlevel 1 (
    del /f test.out
    goto error
  )

  del /f test.out
  goto end

) else (

  %dir%\driver.exe --options-file %topdir%\%1.options
  if errorlevel 1 goto error
)

goto end

:error
endlocal
exit /b 1

:end
endlocal