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

Diff of /code/trunk/RunTest

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

revision 903 by ph10, Sat Jan 21 16:37:17 2012 UTC revision 931 by ph10, Fri Feb 24 13:21:02 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 135  $sim ./pcretest -C pcre8 >/dev/null Line 193  $sim ./pcretest -C pcre8 >/dev/null
193  support8=$?  support8=$?
194  $sim ./pcretest -C pcre16 >/dev/null  $sim ./pcretest -C pcre16 >/dev/null
195  support16=$?  support16=$?
196  if [ $(( $support8 + $support16 )) -eq 2 ] ; then  if [ `expr $support8 + $support16` -eq 2 ] ; then
197    test8=    test8=
198    test16=-16    test16=-16
199    if [ "$arg8" = yes -a "$arg16" != yes ] ; then    if [ "$arg8" = yes -a "$arg16" != yes ] ; then
# Line 295  for bmode in "$test8" "$test16"; do Line 353  for bmode in "$test8" "$test16"; do
353  # Primary test, compatible with JIT and all versions of Perl >= 5.8  # Primary test, compatible with JIT and all versions of Perl >= 5.8
354    
355  if [ $do1 = yes ] ; then  if [ $do1 = yes ] ; then
356    echo "Test 1: main functionality (Compatible with Perl >= 5.10)"    echo $title1
357    for opt in "" "-s" $jitopt; do    for opt in "" "-s" $jitopt; do
358      $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput1 testtry      $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput1 testtry
359      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
# Line 313  fi Line 371  fi
371  # PCRE tests that are not JIT or Perl-compatible: API, errors, internals  # PCRE tests that are not JIT or Perl-compatible: API, errors, internals
372    
373  if [ $do2 = yes ] ; then  if [ $do2 = yes ] ; then
374    echo "Test 2: API, errors, internals, and non-Perl stuff (not UTF-$bits)"    echo $title2 "(not UTF-$bits)"
375    for opt in "" "-s" $jitopt; do    for opt in "" "-s" $jitopt; do
376      $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput2 testtry      $sim $valgrind ./pcretest -q $bmode $opt $testdata/testinput2 testtry
377      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
# Line 367  if [ $do3 = yes ] ; then Line 425  if [ $do3 = yes ] ; then
425    fi    fi
426    
427    if [ "$locale" != "" ] ; then    if [ "$locale" != "" ] ; then
428      echo "Test 3: locale-specific features (using '$locale' locale)"      echo $title3 "(using '$locale' locale)"
429      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
430        $sim $valgrind ./pcretest -q $bmode $opt $infile testtry        $sim $valgrind ./pcretest -q $bmode $opt $infile testtry
431        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
# Line 398  fi Line 456  fi
456  # Additional tests for UTF support  # Additional tests for UTF support
457    
458  if [ $do4 = yes ] ; then  if [ $do4 = yes ] ; then
459    echo "Test 4: UTF-$bits support (Compatible with Perl >= 5.10)"    echo ${title4A}-${bits}${title4B}
460    if [ $utf -eq 0 ] ; then    if [ $utf -eq 0 ] ; then
461      echo "  Skipped because UTF-$bits support is not available"      echo "  Skipped because UTF-$bits support is not available"
462    else    else
# Line 418  if [ $do4 = yes ] ; then Line 476  if [ $do4 = yes ] ; then
476  fi  fi
477    
478  if [ $do5 = yes ] ; then  if [ $do5 = yes ] ; then
479    echo "Test 5: API, internals, and non-Perl stuff for UTF-$bits support"    echo ${title5}-${bits} support
480    if [ $utf -eq 0 ] ; then    if [ $utf -eq 0 ] ; then
481      echo "  Skipped because UTF-$bits support is not available"      echo "  Skipped because UTF-$bits support is not available"
482    else    else
# Line 438  if [ $do5 = yes ] ; then Line 496  if [ $do5 = yes ] ; then
496  fi  fi
497    
498  if [ $do6 = yes ] ; then  if [ $do6 = yes ] ; then
499    echo "Test 6: Unicode property support (Compatible with Perl >= 5.10)"    echo $title6
500    if [ $utf -eq 0 -o $ucp -eq 0 ] ; then    if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
501      echo "  Skipped because Unicode property support is not available"      echo "  Skipped because Unicode property support is not available"
502    else    else
# Line 460  fi Line 518  fi
518  # Test non-Perl-compatible Unicode property support  # Test non-Perl-compatible Unicode property support
519    
520  if [ $do7 = yes ] ; then  if [ $do7 = yes ] ; then
521    echo "Test 7: API, internals, and non-Perl stuff for Unicode property support"    echo $title7
522    if [ $utf -eq 0 -o $ucp -eq 0 ] ; then    if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
523      echo "  Skipped because Unicode property support is not available"      echo "  Skipped because Unicode property support is not available"
524    else    else
# Line 482  fi Line 540  fi
540  # Tests for DFA matching support  # Tests for DFA matching support
541    
542  if [ $do8 = yes ] ; then  if [ $do8 = yes ] ; then
543    echo "Test 8: DFA matching main functionality"    echo $title8
544    for opt in "" "-s"; do    for opt in "" "-s"; do
545      $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput8 testtry      $sim $valgrind ./pcretest -q $bmode $opt -dfa $testdata/testinput8 testtry
546      if [ $? = 0 ] ; then      if [ $? = 0 ] ; then
# Line 495  if [ $do8 = yes ] ; then Line 553  if [ $do8 = yes ] ; then
553  fi  fi
554    
555  if [ $do9 = yes ] ; then  if [ $do9 = yes ] ; then
556    echo "Test 9: DFA matching with UTF-$bits"    echo ${title9}-${bits}
557    if [ $utf -eq 0 ] ; then    if [ $utf -eq 0 ] ; then
558      echo "  Skipped because UTF-$bits support is not available"      echo "  Skipped because UTF-$bits support is not available"
559    else    else
# Line 512  if [ $do9 = yes ] ; then Line 570  if [ $do9 = yes ] ; then
570  fi  fi
571    
572  if [ $do10 = yes ] ; then  if [ $do10 = yes ] ; then
573    echo "Test 10: DFA matching with Unicode properties"    echo $title10
574    if [ $utf -eq 0 -o $ucp -eq 0 ] ; then    if [ $utf -eq 0 -o $ucp -eq 0 ] ; then
575      echo "  Skipped because Unicode property support is not available"      echo "  Skipped because Unicode property support is not available"
576    else    else
# Line 536  fi Line 594  fi
594  # 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.
595    
596  if [ $do11 = yes ] ; then  if [ $do11 = yes ] ; then
597    echo "Test 11: Internal offsets and code size tests"    echo $title11
598    if [ $link_size -ne 2 ] ; then    if [ $link_size -ne 2 ] ; then
599      echo "  Skipped because link size is not 2"      echo "  Skipped because link size is not 2"
600    elif [ $ucp -eq 0 ] ; then    elif [ $ucp -eq 0 ] ; then
# Line 557  fi Line 615  fi
615  # Test JIT-specific features when JIT is available  # Test JIT-specific features when JIT is available
616    
617  if [ $do12 = yes ] ; then  if [ $do12 = yes ] ; then
618    echo "Test 12: JIT-specific features (JIT available)"    echo $title12
619    if [ $jit -eq 0 ] ; then    if [ $jit -eq 0 ] ; then
620      echo "  Skipped because JIT is not available or not usable"      echo "  Skipped because JIT is not available or not usable"
621    else    else
# Line 574  fi Line 632  fi
632  # Test JIT-specific features when JIT is not available  # Test JIT-specific features when JIT is not available
633    
634  if [ $do13 = yes ] ; then  if [ $do13 = yes ] ; then
635    echo "Test 13: JIT-specific features (JIT not available)"    echo $title13
636    if [ $jit -ne 0 ] ; then    if [ $jit -ne 0 ] ; then
637      echo "  Skipped because JIT is available"      echo "  Skipped because JIT is available"
638    else    else
# Line 591  fi Line 649  fi
649  # Tests for 8-bit-specific features  # Tests for 8-bit-specific features
650    
651  if [ "$do14" = yes ] ; then  if [ "$do14" = yes ] ; then
652    echo "Test 14: specials for the basic 8-bit library"    echo $title14
653    if [ "$bits" = "16" ] ; then    if [ "$bits" = "16" ] ; then
654      echo "  Skipped when running 16-bit tests"      echo "  Skipped when running 16-bit tests"
655    else    else
# Line 614  fi Line 672  fi
672  # Tests for 8-bit-specific features (needs UTF-8 support)  # Tests for 8-bit-specific features (needs UTF-8 support)
673    
674  if [ "$do15" = yes ] ; then  if [ "$do15" = yes ] ; then
675    echo "Test 15: specials for the 8-bit library with UTF-8 support"    echo $title15
676    if [ "$bits" = "16" ] ; then    if [ "$bits" = "16" ] ; then
677      echo "  Skipped when running 16-bit tests"      echo "  Skipped when running 16-bit tests"
678    elif [ $utf -eq 0 ] ; then    elif [ $utf -eq 0 ] ; then
# Line 638  fi Line 696  fi
696  # Tests for 8-bit-specific features (Unicode property support)  # Tests for 8-bit-specific features (Unicode property support)
697    
698  if [ $do16 = yes ] ; then  if [ $do16 = yes ] ; then
699    echo "Test 16: specials for the 8-bit library with Unicode propery support"    echo $title16
700    if [ "$bits" = "16" ] ; then    if [ "$bits" = "16" ] ; then
701      echo "  Skipped when running 16-bit tests"      echo "  Skipped when running 16-bit tests"
702    elif [ $ucp -eq 0 ] ; then    elif [ $ucp -eq 0 ] ; then
# Line 662  fi Line 720  fi
720  # Tests for 16-bit-specific features  # Tests for 16-bit-specific features
721    
722  if [ $do17 = yes ] ; then  if [ $do17 = yes ] ; then
723    echo "Test 17: specials for the basic 16-bit library"    echo $title17
724    if [ "$bits" = "8" ] ; then    if [ "$bits" = "8" ] ; then
725      echo "  Skipped when running 8-bit tests"      echo "  Skipped when running 8-bit tests"
726    else    else
# Line 684  fi Line 742  fi
742  # Tests for 16-bit-specific features (UTF-16 support)  # Tests for 16-bit-specific features (UTF-16 support)
743    
744  if [ $do18 = yes ] ; then  if [ $do18 = yes ] ; then
745    echo "Test 18: specials for the 16-bit library with UTF-16 support"    echo $title18
746    if [ "$bits" = "8" ] ; then    if [ "$bits" = "8" ] ; then
747      echo "  Skipped when running 8-bit tests"      echo "  Skipped when running 8-bit tests"
748    elif [ $utf -eq 0 ] ; then    elif [ $utf -eq 0 ] ; then
# Line 708  fi Line 766  fi
766  # Tests for 16-bit-specific features (Unicode property support)  # Tests for 16-bit-specific features (Unicode property support)
767    
768  if [ $do19 = yes ] ; then  if [ $do19 = yes ] ; then
769    echo "Test 19: specials for the 16-bit library with Unicode propery support"    echo $title19
770    if [ "$bits" = "8" ] ; then    if [ "$bits" = "8" ] ; then
771      echo "  Skipped when running 8-bit tests"      echo "  Skipped when running 8-bit tests"
772    elif [ $ucp -eq 0 ] ; then    elif [ $ucp -eq 0 ] ; then
# Line 732  fi Line 790  fi
790  # Tests for 16-bit-specific features in DFA non-UTF-16 mode  # Tests for 16-bit-specific features in DFA non-UTF-16 mode
791    
792  if [ $do20 = yes ] ; then  if [ $do20 = yes ] ; then
793    echo "Test 20: DFA specials for the basic 16-bit library"    echo $title20
794    if [ "$bits" = "8" ] ; then    if [ "$bits" = "8" ] ; then
795      echo "  Skipped when running 8-bit tests"      echo "  Skipped when running 8-bit tests"
796    else    else
# Line 753  fi Line 811  fi
811  # Tests for reloads with 16-bit library  # Tests for reloads with 16-bit library
812    
813  if [ $do21 = yes ] ; then  if [ $do21 = yes ] ; then
814    echo "Test 21: reloads for the basic 16-bit library"    echo $title21
815    if [ "$bits" = "8" ] ; then    if [ "$bits" = "8" ] ; then
816      echo "  Skipped when running 8-bit tests"      echo "  Skipped when running 8-bit tests"
817    elif [ $link_size -ne 2 ] ; then    elif [ $link_size -ne 2 ] ; then
# Line 775  fi Line 833  fi
833  # Tests for reloads with 16-bit library (UTF-16 support)  # Tests for reloads with 16-bit library (UTF-16 support)
834    
835  if [ $do22 = yes ] ; then  if [ $do22 = yes ] ; then
836    echo "Test 22: reloads for the 16-bit library with UTF-16 support"    echo $title22
837    if [ "$bits" = "8" ] ; then    if [ "$bits" = "8" ] ; then
838      echo "  Skipped when running 8-bit tests"      echo "  Skipped when running 8-bit tests"
839    elif [ $utf -eq 0 ] ; then    elif [ $utf -eq 0 ] ; then

Legend:
Removed from v.903  
changed lines
  Added in v.931

  ViewVC Help
Powered by ViewVC 1.1.5