/[pcre]/code/trunk/RunTest.bat
ViewVC logotype

Diff of /code/trunk/RunTest.bat

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 700 by ph10, Tue Sep 20 10:51:26 2011 UTC revision 708 by ph10, Fri Sep 23 11:03:03 2011 UTC
# Line 1  Line 1 
1  @echo off  @echo off
2  @rem This file must use CRLF linebreaks to function properly  @rem This file must use CRLF linebreaks to function properly
3  @rem and user must have external findstr command  @rem and user must have external findstr command
4  @rem  This file was contributed by Ralf Junker, and touched up by  @rem  This file was contributed by Ralf Junker, and touched up by
5  @rem  Daniel Richard G. Tests 10-12 added by Philip H.  @rem  Daniel Richard G. Tests 10-12 added by Philip H.
6  @rem  Philip H also changed test 3 to use "wintest" files.  @rem  Philip H also changed test 3 to use "wintest" files.
7  @rem  @rem
8  @rem  Updated by Tom Fortmann to support explicit test numbers on the command line.  @rem  Updated by Tom Fortmann to support explicit test numbers on the command line.
9  @rem  Added argument validation and added error reporting.  @rem  Added argument validation and added error reporting.
10  @rem  @rem
11  @rem  MS Windows batch file to run pcretest on testfiles with the correct  @rem  MS Windows batch file to run pcretest on testfiles with the correct
12  @rem  options.  @rem  options.
13  @rem  @rem
14  @rem Sheri Pierce added logic to skip feature dependent tests  @rem Sheri Pierce added logic to skip feature dependent tests
15  @rem tests 4 5 8 and 12 require utf8 support  @rem tests 4 5 8 and 12 require utf8 support
16  @rem tests 6 9 13 require ucp support  @rem tests 6 9 13 require ucp support
17  @rem 10 requires ucp and link size 2  @rem 10 requires ucp and link size 2
18  @rem 14 requires presense of jit support  @rem 14 requires presense of jit support
19  @rem 15 requires absence of jit support  @rem 15 requires absence of jit support
20    
21  @rem Sheri P also added override tests for study and jit testing  @rem Sheri P also added override tests for study and jit testing
22  @rem Output is written to newly created subfolders named testout testoutstudy and testoutjit.  @rem Output is written to newly created subfolders named testout testoutstudy and testoutjit.
23  @rem Current dir should be the build dir. The testdata folder should exist in the current dir or in ..  @rem Current dir should be the build dir. The testdata folder should exist in the current dir or in ..
24  @rem Copy RunTest.bat to the build dir manually if necessary.  @rem Copy RunTest.bat to the build dir manually if necessary.
25  @rem  @rem
26    
27  setlocal enabledelayedexpansion  setlocal enabledelayedexpansion
28    
29  if exist testdata set srcdir=.  if exist testdata set srcdir=.
30  if [%srcdir%]==[]   set srcdir=..  if [%srcdir%]==[]   set srcdir=..
31  if NOT exist %srcdir%\testdata (  if NOT exist %srcdir%\testdata (
32  echo distribution testdata folder not found.  echo distribution testdata folder not found.
33  exit /b 1  exit /b 1
34  goto :eof  goto :eof
35  )  )
36  if [%pcretest%]==[] set pcretest=pcretest  if [%pcretest%]==[] set pcretest=pcretest
37    
38  %pcretest% -C |findstr /C:"No UTF-8 support" >NUL  %pcretest% -C |findstr /C:"No UTF-8 support" >NUL
39  set utf8=%ERRORLEVEL%  set utf8=%ERRORLEVEL%
40  %pcretest% -C |findstr /C:"No Unicode properties support" >NUL  %pcretest% -C |findstr /C:"No Unicode properties support" >NUL
41  set ucp=%ERRORLEVEL%  set ucp=%ERRORLEVEL%
42  %pcretest% -C |findstr /C:"No just-in-time compiler support" >NUL  %pcretest% -C |findstr /C:"No just-in-time compiler support" >NUL
43  set jit=%ERRORLEVEL%  set jit=%ERRORLEVEL%
44  %pcretest% -C |findstr /C:"Internal link size = 2" >NUL  %pcretest% -C |findstr /C:"Internal link size = 2" >NUL
45  set link2=%ERRORLEVEL%  set link2=%ERRORLEVEL%
46    
47  set ucpandlink2=0  set ucpandlink2=0
48  if %ucp% EQU 1 (  if %ucp% EQU 1 (
49   if %link2% EQU 0 set ucpandlink2=1   if %link2% EQU 0 set ucpandlink2=1
50  )  )
51    
52  if not exist testout md testout  if not exist testout md testout
53  if not exist testoutstudy md testoutstudy  if not exist testoutstudy md testoutstudy
54  if not exist testoutjit md testoutjit  if not exist testoutjit md testoutjit
55    
56  set do1=no  set do1=no
57  set do2=no  set do2=no
58  set do3=no  set do3=no
59  set do4=no  set do4=no
60  set do5=no  set do5=no
61  set do6=no  set do6=no
62  set do7=no  set do7=no
63  set do8=no  set do8=no
64  set do9=no  set do9=no
65  set do10=no  set do10=no
66  set do11=no  set do11=no
67  set do12=no  set do12=no
68  set do13=no  set do13=no
69  set do14=no  set do14=no
70  set do15=no  set do15=no
71  set all=yes  set all=yes
72    
73  for %%a in (%*) do (  for %%a in (%*) do (
74    set valid=no    set valid=no
75    for %%v in (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15) do if %%v == %%a set valid=yes    for %%v in (1 2 3 4 5 6 7 8 9 10 11 12 13 14 15) do if %%v == %%a set valid=yes
76    if "!valid!" == "yes" (    if "!valid!" == "yes" (
77      set do%%a=yes      set do%%a=yes
78      set all=no      set all=no
79  ) else (  ) else (
80      echo Invalid test number - %%a!      echo Invalid test number - %%a!
81          echo Usage %0 [ test_number ] ...          echo Usage %0 [ test_number ] ...
82          echo Where test_number is one or more optional test numbers 1 through 15, default is all tests.          echo Where test_number is one or more optional test numbers 1 through 15, default is all tests.
83          exit /b 1          exit /b 1
84  )  )
85  )  )
86  if "%all%" == "yes" (  if "%all%" == "yes" (
87    set do1=yes    set do1=yes
88    set do2=yes    set do2=yes
89    set do3=yes    set do3=yes
90    set do4=yes    set do4=yes
91    set do5=yes    set do5=yes
92    set do6=yes    set do6=yes
93    set do7=yes    set do7=yes
94    set do8=yes    set do8=yes
95    set do9=yes    set do9=yes
96    set do10=yes    set do10=yes
97    set do11=yes    set do11=yes
98    set do12=yes    set do12=yes
99    set do13=yes    set do13=yes
100    set do14=yes    set do14=yes
101    set do15=yes    set do15=yes
102  )  )
103    
104  if "%do1%" == "yes" call :do1  if "%do1%" == "yes" call :do1
105  if "%do2%" == "yes" call :do2  if "%do2%" == "yes" call :do2
106  if "%do3%" == "yes" call :do3  if "%do3%" == "yes" call :do3
107  if "%do4%" == "yes" call :do4  if "%do4%" == "yes" call :do4
108  if "%do5%" == "yes" call :do5  if "%do5%" == "yes" call :do5
109  if "%do6%" == "yes" call :do6  if "%do6%" == "yes" call :do6
110  if "%do7%" == "yes" call :do7  if "%do7%" == "yes" call :do7
111  if "%do8%" == "yes" call :do8  if "%do8%" == "yes" call :do8
112  if "%do9%" == "yes" call :do9  if "%do9%" == "yes" call :do9
113  if "%do10%" == "yes" call :do10  if "%do10%" == "yes" call :do10
114  if "%do11%" == "yes" call :do11  if "%do11%" == "yes" call :do11
115  if "%do12%" == "yes" call :do12  if "%do12%" == "yes" call :do12
116  if "%do13%" == "yes" call :do13  if "%do13%" == "yes" call :do13
117  if "%do14%" == "yes" call :do14  if "%do14%" == "yes" call :do14
118  if "%do15%" == "yes" call :do15  if "%do15%" == "yes" call :do15
119  goto :eof  goto :eof
120    
121  :runsub  :runsub
122  @rem Function to execute pcretest and compare the output  @rem Function to execute pcretest and compare the output
123  @rem Arguments are as follows:  @rem Arguments are as follows:
124  @rem  @rem
125  @rem       1 = test number  @rem       1 = test number
126  @rem       2 = outputdir  @rem       2 = outputdir
127  @rem       3 = test name use double quotes  @rem       3 = test name use double quotes
128  @rem   4 - 9 = pcretest options  @rem   4 - 9 = pcretest options
129    
130  if [%1] == [] (  if [%1] == [] (
131    echo Missing test number argument!    echo Missing test number argument!
132    exit /b 1    exit /b 1
133  )  )
134    
135  if [%2] == [] (  if [%2] == [] (
136    echo Missing outputdir!    echo Missing outputdir!
137    exit /b 1    exit /b 1
138  )  )
139    
140  if [%3] == [] (  if [%3] == [] (
141    echo Missing test name argument!    echo Missing test name argument!
142    exit /b 1    exit /b 1
143  )  )
144    
145  set testinput=testinput%1  set testinput=testinput%1
146  set testoutput=testoutput%1  set testoutput=testoutput%1
147  if exist %srcdir%\testdata\win%testinput% (  if exist %srcdir%\testdata\win%testinput% (
148    set testinput=wintestinput%1    set testinput=wintestinput%1
149    set testoutput=wintestoutput%1    set testoutput=wintestoutput%1
150  )  )
151    
152  echo.  echo.
153  echo Test %1: %3  echo Test %1: %3
154  %pcretest% %4 %5 %6 %7 %8 %9 %srcdir%\testdata\%testinput%>%2\%testoutput%  %pcretest% %4 %5 %6 %7 %8 %9 %srcdir%\testdata\%testinput%>%2\%testoutput%
155  if errorlevel 1 (  if errorlevel 1 (
156    echo Test %1: pcretest failed!    echo Test %1: pcretest failed!
157    goto :eof    goto :eof
158  )  )
159    
160  fc /n %srcdir%\testdata\%testoutput% %2\%testoutput%  fc /n %srcdir%\testdata\%testoutput% %2\%testoutput%
161  if errorlevel 1 (  if errorlevel 1 (
162    echo Test %1: file compare failed!    echo Test %1: file compare failed!
163    goto :eof    goto :eof
164  )  )
165    
166  echo Test %1: Passed.  echo Test %1: Passed.
167  echo.  echo.
168  goto :eof  goto :eof
169    
170  :do1  :do1
171  call :runsub 1 testout "Main functionality - Compatible with Perl 5.8 and above" -q  call :runsub 1 testout "Main functionality - Compatible with Perl 5.8 and above" -q
172  call :runsub 1 testoutstudy "Test with Study Override" -q -s  call :runsub 1 testoutstudy "Test with Study Override" -q -s
173  if %jit% EQU 1 call :runsub 1 testoutjit "Test with JIT Override" -q -s+  if %jit% EQU 1 call :runsub 1 testoutjit "Test with JIT Override" -q -s+
174  goto :eof  goto :eof
175    
176  :do2  :do2
177    call :runsub 2 testout "API, errors, internals, and non-Perl stuff" -q    call :runsub 2 testout "API, errors, internals, and non-Perl stuff" -q
178    call :runsub 2 testoutstudy "Test with Study Override" -q -s    call :runsub 2 testoutstudy "Test with Study Override" -q -s
179    if %jit% EQU 1 call :runsub 2 testoutjit "Test with JIT Override" -q -s+    if %jit% EQU 1 call :runsub 2 testoutjit "Test with JIT Override" -q -s+
180  goto :eof  goto :eof
181    
182  :do3  :do3
183    call :runsub 3 testout "Locale-specific features" -q    call :runsub 3 testout "Locale-specific features" -q
184    call :runsub 3 testoutstudy "Test with Study Override" -q -s    call :runsub 3 testoutstudy "Test with Study Override" -q -s
185    if %jit% EQU 1 call :runsub 3 testoutjit "Test with JIT Override" -q -s+    if %jit% EQU 1 call :runsub 3 testoutjit "Test with JIT Override" -q -s+
186  goto :eof  goto :eof
187    
188  :do4  :do4
189    if %utf8% EQU 0 (    if %utf8% EQU 0 (
190    echo Test 4 Skipped due to absence of UTF-8 support.    echo Test 4 Skipped due to absence of UTF-8 support.
191    goto :eof    goto :eof
192  )  )
193    call :runsub 4 testout "UTF-8 support - Compatible with Perl 5.8 and above" -q    call :runsub 4 testout "UTF-8 support - Compatible with Perl 5.8 and above" -q
194    call :runsub 4 testoutstudy "Test with Study Override" -q -s    call :runsub 4 testoutstudy "Test with Study Override" -q -s
195    if %jit% EQU 1 call :runsub 4 testoutjit "Test with JIT Override" -q -s+    if %jit% EQU 1 call :runsub 4 testoutjit "Test with JIT Override" -q -s+
196  goto :eof  goto :eof
197    
198  :do5  :do5
199    if %utf8% EQU 0 (    if %utf8% EQU 0 (
200    echo Test 5 Skipped due to absence of UTF-8 support.    echo Test 5 Skipped due to absence of UTF-8 support.
201    goto :eof    goto :eof
202  )  )
203    call :runsub 5 testout "API, internals, and non-Perl stuff for UTF-8 support" -q    call :runsub 5 testout "API, internals, and non-Perl stuff for UTF-8 support" -q
204    call :runsub 5 testoutstudy "Test with Study Override" -q -s    call :runsub 5 testoutstudy "Test with Study Override" -q -s
205    if %jit% EQU 1 call :runsub 5 testoutjit "Test with JIT Override" -q -s+    if %jit% EQU 1 call :runsub 5 testoutjit "Test with JIT Override" -q -s+
206  goto :eof  goto :eof
207    
208  :do6  :do6
209  if %ucp% EQU 0 (  if %ucp% EQU 0 (
210    echo Test 6 Skipped due to absence of ucp support.    echo Test 6 Skipped due to absence of ucp support.
211    goto :eof    goto :eof
212  )  )
213    call :runsub 6 testout "Unicode property support - Compatible with Perl 5.10 and above" -q    call :runsub 6 testout "Unicode property support - Compatible with Perl 5.10 and above" -q
214    call :runsub 6 testoutstudy "Test with Study Override" -q -s    call :runsub 6 testoutstudy "Test with Study Override" -q -s
215    if %jit% EQU 1 call :runsub 6 testoutjit "Test with JIT Override" -q -s+    if %jit% EQU 1 call :runsub 6 testoutjit "Test with JIT Override" -q -s+
216  goto :eof  goto :eof
217    
218  :do7  :do7
219    call :runsub 7 testout "DFA matching" -q -dfa    call :runsub 7 testout "DFA matching" -q -dfa
220    call :runsub 7 testoutstudy "Test with Study Override" -q -dfa -s    call :runsub 7 testoutstudy "Test with Study Override" -q -dfa -s
221    if %jit% EQU 1 call :runsub 7 testoutjit "Test with JIT Override" -q -dfa -s+    if %jit% EQU 1 call :runsub 7 testoutjit "Test with JIT Override" -q -dfa -s+
222  goto :eof  goto :eof
223    
224  :do8  :do8
225    if %utf8% EQU 0 (    if %utf8% EQU 0 (
226    echo Test 8 Skipped due to absence of UTF-8 support.    echo Test 8 Skipped due to absence of UTF-8 support.
227    goto :eof    goto :eof
228  )  )
229    call :runsub 8 testout "DFA matching with UTF-8" -q -dfa    call :runsub 8 testout "DFA matching with UTF-8" -q -dfa
230    call :runsub 8 testoutstudy "Test with Study Override" -q -dfa -s    call :runsub 8 testoutstudy "Test with Study Override" -q -dfa -s
231    if %jit% EQU 1 call :runsub 8 testoutjit "Test with JIT Override" -q -dfa -s+    if %jit% EQU 1 call :runsub 8 testoutjit "Test with JIT Override" -q -dfa -s+
232    goto :eof    goto :eof
233    
234  :do9  :do9
235    if %ucp% EQU 0 (    if %ucp% EQU 0 (
236    echo Test 9 Skipped due to absence of ucp support.    echo Test 9 Skipped due to absence of ucp support.
237    goto :eof    goto :eof
238  )  )
239    call :runsub 9 testout "DFA matching with Unicode properties" -q -dfa    call :runsub 9 testout "DFA matching with Unicode properties" -q -dfa
240    call :runsub 9 testoutstudy "Test with Study Override" -q -dfa -s    call :runsub 9 testoutstudy "Test with Study Override" -q -dfa -s
241    if %jit% EQU 1 call :runsub 9 testoutjit "Test with JIT Override" -q -dfa -s+    if %jit% EQU 1 call :runsub 9 testoutjit "Test with JIT Override" -q -dfa -s+
242  goto :eof  goto :eof
243    
244  :do10  :do10
245    if %ucpandlink2% EQU 0 (    if %ucpandlink2% EQU 0 (
246    echo Test 10 Skipped due to requirements of ucp support AND link size 2.    echo Test 10 Skipped due to requirements of ucp support AND link size 2.
247    goto :eof    goto :eof
248  )  )
249    call :runsub 10 testout "Internal offsets and code size tests" -q    call :runsub 10 testout "Internal offsets and code size tests" -q
250    call :runsub 10 testoutstudy "Test with Study Override" -q -s    call :runsub 10 testoutstudy "Test with Study Override" -q -s
251    if %jit% EQU 1 call :runsub 10 testoutjit "Test with JIT Override" -q -s+    if %jit% EQU 1 call :runsub 10 testoutjit "Test with JIT Override" -q -s+
252  goto :eof  goto :eof
253    
254  :do11  :do11
255    call :runsub 11 testout "Features from Perl 5.10 and above" -q    call :runsub 11 testout "Features from Perl 5.10 and above" -q
256    call :runsub 11 testoutstudy "Test with Study Override" -q -s    call :runsub 11 testoutstudy "Test with Study Override" -q -s
257    if %jit% EQU 1 call :runsub 11 testoutjit "Test with JIT Override" -q -s+    if %jit% EQU 1 call :runsub 11 testoutjit "Test with JIT Override" -q -s+
258  goto :eof  goto :eof
259    
260  :do12  :do12
261    if %utf8% EQU 0 (    if %utf8% EQU 0 (
262    echo Test 12 Skipped due to absence of UTF-8 support.    echo Test 12 Skipped due to absence of UTF-8 support.
263    goto :eof    goto :eof
264  )  )
265    call :runsub 12 testout "Features from Perl 5.10 and above w UTF-8" -q    call :runsub 12 testout "Features from Perl 5.10 and above w UTF-8" -q
266    call :runsub 12 testoutstudy "Test with Study Override" -q -s    call :runsub 12 testoutstudy "Test with Study Override" -q -s
267    if %jit% EQU 1 call :runsub 12 testoutjit "Test with JIT Override" -q -s+    if %jit% EQU 1 call :runsub 12 testoutjit "Test with JIT Override" -q -s+
268  goto :eof  goto :eof
269    
270  :do13  :do13
271    if %ucp% EQU 0 (    if %ucp% EQU 0 (
272    echo Test 13 Skipped due to absence of ucp support.    echo Test 13 Skipped due to absence of ucp support.
273    goto :eof    goto :eof
274  )  )
275  call :runsub 13 testout "API internals and non-Perl stuff for Unicode property support" -q  call :runsub 13 testout "API internals and non-Perl stuff for Unicode property support" -q
276  call :runsub 13 testoutstudy "Test with Study Override" -q -s  call :runsub 13 testoutstudy "Test with Study Override" -q -s
277  if %jit% EQU 1 call :runsub 13 testoutjit "Test with JIT Override" -q -s+  if %jit% EQU 1 call :runsub 13 testoutjit "Test with JIT Override" -q -s+
278  goto :eof  goto :eof
279    
280  :do14  :do14
281  if %jit% EQU 0 (  if %jit% EQU 0 (
282    echo Test 14 Skipped due to absence of JIT support.    echo Test 14 Skipped due to absence of JIT support.
283    goto :eof    goto :eof
284  )  )
285    call :runsub 14 testout "JIT-specific features - have JIT" -q    call :runsub 14 testout "JIT-specific features - have JIT" -q
286    call :runsub 14 testoutstudy "Test with Study Override" -q -s    call :runsub 14 testoutstudy "Test with Study Override" -q -s
287    call :runsub 14 testoutjit "Test with JIT Override" -q -s+    call :runsub 14 testoutjit "Test with JIT Override" -q -s+
288  goto :eof  goto :eof
289    
290  :do15  :do15
291    if %jit% EQU 1 (    if %jit% EQU 1 (
292    echo Test 15 Skipped due to presence of JIT support.    echo Test 15 Skipped due to presence of JIT support.
293    goto :eof    goto :eof
294  )  )
295    call :runsub 15 testout "JIT-specific features - no JIT" -q    call :runsub 15 testout "JIT-specific features - no JIT" -q
296    call :runsub 15 testoutstudy "Test with Study Override" -q -s    call :runsub 15 testoutstudy "Test with Study Override" -q -s
297  goto :eof  goto :eof

Legend:
Removed from v.700  
changed lines
  Added in v.708

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12