[Pcre-svn] [1283] code/trunk: Update RunTest to add more tes…

Startseite
Nachricht löschen
Autor: Subversion repository
Datum:  
To: pcre-svn
Betreff: [Pcre-svn] [1283] code/trunk: Update RunTest to add more test selector options.
Revision: 1283
          http://vcs.pcre.org/viewvc?view=rev&revision=1283
Author:   ph10
Date:     2013-03-15 10:21:53 +0000 (Fri, 15 Mar 2013)


Log Message:
-----------
Update RunTest to add more test selector options.

Modified Paths:
--------------
    code/trunk/ChangeLog
    code/trunk/RunTest


Modified: code/trunk/ChangeLog
===================================================================
--- code/trunk/ChangeLog    2013-03-15 08:01:41 UTC (rev 1282)
+++ code/trunk/ChangeLog    2013-03-15 10:21:53 UTC (rev 1283)
@@ -108,7 +108,9 @@


29. Experimental support of (*THEN) backtracking verb in the JIT compiler.

+30. Update RunTest with additional test selector options.

+
Version 8.32 30-November-2012
-----------------------------


Modified: code/trunk/RunTest
===================================================================
--- code/trunk/RunTest    2013-03-15 08:01:41 UTC (rev 1282)
+++ code/trunk/RunTest    2013-03-15 10:21:53 UTC (rev 1283)
@@ -1,5 +1,6 @@
 #! /bin/sh


+###############################################################################
# Run the PCRE tests using the pcretest program. The appropriate tests are
# selected, depending on which build-time options were used.
#
@@ -20,15 +21,22 @@
# specified), and one when it is not.
#
# Whichever of the 8-, 16- and 32-bit libraries exist are tested. It is also
-# 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
+# command line.
#
-# Other arguments for this script can be individual test numbers, or the word
-# "valgrind", "valgrind-log" or "sim" followed by an argument to run cross-
-# compiled executables under a simulator, for example:
+# As well as "nojit", "-8", "-16", and "-32", arguments for this script are
+# individual test numbers, ranges of tests such as 3-6 or 3- (meaning 3 to the
+# end), or a number preceded by ~ to exclude a test. For example, "3-15 ~10"
+# runs tests 3 to 15, excluding test 10, and just "~10" runs all the tests
+# except test 10. Whatever order the arguments are in, the tests are always run
+# in numerical order.
+
+# Other arguments can be one of the words "valgrind", "valgrind-log", or "sim"
+# followed by an argument to run cross- compiled executables under a simulator,
+# for example:
#
# RunTest 3 sim "qemu-arm -s 8388608"
#
-#
# There are two special cases where only one argument is allowed:
#
# If the first and only argument is "ebcdic", the script runs the special
@@ -37,8 +45,8 @@
#
# If the script is obeyed as "RunTest list", a list of available tests is
# output, but none of them are run.
+###############################################################################

-
# Define test titles in variables so that they can be output as a list. Some
# of them are modified (e.g. with -8 or -16) when used in the actual tests.

@@ -70,6 +78,8 @@
title25="Test 25: Specials for the 32-bit library"
title26="Test 26: Specials for the 32-bit library with UTF-32 support"

+maxtest=26
+
if [ $# -eq 1 -a "$1" = "list" ]; then
echo $title1
echo $title2 "(not UTF)"
@@ -157,13 +167,14 @@
arg32=
nojit=
sim=
+skip=
valgrind=

# This is in case the caller has set aliases (as I do - PH)
unset cp ls mv rm

-# Select which tests to run; for those that are explicitly requested, check
-# that the necessary optional facilities are available.
+# Process options and select which tests to run; for those that are explicitly
+# requested, check that the necessary optional facilities are available.

 do1=no
 do2=no
@@ -227,7 +238,30 @@
    sim) shift; sim=$1;;
    valgrind) valgrind="valgrind --tool=memcheck -q --smc-check=all";;
    valgrind-log) valgrind="valgrind --tool=memcheck --num-callers=30 --leak-check=no --error-limit=no --smc-check=all --log-file=report.%p ";;
-    *) echo "Unknown test number '$1'"; exit 1;;
+   ~*)
+     if expr "$1" : '~[0-9][0-9]*$' >/dev/null; then
+       skip="$skip `expr "$1" : '~\([0-9]*\)*$'`"
+     else
+       echo "Unknown option or test selector '$1'"; exit 1
+     fi      
+   ;; 
+   *-*)
+     if expr "$1" : '[0-9][0-9]*-[0-9]*$' >/dev/null; then
+       tf=`expr "$1" : '\([0-9]*\)'` 
+       tt=`expr "$1" : '.*-\([0-9]*\)'`
+       if [ "$tt" = "" ] ; then tt=$maxtest; fi 
+       if expr \( "$tf" "<" 1 \) \| \( "$tt" ">" "$maxtest" \) >/dev/null; then
+         echo "Invalid test range '$1'"; exit 1
+       fi       
+       while expr "$tf" "<=" "$tt" >/dev/null; do
+         eval do${tf}=yes
+         tf=`expr $tf + 1`  
+       done
+     else
+       echo "Invalid test range '$1'"; exit 1
+     fi        
+   ;;
+   *) echo "Unknown option or test selector '$1'"; exit 1;;
   esac
   shift
 done
@@ -316,6 +350,12 @@
   jitopt=-s+
 fi


+# Handle any explicit skips
+
+for i in $skip; do eval do$i=no; done
+
+# If any unsuitable tests were explicitly requested, grumble.
+
 if [ $utf -eq 0 ] ; then
   if [ $do4 = yes ] ; then
     echo "Can't run test 4 because UTF support is not configured"
@@ -384,7 +424,7 @@
 fi


# If no specific tests were requested, select all. Those that are not
-# relevant will be skipped.
+# relevant will be automatically skipped.

 if [ $do1  = no -a $do2  = no -a $do3  = no -a $do4  = no -a \
      $do5  = no -a $do6  = no -a $do7  = no -a $do8  = no -a \
@@ -421,6 +461,11 @@
   do26=yes
 fi


+# Handle any explicit skips (again, so that an argument list may consist only
+# of explicit skips).
+
+for i in $skip; do eval do$i=no; done
+
# Show which release and which test data

echo ""