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

Diff of /code/trunk/RunTest

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

revision 1370 by ph10, Wed Oct 9 10:18:26 2013 UTC revision 1443 by ph10, Sun Jan 12 19:20:27 2014 UTC
# Line 31  Line 31 
31  # except test 10. Whatever order the arguments are in, the tests are always run  # except test 10. Whatever order the arguments are in, the tests are always run
32  # in numerical order.  # in numerical order.
33  #  #
34    # The special argument "3S" runs test 3, stopping if it fails. Test 3 is the
35    # locale test, and failure usually means there's an issue with the locale
36    # rather than a bug in PCRE, so normally subsequent tests are run. "3S" is
37    # useful when you want to debug or update the test.
38    #
39  # Inappropriate tests are automatically skipped (with a comment to say so): for  # Inappropriate tests are automatically skipped (with a comment to say so): for
40  # example, if JIT support is not compiled, test 12 is skipped, whereas if JIT  # example, if JIT support is not compiled, test 12 is skipped, whereas if JIT
41  # support is compiled, test 13 is skipped.  # support is compiled, test 13 is skipped.
# Line 458  fi Line 463  fi
463    
464  # Locale-specific tests, provided that either the "fr_FR" or the "french"  # Locale-specific tests, provided that either the "fr_FR" or the "french"
465  # locale is available. The former is the Unix-like standard; the latter is  # locale is available. The former is the Unix-like standard; the latter is
466  # for Windows. Another possibility is "fr", which needs to be run against  # for Windows. Another possibility is "fr". Unfortunately, different versions
467  # the Windows-specific input and output files.  # of the French locale give different outputs for some items. This test passes
468    # if the output matches any one of the alternative output files.
469    
470  if [ $do3 = yes ] ; then  if [ $do3 = yes ] ; then
471    locale -a | grep '^fr_FR$' >/dev/null    locale -a | grep '^fr_FR$' >/dev/null
# Line 467  if [ $do3 = yes ] ; then Line 473  if [ $do3 = yes ] ; then
473      locale=fr_FR      locale=fr_FR
474      infile=$testdata/testinput3      infile=$testdata/testinput3
475      outfile=$testdata/testoutput3      outfile=$testdata/testoutput3
476        outfile2=$testdata/testoutput3A
477        outfile3=$testdata/testoutput3B
478    else    else
479      infile=test3input      infile=test3input
480      outfile=test3output      outfile=test3output
481        outfile2=test3outputA
482        outfile3=test3outputB
483      locale -a | grep '^french$' >/dev/null      locale -a | grep '^french$' >/dev/null
484      if [ $? -eq 0 ] ; then      if [ $? -eq 0 ] ; then
485        locale=french        locale=french
486        sed 's/fr_FR/french/' $testdata/testinput3 >test3input        sed 's/fr_FR/french/' $testdata/testinput3 >test3input
487        sed 's/fr_FR/french/' $testdata/testoutput3 >test3output        sed 's/fr_FR/french/' $testdata/testoutput3 >test3output
488          sed 's/fr_FR/french/' $testdata/testoutput3A >test3outputA
489          sed 's/fr_FR/french/' $testdata/testoutput3B >test3outputB
490      else      else
491        locale -a | grep '^fr$' >/dev/null        locale -a | grep '^fr$' >/dev/null
492        if [ $? -eq 0 ] ; then        if [ $? -eq 0 ] ; then
493          locale=fr          locale=fr
494          sed 's/fr_FR/fr/' $testdata/wintestinput3 >test3input          sed 's/fr_FR/fr/' $testdata/intestinput3 >test3input
495          sed 's/fr_FR/fr/' $testdata/wintestoutput3 >test3output          sed 's/fr_FR/fr/' $testdata/intestoutput3 >test3output
496            sed 's/fr_FR/fr/' $testdata/intestoutput3A >test3outputA
497            sed 's/fr_FR/fr/' $testdata/intestoutput3B >test3outputB
498        else        else
499          locale=          locale=
500        fi        fi
# Line 492  if [ $do3 = yes ] ; then Line 506  if [ $do3 = yes ] ; then
506      for opt in "" "-s" $jitopt; do      for opt in "" "-s" $jitopt; do
507        $sim $valgrind ./pcretest -q $bmode $opt $infile testtry        $sim $valgrind ./pcretest -q $bmode $opt $infile testtry
508        if [ $? = 0 ] ; then        if [ $? = 0 ] ; then
509          $cf $outfile testtry          if $cf $outfile testtry >teststdout || \
510          if [ $? != 0 ] ; then             $cf $outfile2 testtry >teststdout || \
511            echo " "             $cf $outfile3 testtry >teststdout
512            echo "Locale test did not run entirely successfully."          then
           echo "This usually means that there is a problem with the locale"  
           echo "settings rather than a bug in PCRE."  
           break;  
         else  
513            if [ "$opt" = "-s" ] ; then echo "  OK with study"            if [ "$opt" = "-s" ] ; then echo "  OK with study"
514            elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"            elif [ "$opt" = "-s+" ] ; then echo "  OK with JIT study"
515            else echo "  OK"            else echo "  OK"
516            fi            fi
517            else
518              echo "** Locale test did not run successfully. The output did not match"
519              echo "   $outfile, $outfile2 or $outfile3."
520              echo "   This may mean that there is a problem with the locale settings rather"
521              echo "   than a bug in PCRE."
522              exit 1
523          fi          fi
524        else exit 1        else exit 1
525        fi        fi
# Line 989  fi Line 1005  fi
1005  done  done
1006    
1007  # Clean up local working files  # Clean up local working files
1008  rm -f test3input test3output testNinput testsaved* teststderr teststdout testtry  rm -f test3input test3output test3outputA testNinput testsaved* teststderr teststdout testtry
1009    
1010  # End  # End

Legend:
Removed from v.1370  
changed lines
  Added in v.1443

  ViewVC Help
Powered by ViewVC 1.1.5