/[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 718 by ph10, Sun Sep 25 10:54:12 2011 UTC revision 719 by ph10, Fri Oct 7 11:41:05 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 requires both pcretest and pcregrep
4  @rem  This file was contributed by Ralf Junker, and touched up by  @rem  This file was originally 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
# Line 17  Line 17 
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  @rem Sheri P also added override tests for study and jit testing  @rem Sheri P also added override tests for study and jit testing
 @rem Output is written to newly created subfolders named testout testoutstudy and testoutjit.  
 @rem Current dir should be the build dir. The testdata folder should exist in the current dir or in ..  
 @rem Copy RunTest.bat to the build dir manually if necessary.  
 @rem  
21    
22  setlocal enabledelayedexpansion  setlocal enabledelayedexpansion
23    if [%srcdir%]==[] (
24  if exist testdata set srcdir=.  if exist testdata\ set srcdir=.)
25  if [%srcdir%]==[]   set srcdir=..  if [%srcdir%]==[] (
26  if NOT exist %srcdir%\testdata (  if exist ..\testdata\ set srcdir=..)
27  echo distribution testdata folder not found.  if [%srcdir%]==[] (
28    if exist ..\..\testdata\ set srcdir=..\..)
29    if NOT exist "%srcdir%\testdata\" (
30    Error: echo distribution testdata folder not found.
31    call :conferror
32  exit /b 1  exit /b 1
33  goto :eof  goto :eof
34  )  )
 if [%pcretest%]==[] set pcretest=pcretest  
35    
36  %pcretest% -C |findstr /C:"No UTF-8 support" >NUL  if "%pcregrep%"=="" set pcregrep=.\pcregrep.exe
37    if "%pcretest%"=="" set pcretest=.\pcretest.exe
38    
39    echo source dir is %srcdir%
40    echo pcretest=%pcretest%
41    echo pcregrep=%pcregrep%
42    
43    if NOT exist "%pcregrep%" (
44    echo Error: "%pcregrep%" not found.
45    echo.
46    call :conferror
47    exit /b 1
48    )
49    
50    if NOT exist "%pcretest%" (
51    echo Error: "%pcretest%" not found.
52    echo.
53    call :conferror
54    exit /b 1
55    )
56    
57    "%pcretest%" -C|"%pcregrep%" --no-jit "No UTF-8 support">NUL
58  set utf8=%ERRORLEVEL%  set utf8=%ERRORLEVEL%
59  %pcretest% -C |findstr /C:"No Unicode properties support" >NUL  "%pcretest%" -C|"%pcregrep%" --no-jit "No Unicode properties support">NUL
60  set ucp=%ERRORLEVEL%  set ucp=%ERRORLEVEL%
61  %pcretest% -C |findstr /C:"No just-in-time compiler support" >NUL  "%pcretest%" -C|"%pcregrep%" --no-jit "No just-in-time compiler support">NUL
62  set jit=%ERRORLEVEL%  set jit=%ERRORLEVEL%
63  %pcretest% -C |findstr /C:"Internal link size = 2" >NUL  "%pcretest%" -C|"%pcregrep%" --no-jit "Internal link size = 2">NUL
64  set link2=%ERRORLEVEL%  set link2=%ERRORLEVEL%
   
65  set ucpandlink2=0  set ucpandlink2=0
66  if %ucp% EQU 1 (  if %ucp% EQU 1 (
67   if %link2% EQU 0 set ucpandlink2=1   if %link2% EQU 0 set ucpandlink2=1
# Line 83  for %%a in (%*) do ( Line 101  for %%a in (%*) do (
101          exit /b 1          exit /b 1
102  )  )
103  )  )
104    set failed="no"
105    
106  if "%all%" == "yes" (  if "%all%" == "yes" (
107    set do1=yes    set do1=yes
108    set do2=yes    set do2=yes
# Line 101  if "%all%" == "yes" ( Line 121  if "%all%" == "yes" (
121    set do15=yes    set do15=yes
122  )  )
123    
124    @echo RunTest.bat's pcretest output is written to newly created subfolders named
125    @echo testout, testoutstudy and testoutjit.
126    @echo.
127  if "%do1%" == "yes" call :do1  if "%do1%" == "yes" call :do1
128  if "%do2%" == "yes" call :do2  if "%do2%" == "yes" call :do2
129  if "%do3%" == "yes" call :do3  if "%do3%" == "yes" call :do3
# Line 116  if "%do12%" == "yes" call :do12 Line 139  if "%do12%" == "yes" call :do12
139  if "%do13%" == "yes" call :do13  if "%do13%" == "yes" call :do13
140  if "%do14%" == "yes" call :do14  if "%do14%" == "yes" call :do14
141  if "%do15%" == "yes" call :do15  if "%do15%" == "yes" call :do15
142    if %failed% == "yes" (
143    echo In above output, one or more of the various tests failed!
144    exit /b 1
145    )
146    echo All OK
147  goto :eof  goto :eof
148    
149  :runsub  :runsub
# Line 149  if exist %srcdir%\testdata\win%testinput Line 177  if exist %srcdir%\testdata\win%testinput
177    set testoutput=wintestoutput%1    set testoutput=wintestoutput%1
178  )  )
179    
 echo.  
