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

Diff of /code/trunk/RunTest

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

revision 1016 by ph10, Sun Aug 26 16:17:55 2012 UTC revision 1033 by ph10, Mon Sep 10 11:02:48 2012 UTC
# Line 2  Line 2 
2    
3  # Run the PCRE tests using the pcretest program. The appropriate tests are  # Run the PCRE tests using the pcretest program. The appropriate tests are
4  # selected, depending on which build-time options were used.  # selected, depending on which build-time options were used.
5    #
6  # All tests are now run both with and without -s, to ensure that everything is  # All tests are now run both with and without -s, to ensure that everything is
7  # tested with and without studying. However, there are some tests that produce  # tested with and without studying. However, there are some tests that produce
8  # different output after studying, typically when we are tracing the actual  # different output after studying, typically when we are tracing the actual
# Line 12  Line 12 
12  # any difference to their output. There is also one test which compiles invalid  # any difference to their output. There is also one test which compiles invalid
13  # UTF-8 with the UTF-8 check turned off; for this, studying must also be  # UTF-8 with the UTF-8 check turned off; for this, studying must also be
14  # disabled with /SS.  # disabled with /SS.
15    #
16  # When JIT support is available, all the tests are also run with -s+ to test  # When JIT support is available, all the tests are also run with -s+ to test
17  # (again, almost) everything with studying and the JIT option. There are also  # (again, almost) everything with studying and the JIT option. There are also
18  # two tests for JIT-specific features, one to be run when JIT support is  # two tests for JIT-specific features, one to be run when JIT support is
19  # available, and one when it is not.  # available, and one when it is not.
20    #
21  # Whichever of the 8-bit and 16-bit libraries exist are tested. It is also  # Whichever of the 8-bit and 16-bit libraries exist are tested. It is also
22  # possible to select which to test by the arguments -8 or -16.  # possible to select which to test by the arguments -8 or -16.
23    #
24  # Other arguments for this script can be individual test numbers, or the word  # Other arguments for this script can be individual test numbers, or the word
25  # "valgrind", or "sim" followed by an argument to run cross-compiled  # "valgrind", or "sim" followed by an argument to run cross-compiled
26  # executables under a simulator, for example:  # executables under a simulator, for example:
27  #  #
28  # RunTest 3 sim "qemu-arm -s 8388608"  # RunTest 3 sim "qemu-arm -s 8388608"
29  #  #
30  # Finally, if the script is obeyed as "RunTest list", a list of available  #
31  # tests is output, but none of them are run.  # There are two special cases where only one argument is allowed:
32    #
33    # If the first and only argument is "ebcdic", the script runs the special
34    # EBCDIC test that can be useful for checking certain EBCDIC features, even
35    # when run in an ASCII environment.
36    #
37    # If the script is obeyed as "RunTest list", a list of available tests is
38    # output, but none of them are run.
39    
40    
41  # Define test titles in variables so that they can be output as a list. Some  # Define test titles in variables so that they can be output as a list. Some
42  # of them are modified (e.g. with -8 or -16) when used in the actual tests.  # of them are modified (e.g. with -8 or -16) when used in the actual tests.
# Line 83  if [ $# -eq 1 -a "$1" = "list" ]; then Line 91  if [ $# -eq 1 -a "$1" = "list" ]; then
91    exit 0    exit 0
92  fi  fi
93    
94    # Set up a suitable "diff" command for comparison. Some systems
95    # have a diff that lacks a -u option. Try to deal with this.
96    
97    cf="diff"
98    diff -u /dev/null /dev/null 2>/dev/null && cf="diff -u"
99    
100    # Find the test data
101    
102    if [ -n "$srcdir" -a -d "$srcdir" ] ; then
103      testdata="$srcdir/testdata"
104    elif [ -d "./testdata" ] ; then
105      testdata=./testdata
106    elif [ -d "../testdata" ] ; then
107      testdata=../testdata
108    else
109      echo "Cannot find the testdata directory"
110      exit 1
111    fi
112    
113    
114    # ------ Special EBCDIC Test -------
115    
116    if [ $# -eq 1 -a "$1" = "ebcdic" ]; then
117      ./pcretest -C ebcdic >/dev/null
118      ebcdic=$?
119      if [ $ebcdic -ne 1 ] ; then
120        echo "Cannot run EBCDIC tests: EBCDIC support not compiled"
121        exit 1
122      fi
123    
124      for opt in "" "-s" "-dfa" "-s -dfa"; do
125        ./pcretest -q $opt $testdata/testinputEBC >testtry
126        if [ $? = 0 ] ; then
127          $cf $testdata/testoutputEBC testtry
128          if [ $? != 0 ] ; then exit 1; fi
129        else exit 1
130        fi
131        if [ "$opt" = "-s" ] ; then echo "  OK with study"
132        elif [ "$opt" = "-dfa" ] ; then echo "  OK using DFA"
133        elif [ "$opt" = "-s -dfa" ] ; then echo "  OK using DFA with study"
134        else echo "  OK"
135        fi
136      done
137    
138    exit 0
139    fi
140    
141    
142    # ------ Normal Tests ------
143    
144  # Default values  # Default values
145    
146  valgrind=  valgrind=
# Line 152  while [ $# -gt 0 ] ; do Line 210  while [ $# -gt 0 ] ; do
210    shift    shift
211  done  done
212    
213  # Set up a suitable "diff" command for comparison. Some systems  # Find which optional facilities are available.
 # have a diff that lacks a -u option. Try to deal with this.  
   
 cf="diff"  
 diff -u /dev/null /dev/null 2>/dev/null && cf="diff -u"  
   
 # Find the test data  
   
 if [ -n "$srcdir" -a -d "$srcdir" ] ; then  
   testdata="$srcdir/testdata"  
 elif [ -d "./testdata" ] ; then  
   testdata=./testdata  
 elif [ -d "../testdata" ] ; then  
   testdata=../testdata  
 else  
   echo "Cannot find the testdata directory"  
   exit 1  
 fi  
   
 # Find which optional facilities are available. In some Windows environments  
 # the output of pcretest -C has CRLF at the end of each line, but the shell  
 # strips only linefeeds from the output of a `backquoted` command. Hence the  
 # alternative patterns.  
214    
215  $sim ./pcretest -C linksize >/dev/null  $sim ./pcretest -C linksize >/dev/null
216  link_size=$?  link_size=$?

Legend:
Removed from v.1016  
changed lines
  Added in v.1033

  ViewVC Help
Powered by ViewVC 1.1.5