ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/public/ibx/trunk/testsuite/runtest.bat
Revision: 315
Committed: Thu Feb 25 11:56:36 2021 UTC (3 years, 9 months ago) by tony
Content type: application/x-msdos-program
File size: 2389 byte(s)
Log Message:
Updated for IBX 4 release

File Contents

# User Rev Content
1 tony 315 @echo off
2     REM Test suite Configuration parameters (FPCDIR and FPCBIN)
3     REM These may be modified if needed to suite local requirements
4    
5     set LAZARUS=C:\lazarus
6     FOR %%V in (3.2.0 3.0.4 3.0.2 3.0.0) do (
7     if EXIST C:\lazarus\fpc\%%V\bin\i386-win32\fpc.exe (
8     set FPCDIR=C:\lazarus\fpc\%%V
9     set FPCBIN=C:\lazarus\fpc\%%V\bin\i386-win32
10     Goto COMPILE
11     )
12     if EXIST C:\lazarus\fpc\%%V\bin\x86_64-win32\fpc.exe (
13     set FPCDIR=C:\lazarus\fpc\%%V
14     set FPCBIN=C:\lazarus\fpc\%%V\bin\x86_64-win32
15     Goto COMPILE
16     )
17     if EXIST C:\lazarus\fpc\%%V\bin\x86_64-win64\fpc.exe (
18     set FPCDIR=C:\lazarus\fpc\%%V
19     set FPCBIN=C:\lazarus\fpc\%%V\bin\x86_64-win64
20     Goto COMPILE
21     )
22     )
23    
24     if not EXIST %FPCBIN%\fpc.exe (
25     echo "Unable to find fpc.exe"
26     goto :EOF
27     )
28    
29     :COMPILE
30     set TESTOUTDIR=%TEMP%\ibx-testsuite
31     set USERNAME=SYSDBA
32     set PASSWORD=masterkey
33     set EMPLOYEEDB=employee
34     set NEWDBNAME=%TESTOUTDIR%\testsuite1.fdb
35     set NEWDBNAME2=%TESTOUTDIR%\testsuite2.fdb
36     set BAKFILE=%TESTOUTDIR%\testsuite.gbk
37     set DIFF=%FPCBIN%\diff.exe
38    
39     rd /s /q testunits
40     mkdir %TESTOUTDIR%
41    
42     IF EXIST "..\fbintf" (
43     set FBINTF=../fbintf
44     goto COMPILE2
45     )
46     if EXIST "..\..\fbintf" (
47     set FBINTF=../../fbintf
48     goto COMPILE2
49     )
50     echo Error: unable to locate Pascal Firebird Interface API"
51     goto :EOF
52    
53     :COMPILE2
54     set INCDIR=%FBINTF%/client/3.0/firebird %FBINTF%/client/include
55     set UNITDIR=%FBINTF% %FBINTF%/client %FBINTF%/client/3.0/firebird %FBINTF%/client/2.5 %FBINTF%/client/3.0 %LAZARUS%/components/lazutils
56    
57     echo UNITDIR= %UNITDIR%
58    
59     %FPCBIN%\fpcmake
60     %FPCBIN%\make clean
61     %FPCBIN%\make INCDIR="%INCDIR%" UNITDIR="%UNITDIR%"
62     echo(
63     echo Starting Testsuite
64     echo(
65     IF EXIST "testsuite.exe" (
66     testsuite.exe -u %USERNAME% -p %PASSWORD% -e %EMPLOYEEDB% -n %NEWDBNAME% -s %NEWDBNAME2% -b %BAKFILE% -o testout.log %1
67    
68     if not EXIST "%DIFF%" (
69     echo Unable to compare results - diff not found - %DIFF%
70     goto :EOF
71     )
72    
73     echo Comparing results with reference log
74     echo(
75     findstr /C:"ODS Major Version = 11" testout.log
76     IF ERRORLEVEL 1 (
77     findstr /C:"ODS Major Version = 12" testout.log
78     IF ERRORLEVEL 1 (
79     %DIFF% FB4reference.log testout.log >diff.log
80     ) ELSE (
81     %DIFF% FB3reference.log testout.log >diff.log
82     )
83     ) ELSE (
84     %DIFF% FB2reference.log testout.log >diff.log
85     )
86     type diff.log
87     rd /s /q testunits
88     del testsuite.exe
89     )