180  echo Test %1: %3  echo Test %1: %3
181  %pcretest% %4 %5 %6 %7 %8 %9 %srcdir%\testdata\%testinput%>%2\%testoutput%  "%pcretest%" %4 %5 %6 %7 %8 %9 "%srcdir%\testdata\%testinput%">%2\%testoutput%
182  if errorlevel 1 (  if errorlevel 1 (
183    echo Test %1: pcretest failed!    echo.          failed executing command-line:
184      echo.            "%pcretest%" %4 %5 %6 %7 %8 %9 "%srcdir%\testdata\%testinput%"^>%2\%testoutput%
185      set failed="yes"
186    goto :eof    goto :eof
187  )  )
188    
189  fc /n %srcdir%\testdata\%testoutput% %2\%testoutput%  fc /n "%srcdir%\testdata\%testoutput%" "%2\%testoutput%">NUL
190  if errorlevel 1 (  if errorlevel 1 (
191    echo Test %1: file compare failed!    echo.          failed comparison: fc /n "%srcdir%\testdata\%testoutput%" "%2\%testoutput%"
192      set failed="yes"
193      if [%1]==[2] (
194        echo.
195        echo ** Test 2 requires a lot of stack. PCRE can be configured to
196        echo ** use heap for recursion. Otherwise, to pass Test 2
197        echo ** you generally need to allocate 8 mb stack to PCRE.
198        echo ** See the 'pcrestack' page for a discussion of PCRE's
199        echo ** stack usage.
200        echo.
201    )
202      if [%1]==[3] (
203        echo.
204        echo ** Test 3 failure usually means french locale is not
205        echo ** available on the system, rather than a bug or problem with PCRE.
206        echo.
207    )
208    
209    goto :eof    goto :eof
210  )  )
211    
212  echo Test %1: Passed.  echo.          Passed.
 echo.  
213  goto :eof  goto :eof
214    
215  :do1  :do1
# Line 295  goto :eof Line 340  goto :eof
340    call :runsub 15 testout "JIT-specific features - no JIT" -q    call :runsub 15 testout "JIT-specific features - no JIT" -q
341    call :runsub 15 testoutstudy "Test with Study Override" -q -s    call :runsub 15 testoutstudy "Test with Study Override" -q -s
342  goto :eof  goto :eof
343    
344    :conferror
345    @echo Configuration error.
346    @echo.
347    @echo If configured with cmake and executed via "make test" or the MSVC "RUN_TESTS"
348    @echo project, pcre_test.bat defines variables and automatically calls RunTest.bat.
349    @echo For manual testing of all available features, after configuring with cmake
350    @echo and building, you can run the built pcre_test.bat. For best results with
351    @echo cmake builds and tests avoid directories with full path names that include
352    @echo spaces for source or build.
353    @echo.
354    @echo Otherwise, if the build dir is in a subdir of the source dir, testdata needed
355    @echo for input and verification should be found automatically when (from the
356    @echo location of the the built exes) you call RunTest.bat. By default RunTest.bat
357    @echo runs all tests compatible with the linked pcre library but it can be given
358    @echo a test number as an argument.
359    @echo.
360    @echo If the build dir is not under the source dir you can either copy your exes
361    @echo to the source folder or copy RunTest.bat and the testdata folder to the
362    @echo location of your built exes and then run RunTest.bat.
363    @echo.
364    goto :eof

Legend:
Removed from v.718  
changed lines
  Added in v.719

  ViewVC Help
Powered by ViewVC 1.1.5