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