/[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 862 by ph10, Wed Dec 28 17:16:11 2011 UTC revision 863 by zherczeg, Thu Jan 12 19:19:56 2012 UTC
# Line 12  Line 12 
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 9 15 and 18 require utf support
16  @rem tests 6 9 13 require ucp support  @rem tests 6 7 10 16 and 19 require ucp support
17  @rem 10 requires ucp and link size 2  @rem 11 requires ucp and link size 2
18  @rem 14 requires presense of jit support  @rem 12 requires presense of jit support
19  @rem 15 requires absence of jit support  @rem 13 requires absence of jit support
20  @rem Sheri P also added override tests for study and jit testing  @rem Sheri P also added override tests for study and jit testing
21  @rem JIT testing n/a for tests 7-10, removed JIT override test for them  @rem Zoltan Herczeg added libpcre16 support
 @rem removed override tests for 14-15  
22    
23  setlocal enabledelayedexpansion  setlocal enabledelayedexpansion
24  if [%srcdir%]==[] (  if [%srcdir%]==[] (
# Line 35  exit /b 1 Line 34  exit /b 1
34  goto :eof  goto :eof
35  )  )
36    
 if "%pcregrep%"=="" set pcregrep=.\pcregrep.exe  
37  if "%pcretest%"=="" set pcretest=.\pcretest.exe  if "%pcretest%"=="" set pcretest=.\pcretest.exe
38    
39  echo source dir is %srcdir%  echo source dir is %srcdir%
40  echo pcretest=%pcretest%  echo pcretest=%pcretest%
 echo pcregrep=%pcregrep%  
   
 if NOT exist "%pcregrep%" (  
 echo Error: "%pcregrep%" not found!  
 echo.  
 call :conferror  
 exit /b 1  
 )  
41    
42  if NOT exist "%pcretest%" (  if NOT exist "%pcretest%" (
43  echo Error: "%pcretest%" not found!  echo Error: "%pcretest%" not found!
# Line 56  call :conferror Line 46  call :conferror
46  exit /b 1  exit /b 1
47  )  )
48    
49  "%pcretest%" -C|"%pcregrep%" --no-jit "No UTF-8 support">NUL  "%pcretest%" -C linksize >NUL
50  set utf8=%ERRORLEVEL%  set link_size=%ERRORLEVEL%
51  "%pcretest%" -C|"%pcregrep%" --no-jit "No Unicode properties support">NUL  "%pcretest%" -C pcre8 >NUL
52    set support8=%ERRORLEVEL%
53    "%pcretest%" -C pcre16 >NUL
54    set support16=%ERRORLEVEL%
55    "%pcretest%" -C utf >NUL
56    set utf=%ERRORLEVEL%
57    "%pcretest%" -C ucp >NUL
58  set ucp=%ERRORLEVEL%  set ucp=%ERRORLEVEL%
59  "%pcretest%" -C|"%pcregrep%" --no-jit "No just-in-time compiler support">NUL  "%pcretest%" -C jit >NUL
60  set jit=%ERRORLEVEL%  set jit=%ERRORLEVEL%
61  "%pcretest%" -C|"%pcregrep%" --no-jit "Internal link size = 2">NUL  
62  set link2=%ERRORLEVEL%  if %support8% EQU 1 (
63  set ucpandlink2=0  if not exist testout8 md testout8
64  if %ucp% EQU 1 (  if not exist testoutstudy8 md testoutstudy8
65   if %link2% EQU 0 set ucpandlink2=1  if not exist testoutjit8 md testoutjit8
66  )  )
67    
68  if not exist testout md testout  if %support16% EQU 1 (
69  if not exist testoutstudy md testoutstudy  if not exist testout16 md testout16
70  if not exist testoutjit md testoutjit  if not exist testoutstudy16 md testoutstudy16
71    if not exist testoutjit16 md testoutjit16
72    )
73    
74  set do1=no  set do1=no
75  set do2=no  set do2=no
# Line 88  set do12=no Line 86  set do12=no
86  set do13=no  set do13=no
87  set do14=no  set do14=no
88  set do15=no  set do15=no
89    set do16=no
90    set do17=no
91    set do18=no
92    set do19=no
93    set do20=no
94  set all=yes  set all=yes
95    
96  for %%a in (%*) do (  for %%a in (%*) do (
97    set valid=no    set valid=no
98    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 16 17 18 19 20) do if %%v == %%a set valid=yes
99    if "!valid!" == "yes" (    if "!valid!" == "yes" (
100      set do%%a=yes      set do%%a=yes
101      set all=no      set all=no
102  ) else (  ) else (
103      echo Invalid test number - %%a!      echo Invalid test number - %%a!
104          echo Usage %0 [ test_number ] ...          echo Usage %0 [ test_number ] ...
105          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 20, default is all tests.
106          exit /b 1          exit /b 1
107  )  )
108  )  )
# Line 121  if "%all%" == "yes" ( Line 124  if "%all%" == "yes" (
124    set do13=yes    set do13=yes
125    set do14=yes    set do14=yes
126    set do15=yes    set do15=yes
127      set do16=yes
128      set do17=yes
129      set do18=yes
130      set do19=yes
131      set do20=yes
132  )  )
133    
134  @echo RunTest.bat's pcretest output is written to newly created subfolders named  @echo RunTest.bat's pcretest output is written to newly created subfolders named
135  @echo testout, testoutstudy and testoutjit.  @echo testout, testoutstudy and testoutjit.
136  @echo.  @echo.
137    
138    set mode=
139    set bits=8
140    
141    :nextMode
142    if "%mode%" == "" (
143      if %support8% EQU 0 goto modeSkip
144      echo.
145      echo ---- Testing 8-bit library ----
146      echo.
147    ) else (
148      if %support16% EQU 0 goto modeSkip
149      echo.
150      echo ---- Testing 16-bit library ----
151      echo.
152    )
153  if "%do1%" == "yes" call :do1  if "%do1%" == "yes" call :do1
154  if "%do2%" == "yes" call :do2  if "%do2%" == "yes" call :do2
155  if "%do3%" == "yes" call :do3  if "%do3%" == "yes" call :do3
# Line 141  if "%do12%" == "yes" call :do12 Line 165  if "%do12%" == "yes" call :do12
165  if "%do13%" == "yes" call :do13  if "%do13%" == "yes" call :do13
166  if "%do14%" == "yes" call :do14  if "%do14%" == "yes" call :do14
167  if "%do15%" == "yes" call :do15  if "%do15%" == "yes" call :do15
168    if "%do16%" == "yes" call :do16
169    if "%do17%" == "yes" call :do17
170    if "%do18%" == "yes" call :do18
171    if "%do19%" == "yes" call :do19
172    if "%do20%" == "yes" call :do20
173    :modeSkip
174    if "%mode%" == "" (
175      set mode=-16
176      set bits=16
177      goto nextMode
178    )
179    
180  if %failed% == "yes" (  if %failed% == "yes" (
181  echo In above output, one or more of the various tests failed!  echo In above output, one or more of the various tests failed!
182  exit /b 1  exit /b 1
# Line 180  if exist %srcdir%\testdata\win%testinput Line 216  if exist %srcdir%\testdata\win%testinput
216  )  )
217    
218  echo Test %1: %3  echo Test %1: %3
219  "%pcretest%" %4 %5 %6 %7 %8 %9 "%srcdir%\testdata\%testinput%">%2\%testoutput%  "%pcretest%" %mode% %4 %5 %6 %7 %8 %9 "%srcdir%\testdata\%testinput%">%2%bits%\%testoutput%
220  if errorlevel 1 (  if errorlevel 1 (
221    echo.          failed executing command-line:    echo.          failed executing command-line:
222    echo.            "%pcretest%" %4 %5 %6 %7 %8 %9 "%srcdir%\testdata\%testinput%"^>%2\%testoutput%    echo.            "%pcretest%" %mode% %4 %5 %6 %7 %8 %9 "%srcdir%\testdata\%testinput%"^>%2%bits%\%testoutput%
223    set failed="yes"    set failed="yes"
224    goto :eof    goto :eof
225  )  )
226    
227  fc /n "%srcdir%\testdata\%testoutput%" "%2\%testoutput%">NUL  if [%1]==[11] (
228      fc /n "%srcdir%\testdata\%testoutput%-%bits%" "%2%bits%\%testoutput%">NUL
229    ) else (
230      fc /n "%srcdir%\testdata\%testoutput%" "%2%bits%\%testoutput%">NUL
231    )
232  if errorlevel 1 (  if errorlevel 1 (
233    echo.          failed comparison: fc /n "%srcdir%\testdata\%testoutput%" "%2\%testoutput%"    echo.          failed comparison: fc /n "%srcdir%\testdata\%testoutput%" "%2%bits%\%testoutput%"
234    set failed="yes"    set failed="yes"
235    if [%1]==[2] (    if [%1]==[2] (
236      echo.      echo.
# Line 202  if errorlevel 1 ( Line 242  if errorlevel 1 (
242      echo.      echo.
243  )  )
244    if [%1]==[3] (    if [%1]==[3] (
245        set failed="no"
246      echo.      echo.
247      echo ** Test 3 failure usually means french locale is not      echo ** Test 3 failure usually means french locale is not
248      echo ** available on the system, rather than a bug or problem with PCRE.      echo ** available on the system, rather than a bug or problem with PCRE.
# Line 233  goto :eof Line 274  goto :eof
274  goto :eof  goto :eof
275    
276  :do4  :do4
277    if %utf8% EQU 0 (    if %utf% EQU 0 (
278    echo Test 4 Skipped due to absence of UTF-8 support.    echo Test 4 Skipped due to absence of UTF-%bits% support.
279    goto :eof    goto :eof
280  )  )
281    call :runsub 4 testout "UTF-8 support - Compatible with Perl 5.8 and above" -q    call :runsub 4 testout "UTF-%bits% support - Compatible with Perl 5.8 and above" -q
282    call :runsub 4 testoutstudy "Test with Study Override" -q -s    call :runsub 4 testoutstudy "Test with Study Override" -q -s
283    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+
284  goto :eof  goto :eof
285    
286  :do5  :do5
287    if %utf8% EQU 0 (    if %utf% EQU 0 (
288    echo Test 5 Skipped due to absence of UTF-8 support.    echo Test 5 Skipped due to absence of UTF-%bits% support.
289    goto :eof    goto :eof
290  )  )
291    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-%bits% support" -q
292    call :runsub 5 testoutstudy "Test with Study Override" -q -s    call :runsub 5 testoutstudy "Test with Study Override" -q -s
293    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+
294  goto :eof  goto :eof
295    
296  :do6  :do6
297  if %ucp% EQU 0 (  if %ucp% EQU 0 (
298    echo Test 6 Skipped due to absence of ucp support.    echo Test 6 Skipped due to absence of Unicode property support.
299    goto :eof    goto :eof
300  )  )
301    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)" -q
302    call :runsub 6 testoutstudy "Test with Study Override" -q -s    call :runsub 6 testoutstudy "Test with Study Override" -q -s
303    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+
304  goto :eof  goto :eof
305    
306  :do7  :do7
307    call :runsub 7 testout "DFA matching" -q -dfa  if %ucp% EQU 0 (
308    call :runsub 7 testoutstudy "Test with Study Override" -q -dfa -s    echo Test 7 Skipped due to absence of Unicode property support.
309      goto :eof
310    )
311      call :runsub 7 testout "API, internals, and non-Perl stuff for Unicode property support" -q
312      call :runsub 7 testoutstudy "Test with Study Override" -q -s
313      if %jit% EQU 1 call :runsub 7 testoutjit "Test with JIT Override" -q -s+
314  goto :eof  goto :eof
315    
316  :do8  :do8
317    if %utf8% EQU 0 (    call :runsub 8 testout "DFA matching main functionality" -q -dfa
   echo Test 8 Skipped due to absence of UTF-8 support.  
   goto :eof  
 )  
   call :runsub 8 testout "DFA matching with UTF-8" -q -dfa  
318    call :runsub 8 testoutstudy "Test with Study Override" -q -dfa -s    call :runsub 8 testoutstudy "Test with Study Override" -q -dfa -s
319    goto :eof  goto :eof
320    
321  :do9  :do9
322    if %ucp% EQU 0 (    if %utf% EQU 0 (
323    echo Test 9 Skipped due to absence of ucp support.    echo Test 9 Skipped due to absence of UTF-%bits% support.
324    goto :eof    goto :eof
325  )  )
326    call :runsub 9 testout "DFA matching with Unicode properties" -q -dfa    call :runsub 9 testout "DFA matching with UTF-%bits%" -q -dfa
327    call :runsub 9 testoutstudy "Test with Study Override" -q -dfa -s    call :runsub 9 testoutstudy "Test with Study Override" -q -dfa -s
328  goto :eof    goto :eof
329    
330  :do10  :do10
331    if %ucpandlink2% EQU 0 (    if %ucp% EQU 0 (
332    echo Test 10 Skipped due to requirements of ucp support AND link size 2.    echo Test 10 Skipped due to absence of Unicode property support.
333    goto :eof    goto :eof
334  )  )
335    call :runsub 10 testout "Internal offsets and code size tests" -q    call :runsub 10 testout "DFA matching with Unicode properties" -q -dfa
336    call :runsub 10 testoutstudy "Test with Study Override" -q -s    call :runsub 10 testoutstudy "Test with Study Override" -q -dfa -s
337  goto :eof  goto :eof
338    
339  :do11  :do11
340    call :runsub 11 testout "Features from Perl 5.10 and above" -q    if NOT %link_size% EQU 2 (
341      echo Test 11 Skipped because link size is not 2.
342      goto :eof
343    )
344      if %ucp% EQU 0 (
345      echo Test 11 Skipped due to absence of Unicode property support.
346      goto :eof
347    )
348      call :runsub 11 testout "Internal offsets and code size tests" -q
349    call :runsub 11 testoutstudy "Test with Study Override" -q -s    call :runsub 11 testoutstudy "Test with Study Override" -q -s
   if %jit% EQU 1 call :runsub 11 testoutjit "Test with JIT Override" -q -s+  
350  goto :eof  goto :eof
351    
352  :do12  :do12
353    if %utf8% EQU 0 (  if %jit% EQU 0 (
354    echo Test 12 Skipped due to absence of UTF-8 support.    echo Test 12 Skipped due to absence of JIT support.
355    goto :eof    goto :eof
356  )  )
357    call :runsub 12 testout "Features from Perl 5.10 and above w UTF-8" -q    call :runsub 12 testout "JIT-specific features - have JIT" -q
   call :runsub 12 testoutstudy "Test with Study Override" -q -s  
   if %jit% EQU 1 call :runsub 12 testoutjit "Test with JIT Override" -q -s+  
358  goto :eof  goto :eof
359    
360  :do13  :do13
361    if %ucp% EQU 0 (    if %jit% EQU 1 (
362    echo Test 13 Skipped due to absence of ucp support.    echo Test 13 Skipped due to presence of JIT support.
363    goto :eof    goto :eof
364  )  )
365  call :runsub 13 testout "API internals and non-Perl stuff for Unicode property support" -q    call :runsub 13 testout "JIT-specific features - no JIT" -q
 call :runsub 13 testoutstudy "Test with Study Override" -q -s  
 if %jit% EQU 1 call :runsub 13 testoutjit "Test with JIT Override" -q -s+  
366  goto :eof  goto :eof
367    
368  :do14  :do14
369  if %jit% EQU 0 (    if NOT %bits% EQU 8 (
370    echo Test 14 Skipped due to absence of JIT support.    echo Test 14 Skipped when running 16-bit tests.
371    goto :eof    goto :eof
372  )  )
373    call :runsub 14 testout "JIT-specific features - have JIT" -q    call :runsub 14 testout "Specials for the basic 8-bit library" -q
374      call :runsub 14 testoutstudy "Test with Study Override" -q -s
375      if %jit% EQU 1 call :runsub 14 testoutjit "Test with JIT Override" -q -s+
376  goto :eof  goto :eof
377    
378  :do15  :do15
379    if %jit% EQU 1 (    if NOT %bits% EQU 8 (
380    echo Test 15 Skipped due to presence of JIT support.    echo Test 15 Skipped when running 16-bit tests.
381      goto :eof
382    )
383      if %utf% EQU 0 (
384      echo Test 15 Skipped due to absence of UTF-8 support.
385      goto :eof
386    )
387      call :runsub 15 testout "Specials for the 8-bit library with UTF-8 support" -q
388      call :runsub 15 testoutstudy "Test with Study Override" -q -s
389      if %jit% EQU 1 call :runsub 15 testoutjit "Test with JIT Override" -q -s+
390    goto :eof
391    
392    :do16
393      if NOT %bits% EQU 8 (
394      echo Test 16 Skipped when running 16-bit tests.
395      goto :eof
396    )
397      if %ucp% EQU 0 (
398      echo Test 16 Skipped due to absence of Unicode property support.
399      goto :eof
400    )
401      call :runsub 16 testout "Specials for the 8-bit library with Unicode propery support" -q
402      call :runsub 16 testoutstudy "Test with Study Override" -q -s
403      if %jit% EQU 1 call :runsub 16 testoutjit "Test with JIT Override" -q -s+
404    goto :eof
405    
406    :do17
407      if NOT %bits% EQU 16 (
408      echo Test 17 Skipped when running 8-bit tests.
409      goto :eof
410    )
411      copy /Y "%srcdir%\testdata\saved8" testsaved8
412      copy /Y "%srcdir%\testdata\saved16LE-1" testsaved16LE-1
413      copy /Y "%srcdir%\testdata\saved16BE-1" testsaved16BE-1
414      call :runsub 17 testout "Specials for the basic 8-bit library" -q
415      call :runsub 17 testoutstudy "Test with Study Override" -q -s
416      if %jit% EQU 1 call :runsub 17 testoutjit "Test with JIT Override" -q -s+
417    goto :eof
418    
419    :do18
420      if NOT %bits% EQU 16 (
421      echo Test 18 Skipped when running 8-bit tests.
422      goto :eof
423    )
424      if %utf% EQU 0 (
425      echo Test 18 Skipped due to absence of UTF-8 support.
426      goto :eof
427    )
428      copy /Y "%srcdir%\testdata\saved16LE-2" testsaved16LE-2
429      copy /Y "%srcdir%\testdata\saved16BE-2" testsaved16BE-2
430      call :runsub 18 testout "Specials for the basic 8-bit library" -q
431      call :runsub 18 testoutstudy "Test with Study Override" -q -s
432      if %jit% EQU 1 call :runsub 18 testoutjit "Test with JIT Override" -q -s+
433    goto :eof
434    
435    :do19
436      if NOT %bits% EQU 16 (
437      echo Test 19 Skipped when running 8-bit tests.
438      goto :eof
439    )
440      if %ucp% EQU 0 (
441      echo Test 19 Skipped due to absence of Unicode property support.
442      goto :eof
443    )
444      call :runsub 19 testout "Specials for the basic 8-bit library" -q
445      call :runsub 19 testoutstudy "Test with Study Override" -q -s
446      if %jit% EQU 1 call :runsub 19 testoutjit "Test with JIT Override" -q -s+
447    goto :eof
448    
449    :do20
450      if NOT %bits% EQU 16 (
451      echo Test 20 Skipped when running 8-bit tests.
452    goto :eof    goto :eof
453  )  )
454    call :runsub 15 testout "JIT-specific features - no JIT" -q    call :runsub 20 testout "DFA specials for the basic 16-bit library" -q
455      call :runsub 20 testoutstudy "Test with Study Override" -q -s
456  goto :eof  goto :eof
457    
458  :conferror  :conferror

Legend:
Removed from v.862  
changed lines
  Added in v.863

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12