]> granicus.if.org Git - postgresql/blob - src/tools/msvc/vcregress.bat
b3b5df9b05a81026fe79efb85975c5377d5a5571
[postgresql] / src / tools / msvc / vcregress.bat
1 @echo off
2 REM $PostgreSQL: pgsql/src/tools/msvc/vcregress.bat,v 1.6 2007/03/23 09:57:55 mha Exp $
3
4 SETLOCAL
5 SET STARTDIR=%CD%
6 if exist ..\..\..\src\tools\msvc\vcregress.bat cd ..\..\..
7 if exist src\tools\msvc\buildenv.bat call src\tools\msvc\buildenv.bat
8
9 set what=
10 if /I "%1"=="check" SET what=CHECK
11 if /I "%1"=="installcheck" SET what=INSTALLCHECK
12 if /I "%1"=="plcheck" SET what=PLCHECK
13 if /I "%1"=="contribcheck" SET what=CONTRIBCHECK
14 if "%what%"=="" goto usage
15
16 SET CONFIG=Debug
17 if exist release\postgres\postgres.exe SET CONFIG=Release
18
19 copy %CONFIG%\refint\refint.dll contrib\spi\
20 copy %CONFIG%\autoinc\autoinc.dll contrib\spi\
21 copy %CONFIG%\regress\regress.dll src\test\regress\
22
23 SET PATH=..\..\..\%CONFIG%\libpq;..\..\%CONFIG%\libpq;%PATH%
24
25 SET TOPDIR=%CD%
26 cd src\test\regress
27 SET SCHEDULE=parallel
28 SET TEMPPORT=54321
29 IF NOT "%2"=="" SET SCHEDULE=%2
30
31 SET PERL5LIB=..\..\tools\msvc
32
33 if "%what%"=="INSTALLCHECK" ..\..\..\%CONFIG%\pg_regress\pg_regress --psqldir=..\..\..\%CONFIG%\psql --schedule=%SCHEDULE%_schedule --multibyte=SQL_ASCII --load-language=plpgsql --no-locale
34 if "%what%"=="CHECK" ..\..\..\%CONFIG%\pg_regress\pg_regress --psqldir=..\..\..\%CONFIG%\psql --schedule=%SCHEDULE%_schedule --multibyte=SQL_ASCII --load-language=plpgsql --no-locale --temp-install=./tmp_check --top-builddir=%TOPDIR% --temp-port=%TEMPPORT%
35 if "%what%"=="PLCHECK" call :plcheck
36 if "%what%"=="CONTRIBCHECK" call :contribcheck
37 SET E=%ERRORLEVEL%
38
39 cd %STARTDIR%
40 exit /b %E%
41
42 :usage
43 echo "Usage: vcregress <check|installcheck> [schedule]"
44 goto :eof
45
46
47 REM Check procedural languages
48 REM Some workarounds due to inconsistently named directories
49 :plcheck
50 cd ..\..\PL
51 FOR /D %%d IN (*) do if exist %%d\sql if exist %%d\expected (
52    if exist ..\..\%CONFIG%\%%d call :oneplcheck %%d
53    if errorlevel 1 exit /b 1
54    if exist ..\..\%CONFIG%\pl%%d call :oneplcheck %%d
55    if errorlevel 1 exit /b 1
56 )
57 goto :eof
58
59 REM Check a single procedural language
60 :oneplcheck
61 echo Checking %1
62 cd %1
63 SET PL=%1
64 IF %PL%==plpython SET PL=plpythonu
65 IF %PL%==tcl SET PL=pltcl
66
67 perl ../../tools/msvc/getregress.pl > regress.tmp.bat
68 call regress.tmp.bat
69 del regress.tmp.bat
70 ..\..\..\%CONFIG%\pg_regress\pg_regress --psqldir=..\..\..\%CONFIG%\psql --no-locale --load-language=%PL% %TESTS%
71 set E=%ERRORLEVEL%
72 cd ..
73 exit /b %E%
74
75
76 REM Check contrib modules
77 :contribcheck
78 cd ..\..\..\contrib
79 for /d %%d IN (*) do if exist %%d\sql if exist %%d\expected (
80    call :onecontribcheck %%d
81    if errorlevel 1 exit /b 1
82 )
83 goto :eof
84
85 REM Check a single contrib module
86 :onecontribcheck
87 cd %1
88
89 perl ../../src/tools/msvc/getregress.pl > regress.tmp.bat
90 call regress.tmp.bat
91 del regress.tmp.bat
92 ..\..\%CONFIG%\pg_regress\pg_regress --psqldir=..\..\%CONFIG%\psql --no-locale --dbname=contrib_regression %TESTS%
93 set E=%ERRORLEVEL%
94 cd ..
95 exit /b %E%