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

Diff of /code/trunk/RunTest

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

revision 912 by ph10, Sun Feb 12 16:53:39 2012 UTC revision 1016 by ph10, Sun Aug 26 16:17:55 2012 UTC
# Line 26  Line 26 
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.
32    
33    # Define test titles in variables so that they can be output as a list. Some
34    # of them are modified (e.g. with -8 or -16) when used in the actual tests.
35    
36    title1="Test 1: Main functionality (Compatible with Perl >= 5.10)"
37    title2="Test 2: API, errors, internals, and non-Perl stuff"
38    title3="Test 3: Locale-specific features"
39    title4A="Test 4: UTF"
40    title4B=" support (Compatible with Perl >= 5.10)"
41    title5="Test 5: API, internals, and non-Perl stuff for UTF"
42    title6="Test 6: Unicode property support (Compatible with Perl >= 5.10)"
43    title7="Test 7: API, internals, and non-Perl stuff for Unicode property support"
44    title8="Test 8: DFA matching main functionality"
45    title9="Test 9: DFA matching with UTF"
46    title10="Test 10: DFA matching with Unicode properties"
47    title11="Test 11: Internal offsets and code size tests"
48    title12="Test 12: JIT-specific features (JIT available)"
49    title13="Test 13: JIT-specific features (JIT not available)"
50    title14="Test 14: Specials for the basic 8-bit library"
51    title15="Test 15: Specials for the 8-bit library with UTF-8 support"
52    title16="Test 16: Specials for the 8-bit library with Unicode propery support"
53    title17="Test 17: Specials for the basic 16-bit library"
54    title18="Test 18: Specials for the 16-bit library with UTF-16 support"
55    title19="Test 19: Specials for the 16-bit library with Unicode propery support"
56    title20="Test 20: DFA specials for the basic 16-bit library"
57    title21="Test 21: Reloads for the basic 16-bit library"
58    title22="Test 22: Reloads for the 16-bit library with UTF-16 support"
59    
60    if [ $# -eq 1 -a "$1" = "list" ]; then
61      echo $title1
62      echo $title2 "(not UTF)"
63      echo $title3
64      echo $title4A $title4B
65      echo $title5 support
66      echo $title6
67      echo $title7
68      echo $title8
69      echo $title9
70      echo $title10
71      echo $title11
72      echo $title12
73      echo $title13
74      echo $title14
75      echo $title15
76      echo $title16
77      echo $title17
78      echo $title18
79      echo $title19
80      echo $title20
81      echo $title21
82      echo $title22
83      exit 0
84    fi
85    
86    # Default values
87    
88  valgrind=  valgrind=
89  sim=  sim=
# Line 89  while [ $# -gt 0 ] ; do Line 147  while [ $# -gt 0 ] ; do
147    -16) arg16=yes;;    -16) arg16=yes;;
148     valgrind) valgrind="valgrind -q --smc-check=all";;     valgrind) valgrind="valgrind -q --smc-check=all";;
149     sim) shift; sim=$1;;     sim) shift; sim=$1;;
150      *) echo "Unknown test number $1"; exit 1;;      *) echo "Unknown test number '$1'"; exit 1;;
151    esac    esac
152    shift    shift
153  done  done
# Line 97  done Line 155  done
155  # Set up a suitable "diff" command for comparison. Some systems  # Set up a suitable "diff" command for comparison. Some systems
156  # have a diff that lacks a -u option. Try to deal with this.  # have a diff that lacks a -u option. Try to deal with this.
157    
158  if diff -u /dev/null /dev/null; then cf="diff -u"; else cf="diff"; fi  cf="diff"
159    diff -u /dev/null /dev/null 2>/dev/null && cf="diff -u"
160    
161  # Find the test data  # Find the test data
162    
# Line 295  for bmode in "$test8" "$test16"; do Line 354  for bmode in "$test8" "$test16"; do
354  # Primary test, compatible with JIT and all versions of Perl >= 5.8  # Primary test, compatible with JIT and all versions of Perl >= 5.8
355    
356  if [ $do1 = yes ] ; then  if [ $do1 = yes ] ; then
357    echo "Test 1: main functionality (Compatible with Perl >= 5.10)"    echo $title1
358    for opt in "" "-s" $jitopt; do    for opt in "" "-s" $jitopt; do
359      $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput1 testtry      $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput1 testtry
360      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
# Line 313  fi Line 372  fi
372  # PCRE tests that are not JIT or Perl-compatible: API, errors, internals  # PCRE tests that are not JIT or Perl-compatible: API, errors, internals
373    
374  if [ $do2 = yes ] ; then  if [ $do2 = yes ] ; then
375    echo "Test 2: API, errors, internals, and non-Perl stuff (not UTF-$bits)"    echo $title2 "(not UTF-$bits)"
376    for opt in "" "-s" $jitopt; do    for opt in "" "-s" $jitopt; do
377      $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput2 testtry      $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput2 testtry
378      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
# Line 367  if [ $do3 = yes ] ; then Line 426  if [ $do3 = yes ] ; then
426    fi    fi
427    
428    if [ "$locale" != "" ] ; then    if [ "$locale" != "" ] ; then
429      echo "Test 3: locale-specific features (using '$locale' locale)"      echo $title3 "(using '$locale' locale)"
430      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
431        $sim $valgrind ./pcretest -q $bmode $opt $infile testtry        $sim $valgrind ./pcretest -q $bmode $opt $infile testtry
432        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
# Line 398  fi Line 457  fi
457  # Additional tests for UTF support  # Additional tests for UTF support
458    
459  if [ $do4 = yes ] ; then  if [ $do4 = yes ] ; then
460    echo "Test 4: UTF-$bits support (Compatible with Perl >= 5.10)"    echo ${title4A}-${bits}${title4B}
461    if [ $utf -eq 0 ] ; then    if [ $utf -eq 0 ] ; then
462      echo "  Skipped because UTF-$bits support is not available"      echo "  Skipped because UTF-$bits support is not available"
463    else    else
# Line 418  if [ $do4 = yes ] ; then Line 477  if [ $do4 = yes ] ; then
477  fi  fi
478    
479  if [ $do5 = yes ] ; then  if [ $do5 = yes ] ; then
480    echo "Test 5: API, internals, and non-Perl stuff for UTF-$bits support"    echo ${title5}-${bits} support
481    if [ $utf -eq 0 ] ; then    if [ $utf -eq 0 ] ; then
482      echo "  Skipped because UTF-$bits support is not available"      echo "  Skipped because UTF-$bits support is not available"
483    else    else
# Line 438  if [ $do5 = yes ] ; then Line 497  if [ $do5 = yes ] ; then
497  fi  fi
498    
499  if [ $do6 = yes ] ; then  if [ $do6 = yes ] ; then
500    echo "Test 6: Unicode property support (Compatible with Perl >= 5.10)"    echo $title6
501    if [ $utf -eq 0 -o $ucp -eq 0 ] ; then    if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
502      echo "  Skipped because Unicode property support is not available"      echo "  Skipped because Unicode property support is not available"
503    else    else
# Line 460  fi Line 519  fi
519  # Test non-Perl-compatible Unicode property support  # Test non-Perl-compatible Unicode property support
520    
521  if [ $do7 = yes ] ; then  if [ $do7 = yes ] ; then
522    echo "Test 7: API, internals, and non-Perl stuff for Unicode property support"    echo $title7
523    if [ $utf -eq 0 -o $ucp -eq 0 ] ; then    if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
524      echo "  Skipped because Unicode property support is not available"      echo "  Skipped because Unicode property support is not available"
525    else    else
# Line 482  fi Line 541  fi
541  # Tests for DFA matching support  # Tests for DFA matching support
542    
543  if [ $do8 = yes ] ; then  if [ $do8 = yes ] ; then
544    echo "Test 8: DFA matching main functionality"    echo $title8
545    for opt in "" "-s"; do    for opt in "" "-s"; do
546      $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput8 testtry      $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput8 testtry
547      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
# Line 495  if [ $do8 = yes ] ; then Line 554  if [ $do8 = yes ] ; then
554  fi  fi
555    
556  if [ $do9 = yes ] ; then  if [ $do9 = yes ] ; then
557    echo "Test 9: DFA matching with UTF-$bits"    echo ${title9}-${bits}
558    if [ $utf -eq 0 ] ; then    if [ $utf -eq 0 ] ; then
559      echo "  Skipped because UTF-$bits support is not available"      echo "  Skipped because UTF-$bits support is not available"
560    else    else
# Line 512  if [ $do9 = yes ] ; then Line 571  if [ $do9 = yes ] ; then
571  fi  fi
572    
573  if [ $do10 = yes ] ; then  if [ $do10 = yes ] ; then
574    echo "Test 10: DFA matching with Unicode properties"    echo $title10
575    if [ $utf -eq 0 -o $ucp -eq 0 ] ; then    if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
576      echo "  Skipped because Unicode property support is not available"      echo "  Skipped because Unicode property support is not available"
577    else    else
# Line 536  fi Line 595  fi
595  # this test is not the same in 8-bit and 16-bit modes.  # this test is not the same in 8-bit and 16-bit modes.
596    
597  if [ $do11 = yes ] ; then  if [ $do11 = yes ] ; then
598    echo "Test 11: Internal offsets and code size tests"    echo $title11
599    if [ $link_size -ne 2 ] ; then    if [ $link_size -ne 2 ] ; then
600      echo "  Skipped because link size is not 2"      echo "  Skipped because link size is not 2"
601    elif [ $ucp -eq 0 ] ; then    elif [ $ucp -eq 0 ] ; then
# Line 557  fi Line 616  fi
616  # Test JIT-specific features when JIT is available  # Test JIT-specific features when JIT is available
617    
618  if [ $do12 = yes ] ; then  if [ $do12 = yes ] ; then
619    echo "Test 12: JIT-specific features (JIT available)"    echo $title12
620    if [ $jit -eq 0 ] ; then    if [ $jit -eq 0 ] ; then
621      echo "  Skipped because JIT is not available or not usable"      echo "  Skipped because JIT is not available or not usable"
622    else    else
# Line 574  fi Line 633  fi
633  # Test JIT-specific features when JIT is not available  # Test JIT-specific features when JIT is not available
634    
635  if [ $do13 = yes ] ; then  if [ $do13 = yes ] ; then
636    echo "Test 13: JIT-specific features (JIT not available)"    echo $title13
637    if [ $jit -ne 0 ] ; then    if [ $jit -ne 0 ] ; then
638      echo "  Skipped because JIT is available"      echo "  Skipped because JIT is available"
639    else    else
# Line 591  fi Line 650  fi
650  # Tests for 8-bit-specific features  # Tests for 8-bit-specific features
651    
652  if [ "$do14" = yes ] ; then  if [ "$do14" = yes ] ; then
653    echo "Test 14: specials for the basic 8-bit library"    echo $title14
654    if [ "$bits" = "16" ] ; then    if [ "$bits" = "16" ] ; then
655      echo "  Skipped when running 16-bit tests"      echo "  Skipped when running 16-bit tests"
656    else    else
# Line 614  fi Line 673  fi
673  # Tests for 8-bit-specific features (needs UTF-8 support)  # Tests for 8-bit-specific features (needs UTF-8 support)
674    
675  if [ "$do15" = yes ] ; then  if [ "$do15" = yes ] ; then
676    echo "Test 15: specials for the 8-bit library with UTF-8 support"    echo $title15
677    if [ "$bits" = "16" ] ; then    if [ "$bits" = "16" ] ; then
678      echo "  Skipped when running 16-bit tests"      echo "  Skipped when running 16-bit tests"
679    elif [ $utf -eq 0 ] ; then    elif [ $utf -eq 0 ] ; then
# Line 638  fi Line 697  fi
697  # Tests for 8-bit-specific features (Unicode property support)  # Tests for 8-bit-specific features (Unicode property support)
698    
699  if [ $do16 = yes ] ; then  if [ $do16 = yes ] ; then
700    echo "Test 16: specials for the 8-bit library with Unicode propery support"    echo $title16
701    if [ "$bits" = "16" ] ; then    if [ "$bits" = "16" ] ; then
702      echo "  Skipped when running 16-bit tests"      echo "  Skipped when running 16-bit tests"
703    elif [ $ucp -eq 0 ] ; then    elif [ $ucp -eq 0 ] ; then
# Line 662  fi Line 721  fi
721  # Tests for 16-bit-specific features  # Tests for 16-bit-specific features
722    
723  if [ $do17 = yes ] ; then  if [ $do17 = yes ] ; then
724    echo "Test 17: specials for the basic 16-bit library"    echo $title17
725    if [ "$bits" = "8" ] ; then    if [ "$bits" = "8" ] ; then
726      echo "  Skipped when running 8-bit tests"      echo "  Skipped when running 8-bit tests"
727    else    else
# Line 684  fi Line 743  fi
743  # Tests for 16-bit-specific features (UTF-16 support)  # Tests for 16-bit-specific features (UTF-16 support)
744    
745  if [ $do18 = yes ] ; then  if [ $do18 = yes ] ; then
746    echo "Test 18: specials for the 16-bit library with UTF-16 support"    echo $title18
747    if [ "$bits" = "8" ] ; then    if [ "$bits" = "8" ] ; then
748      echo "  Skipped when running 8-bit tests"      echo "  Skipped when running 8-bit tests"
749    elif [ $utf -eq 0 ] ; then    elif [ $utf -eq 0 ] ; then
# Line 708  fi Line 767  fi
767  # Tests for 16-bit-specific features (Unicode property support)  # Tests for 16-bit-specific features (Unicode property support)
768    
769  if [ $do19 = yes ] ; then  if [ $do19 = yes ] ; then
770    echo "Test 19: specials for the 16-bit library with Unicode propery support"    echo $title19
771    if [ "$bits" = "8" ] ; then    if [ "$bits" = "8" ] ; then
772      echo "  Skipped when running 8-bit tests"      echo "  Skipped when running 8-bit tests"
773    elif [ $ucp -eq 0 ] ; then    elif [ $ucp -eq 0 ] ; then
# Line 732  fi Line 791  fi
791  # Tests for 16-bit-specific features in DFA non-UTF-16 mode  # Tests for 16-bit-specific features in DFA non-UTF-16 mode
792    
793  if [ $do20 = yes ] ; then  if [ $do20 = yes ] ; then
794    echo "Test 20: DFA specials for the basic 16-bit library"    echo $title20
795    if [ "$bits" = "8" ] ; then    if [ "$bits" = "8" ] ; then
796      echo "  Skipped when running 8-bit tests"      echo "  Skipped when running 8-bit tests"
797    else    else
# Line 753  fi Line 812  fi
812  # Tests for reloads with 16-bit library  # Tests for reloads with 16-bit library
813    
814  if [ $do21 = yes ] ; then  if [ $do21 = yes ] ; then
815    echo "Test 21: reloads for the basic 16-bit library"    echo $title21
816    if [ "$bits" = "8" ] ; then    if [ "$bits" = "8" ] ; then
817      echo "  Skipped when running 8-bit tests"      echo "  Skipped when running 8-bit tests"
818    elif [ $link_size -ne 2 ] ; then    elif [ $link_size -ne 2 ] ; then
# Line 775  fi Line 834  fi
834  # Tests for reloads with 16-bit library (UTF-16 support)  # Tests for reloads with 16-bit library (UTF-16 support)
835    
836  if [ $do22 = yes ] ; then  if [ $do22 = yes ] ; then
837    echo "Test 22: reloads for the 16-bit library with UTF-16 support"    echo $title22
838    if [ "$bits" = "8" ] ; then    if [ "$bits" = "8" ] ; then
839      echo "  Skipped when running 8-bit tests"      echo "  Skipped when running 8-bit tests"
840    elif [ $utf -eq 0 ] ; then    elif [ $utf -eq 0 ] ; then

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

  ViewVC Help
Powered by ViewVC 1.1.5