]> granicus.if.org Git - postgresql/blob - src/tools/msvc/vcregress.bat
improve test headings
[postgresql] / src / tools / msvc / vcregress.bat
1 @echo off
2 REM $PostgreSQL: pgsql/src/tools/msvc/vcregress.bat,v 1.7 2007/04/04 20:53:44 adunstan 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 ==========================================================================
62 echo Checking %1
63 cd %1
64 SET PL=%1
65 IF %PL%==plpython SET PL=plpythonu
66 IF %PL%==tcl SET PL=pltcl
67
68 perl ../../tools/msvc/getregress.pl > regress.tmp.bat
69 call regress.tmp.bat
70 del regress.tmp.bat
71 ..\..\..\%CONFIG%\pg_regress\pg_regress --psqldir=..\..\..\%CONFIG%\psql --no-locale --load-language=%PL% %TESTS%
72 set E=%ERRORLEVEL%
73 cd ..
74 exit /b %E%
75
76
77 REM Check contrib modules
78 :contribcheck
79 cd ..\..\..\contrib
80 for /d %%d IN (*) do if exist %%d\sql if exist %%d\expected (
81    call :onecontribcheck %%d
82    if errorlevel 1 exit /b 1
83 )
84 goto :eof
85
86 REM Check a single contrib module
87 :onecontribcheck
88 cd %1
89
90 echo ==========================================================================
91 echo Checking %1
92 perl ../../src/tools/msvc/getregress.pl > regress.tmp.bat
93 call regress.tmp.bat
94 del regress.tmp.bat
95 ..\..\%CONFIG%\pg_regress\pg_regress --psqldir=..\..\%CONFIG%\psql --no-locale --dbname=contrib_regression %TESTS%
96 set E=%ERRORLEVEL%
97 cd ..
98 exit /b %E%