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

Diff of /code/trunk/RunTest

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

revision 1282 by ph10, Wed Feb 20 17:42:03 2013 UTC revision 1283 by ph10, Fri Mar 15 10:21:53 2013 UTC
# Line 1  Line 1 
1  #! /bin/sh  #! /bin/sh
2    
3    ###############################################################################
4  # Run the PCRE tests using the pcretest program. The appropriate tests are  # Run the PCRE tests using the pcretest program. The appropriate tests are
5  # selected, depending on which build-time options were used.  # selected, depending on which build-time options were used.
6  #  #
# Line 20  Line 21 
21  # specified), and one when it is not.  # specified), and one when it is not.
22  #  #
23  # Whichever of the 8-, 16- and 32-bit libraries exist are tested. It is also  # Whichever of the 8-, 16- and 32-bit libraries exist are tested. It is also
24  # possible to select which to test by the arguments -8, -16 or -32.  # possible to select which to test by giving "-8", "-16" or "-32" on the
25    # command line.
26  #  #
27  # Other arguments for this script can be individual test numbers, or the word  # As well as "nojit", "-8", "-16", and "-32", arguments for this script are
28  # "valgrind", "valgrind-log" or "sim" followed by an argument to run cross-  # individual test numbers, ranges of tests such as 3-6 or 3- (meaning 3 to the
29  # compiled executables under a simulator, for example:  # end), or a number preceded by ~ to exclude a test. For example, "3-15 ~10"
30    # runs tests 3 to 15, excluding test 10, and just "~10" runs all the tests
31    # except test 10. Whatever order the arguments are in, the tests are always run
32    # in numerical order.
33    
34    # Other arguments can be one of the words "valgrind", "valgrind-log", or "sim"
35    # followed by an argument to run cross- compiled executables under a simulator,
36    # for example:
37  #  #
38  # RunTest 3 sim "qemu-arm -s 8388608"  # RunTest 3 sim "qemu-arm -s 8388608"
39  #  #
 #  
40  # There are two special cases where only one argument is allowed:  # There are two special cases where only one argument is allowed:
41  #  #
42  # If the first and only argument is "ebcdic", the script runs the special  # If the first and only argument is "ebcdic", the script runs the special
# Line 37  Line 45 
45  #  #
46  # If the script is obeyed as "RunTest list", a list of available tests is  # If the script is obeyed as "RunTest list", a list of available tests is
47  # output, but none of them are run.  # output, but none of them are run.
48    ###############################################################################
49    
50  # 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
51  # 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 70  title24="Test 24: Specials for the 16-bi Line 78  title24="Test 24: Specials for the 16-bi
78  title25="Test 25: Specials for the 32-bit library"  title25="Test 25: Specials for the 32-bit library"
79  title26="Test 26: Specials for the 32-bit library with UTF-32 support"  title26="Test 26: Specials for the 32-bit library with UTF-32 support"
80    
81    maxtest=26
82    
83  if [ $# -eq 1 -a "$1" = "list" ]; then  if [ $# -eq 1 -a "$1" = "list" ]; then
84    echo $title1    echo $title1
85    echo $title2 "(not UTF)"    echo $title2 "(not UTF)"
# Line 157  arg16= Line 167  arg16=
167  arg32=  arg32=
168  nojit=  nojit=
169  sim=  sim=
170    skip=
171  valgrind=  valgrind=
172    
173  # This is in case the caller has set aliases (as I do - PH)  # This is in case the caller has set aliases (as I do - PH)
174  unset cp ls mv rm  unset cp ls mv rm
175    
176  # Select which tests to run; for those that are explicitly requested, check  # Process options and select which tests to run; for those that are explicitly
177  # that the necessary optional facilities are available.  # requested, check that the necessary optional facilities are available.
178    
179  do1=no  do1=no
180  do2=no  do2=no
# Line 227  while [ $# -gt 0 ] ; do Line 238  while [ $# -gt 0 ] ; do
238     sim) shift; sim=$1;;     sim) shift; sim=$1;;
239     valgrind) valgrind="valgrind --tool=memcheck -q --smc-check=all";;     valgrind) valgrind="valgrind --tool=memcheck -q --smc-check=all";;
240     valgrind-log) valgrind="valgrind --tool=memcheck --num-callers=30 --leak-check=no --error-limit=no --smc-check=all --log-file=report.%p ";;     valgrind-log) valgrind="valgrind --tool=memcheck --num-callers=30 --leak-check=no --error-limit=no --smc-check=all --log-file=report.%p ";;
241      *) echo "Unknown test number '$1'"; exit 1;;     ~*)
242         if expr "$1" : '~[0-9][0-9]*$' >/dev/null; then
243           skip="$skip `expr "$1" : '~\([0-9]*\)*$'`"
244         else
245           echo "Unknown option or test selector '$1'"; exit 1
246         fi
247       ;;
248       *-*)
249         if expr "$1" : '[0-9][0-9]*-[0-9]*$' >/dev/null; then
250           tf=`expr "$1" : '\([0-9]*\)'`
251           tt=`expr "$1" : '.*-\([0-9]*\)'`
252           if [ "$tt" = "" ] ; then tt=$maxtest; fi
253           if expr \( "$tf" "<" 1 \) \| \( "$tt" ">" "$maxtest" \) >/dev/null; then
254             echo "Invalid test range '$1'"; exit 1
255           fi
256           while expr "$tf" "<=" "$tt" >/dev/null; do
257             eval do${tf}=yes
258             tf=`expr $tf + 1`
259           done
260         else
261           echo "Invalid test range '$1'"; exit 1
262         fi
263       ;;
264       *) echo "Unknown option or test selector '$1'"; exit 1;;
265    esac    esac
266    shift    shift
267  done  done
# Line 316  if [ $jit -ne 0 -a "$nojit" != "yes" ] ; Line 350  if [ $jit -ne 0 -a "$nojit" != "yes" ] ;
350    jitopt=-s+    jitopt=-s+
351  fi  fi
352    
353    # Handle any explicit skips
354    
355    for i in $skip; do eval do$i=no; done
356    
357    # If any unsuitable tests were explicitly requested, grumble.
358    
359  if [ $utf -eq 0 ] ; then  if [ $utf -eq 0 ] ; then
360    if [ $do4 = yes ] ; then    if [ $do4 = yes ] ; then
361      echo "Can't run test 4 because UTF support is not configured"      echo "Can't run test 4 because UTF support is not configured"
# Line 384  else Line 424  else
424  fi  fi
425    
426  # If no specific tests were requested, select all. Those that are not  # If no specific tests were requested, select all. Those that are not
427  # relevant will be skipped.  # relevant will be automatically skipped.
428    
429  if [ $do1  = no -a $do2  = no -a $do3  = no -a $do4  = no -a \  if [ $do1  = no -a $do2  = no -a $do3  = no -a $do4  = no -a \
430       $do5  = no -a $do6  = no -a $do7  = no -a $do8  = no -a \       $do5  = no -a $do6  = no -a $do7  = no -a $do8  = no -a \
# Line 421  if [ $do1  = no -a $do2  = no -a $do3  = Line 461  if [ $do1  = no -a $do2  = no -a $do3  =
461    do26=yes    do26=yes
462  fi  fi
463    
464    # Handle any explicit skips (again, so that an argument list may consist only
465    # of explicit skips).
466    
467    for i in $skip; do eval do$i=no; done
468    
469  # Show which release and which test data  # Show which release and which test data
470    
471  echo ""  echo ""

Legend:
Removed from v.1282  
changed lines
  Added in v.1283

  ViewVC Help
Powered by ViewVC 1.1.5