aboutsummaryrefslogtreecommitdiff
path: root/src/tools/msvc/vcregress.bat
blob: b3b5df9b05a81026fe79efb85975c5377d5a5571 (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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
@echo off
REM $PostgreSQL: pgsql/src/tools/msvc/vcregress.bat,v 1.6 2007/03/23 09:57:55 mha Exp $

SETLOCAL
SET STARTDIR=%CD%
if exist ..\..\..\src\tools\msvc\vcregress.bat cd ..\..\..
if exist src\tools\msvc\buildenv.bat call src\tools\msvc\buildenv.bat

set what=
if /I "%1"=="check" SET what=CHECK
if /I "%1"=="installcheck" SET what=INSTALLCHECK
if /I "%1"=="plcheck" SET what=PLCHECK
if /I "%1"=="contribcheck" SET what=CONTRIBCHECK
if "%what%"=="" goto usage

SET CONFIG=Debug
if exist release\postgres\postgres.exe SET CONFIG=Release

copy %CONFIG%\refint\refint.dll contrib\spi\
copy %CONFIG%\autoinc\autoinc.dll contrib\spi\
copy %CONFIG%\regress\regress.dll src\test\regress\

SET PATH=..\..\..\%CONFIG%\libpq;..\..\%CONFIG%\libpq;%PATH%

SET TOPDIR=%CD%
cd src\test\regress
SET SCHEDULE=parallel
SET TEMPPORT=54321
IF NOT "%2"=="" SET SCHEDULE=%2

SET PERL5LIB=..\..\tools\msvc

if "%what%"=="INSTALLCHECK" ..\..\..\%CONFIG%\pg_regress\pg_regress --psqldir=..\..\..\%CONFIG%\psql --schedule=%SCHEDULE%_schedule --multibyte=SQL_ASCII --load-language=plpgsql --no-locale
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%
if "%what%"=="PLCHECK" call :plcheck
if "%what%"=="CONTRIBCHECK" call :contribcheck
SET E=%ERRORLEVEL%

cd %STARTDIR%
exit /b %E%

:usage
echo "Usage: vcregress <check|installcheck> [schedule]"
goto :eof


REM Check procedural languages
REM Some workarounds due to inconsistently named directories
:plcheck
cd ..\..\PL
FOR /D %%d IN (*) do if exist %%d\sql if exist %%d\expected (
   if exist ..\..\%CONFIG%\%%d call :oneplcheck %%d
   if errorlevel 1 exit /b 1
   if exist ..\..\%CONFIG%\pl%%d call :oneplcheck %%d
   if errorlevel 1 exit /b 1
)
goto :eof

REM Check a single procedural language
:oneplcheck
echo Checking %1
cd %1
SET PL=%1
IF %PL%==plpython SET PL=plpythonu
IF %PL%==tcl SET PL=pltcl

perl ../../tools/msvc/getregress.pl > regress.tmp.bat
call regress.tmp.bat
del regress.tmp.bat
..\..\..\%CONFIG%\pg_regress\pg_regress --psqldir=..\..\..\%CONFIG%\psql --no-locale --load-language=%PL% %TESTS%
set E=%ERRORLEVEL%
cd ..
exit /b %E%


REM Check contrib modules
:contribcheck
cd ..\..\..\contrib
for /d %%d IN (*) do if exist %%d\sql if exist %%d\expected (
   call :onecontribcheck %%d
   if errorlevel 1 exit /b 1
)
goto :eof

REM Check a single contrib module
:onecontribcheck
cd %1

perl ../../src/tools/msvc/getregress.pl > regress.tmp.bat
call regress.tmp.bat
del regress.tmp.bat
..\..\%CONFIG%\pg_regress\pg_regress --psqldir=..\..\%CONFIG%\psql --no-locale --dbname=contrib_regression %TESTS%
set E=%ERRORLEVEL%
cd ..
exit /b %E%