summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2014-01-12 19:20:27 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2014-01-12 19:20:27 +0000
commitb110a0d36cf35be243466ba1ea01bc9db99dd638 (patch)
tree95ed603342a1f05b04367ea3099d6aa87af8e7ef
parentf030cd307f53395a6bc8340c02a754d39ffb06c4 (diff)
downloadpcre-b110a0d36cf35be243466ba1ea01bc9db99dd638.tar.gz
Check alternative outputs for the locale test in RunTest. It should now work
for the 'fr' locale (which was broken). git-svn-id: svn://vcs.exim.org/pcre/code/trunk@1443 2f5784b3-3f2a-0410-8824-cb99058d5e15
-rw-r--r--ChangeLog12
-rwxr-xr-xRunTest42
-rw-r--r--testdata/testinput311
-rw-r--r--testdata/testoutput311
-rw-r--r--testdata/testoutput3A174
-rw-r--r--testdata/testoutput3B174
-rw-r--r--testdata/wintestoutput34
7 files changed, 405 insertions, 23 deletions
diff --git a/ChangeLog b/ChangeLog
index 5e1090a..7c54f71 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -68,6 +68,18 @@ Version 8.35-RC1 xx-xxxx-201x
14. Improve pattern prefix search by a simplified Boyer-Moore algorithm in JIT.
The algorithm provides a way to skip certain starting offsets, and usually
faster than linear prefix searches.
+
+15. Change 13 for 8.20 updated RunTest to check for the 'fr' locale as well
+ as for 'fr_FR' and 'french'. For some reason, however, it then used the
+ Windows-specific input and output files, which have 'french' screwed in.
+ So this could never have worked. One of the problems with locales is that
+ they aren't always the same. I have now updated RunTest so that it checks
+ the output of the locale test (test 3) against three different output
+ files, and it allows the test to pass if any one of them matches. With luck
+ this should make the test pass on some versions of Solaris where it was
+ failing. Because of the uncertainty, the script did not used to stop if
+ test 3 failed; it now does. If further versions of a French locale ever
+ come to light, they can now easily be added.
Version 8.34 15-December-2013
diff --git a/RunTest b/RunTest
index 7caa51d..e6e265b 100755
--- a/RunTest
+++ b/RunTest
@@ -31,6 +31,11 @@
# except test 10. Whatever order the arguments are in, the tests are always run
# in numerical order.
#
+# The special argument "3S" runs test 3, stopping if it fails. Test 3 is the
+# locale test, and failure usually means there's an issue with the locale
+# rather than a bug in PCRE, so normally subsequent tests are run. "3S" is
+# useful when you want to debug or update the test.
+#
# Inappropriate tests are automatically skipped (with a comment to say so): for
# example, if JIT support is not compiled, test 12 is skipped, whereas if JIT
# support is compiled, test 13 is skipped.
@@ -458,8 +463,9 @@ fi
# Locale-specific tests, provided that either the "fr_FR" or the "french"
# locale is available. The former is the Unix-like standard; the latter is
-# for Windows. Another possibility is "fr", which needs to be run against
-# the Windows-specific input and output files.
+# for Windows. Another possibility is "fr". Unfortunately, different versions
+# of the French locale give different outputs for some items. This test passes
+# if the output matches any one of the alternative output files.
if [ $do3 = yes ] ; then
locale -a | grep '^fr_FR$' >/dev/null
@@ -467,20 +473,28 @@ if [ $do3 = yes ] ; then
locale=fr_FR
infile=$testdata/testinput3
outfile=$testdata/testoutput3
+ outfile2=$testdata/testoutput3A
+ outfile3=$testdata/testoutput3B
else
infile=test3input
outfile=test3output
+ outfile2=test3outputA
+ outfile3=test3outputB
locale -a | grep '^french$' >/dev/null
if [ $? -eq 0 ] ; then
locale=french
sed 's/fr_FR/french/' $testdata/testinput3 >test3input
sed 's/fr_FR/french/' $testdata/testoutput3 >test3output
+ sed 's/fr_FR/french/' $testdata/testoutput3A >test3outputA
+ sed 's/fr_FR/french/' $testdata/testoutput3B >test3outputB
else
locale -a | grep '^fr$' >/dev/null
if [ $? -eq 0 ] ; then
locale=fr
- sed 's/fr_FR/fr/' $testdata/wintestinput3 >test3input
- sed 's/fr_FR/fr/' $testdata/wintestoutput3 >test3output
+ sed 's/fr_FR/fr/' $testdata/intestinput3 >test3input
+ sed 's/fr_FR/fr/' $testdata/intestoutput3 >test3output
+ sed 's/fr_FR/fr/' $testdata/intestoutput3A >test3outputA
+ sed 's/fr_FR/fr/' $testdata/intestoutput3B >test3outputB
else
locale=
fi
@@ -492,18 +506,20 @@ if [ $do3 = yes ] ; then
for opt in "" "-s" $jitopt; do
$sim $valgrind ./pcretest -q $bmode $opt $infile testtry
if [ $? = 0 ] ; then
- $cf $outfile testtry
- if [ $? != 0 ] ; then
- echo " "
- echo "Locale test did not run entirely successfully."
- echo "This usually means that there is a problem with the locale"
- echo "settings rather than a bug in PCRE."
- break;
- else
+ if $cf $outfile testtry >teststdout || \
+ $cf $outfile2 testtry >teststdout || \
+ $cf $outfile3 testtry >teststdout
+ then
if [ "$opt" = "-s" ] ; then echo " OK with study"
elif [ "$opt" = "-s+" ] ; then echo " OK with JIT study"
else echo " OK"
fi
+ else
+ echo "** Locale test did not run successfully. The output did not match"
+ echo " $outfile, $outfile2 or $outfile3."
+ echo " This may mean that there is a problem with the locale settings rather"
+ echo " than a bug in PCRE."
+ exit 1
fi
else exit 1
fi
@@ -989,6 +1005,6 @@ fi
done
# Clean up local working files
-rm -f test3input test3output testNinput testsaved* teststderr teststdout testtry
+rm -f test3input test3output test3outputA testNinput testsaved* teststderr teststdout testtry
# End
diff --git a/testdata/testinput3 b/testdata/testinput3
index 1d2e855..fcd4625 100644
--- a/testdata/testinput3
+++ b/testdata/testinput3
@@ -1,7 +1,10 @@
-/-- This set of tests checks local-specific features, using the fr_FR locale.
- It is not Perl-compatible. There is different version called wintestinput3
- f or use on Windows, where the locale is called "french". --/
-
+/-- This set of tests checks local-specific features, using the "fr_FR" locale.
+ It is not Perl-compatible. When run via RunTest, the locale is edited to
+ be whichever of "fr_FR", "french", or "fr" is found to exist. There is
+ different version of this file called wintestinput3 for use on Windows,
+ where the locale is called "french" and the tests are run using
+ RunTest.bat. --/
+
< forbid 8W
/^[\w]+/
diff --git a/testdata/testoutput3 b/testdata/testoutput3
index 6241623..73119ab 100644
--- a/testdata/testoutput3
+++ b/testdata/testoutput3
@@ -1,7 +1,10 @@
-/-- This set of tests checks local-specific features, using the fr_FR locale.
- It is not Perl-compatible. There is different version called wintestinput3
- f or use on Windows, where the locale is called "french". --/
-
+/-- This set of tests checks local-specific features, using the "fr_FR" locale.
+ It is not Perl-compatible. When run via RunTest, the locale is edited to
+ be whichever of "fr_FR", "french", or "fr" is found to exist. There is
+ different version of this file called wintestinput3 for use on Windows,
+ where the locale is called "french" and the tests are run using
+ RunTest.bat. --/
+
< forbid 8W
/^[\w]+/
diff --git a/testdata/testoutput3A b/testdata/testoutput3A
new file mode 100644
index 0000000..0bde024
--- /dev/null
+++ b/testdata/testoutput3A
@@ -0,0 +1,174 @@
+/-- This set of tests checks local-specific features, using the "fr_FR" locale.
+ It is not Perl-compatible. When run via RunTest, the locale is edited to
+ be whichever of "fr_FR", "french", or "fr" is found to exist. There is
+ different version of this file called wintestinput3 for use on Windows,
+ where the locale is called "french" and the tests are run using
+ RunTest.bat. --/
+
+< forbid 8W
+
+/^[\w]+/
+ *** Failers
+No match
+ École
+No match
+
+/^[\w]+/Lfr_FR
+ École
+ 0: École
+
+/^[\w]+/
+ *** Failers
+No match
+ École
+No match
+
+/^[\W]+/
+ École
+ 0: \xc9
+
+/^[\W]+/Lfr_FR
+ *** Failers
+ 0: ***
+ École
+No match
+
+/[\b]/
+ \b
+ 0: \x08
+ *** Failers
+No match
+ a
+No match
+
+/[\b]/Lfr_FR
+ \b
+ 0: \x08
+ *** Failers
+No match
+ a
+No match
+
+/^\w+/
+ *** Failers
+No match
+ École
+No match
+
+/^\w+/Lfr_FR
+ École
+ 0: École
+
+/(.+)\b(.+)/
+ École
+ 0: \xc9cole
+ 1: \xc9
+ 2: cole
+
+/(.+)\b(.+)/Lfr_FR
+ *** Failers
+ 0: *** Failers
+ 1: ***
+ 2: Failers
+ École
+No match
+
+/École/i
+ École
+ 0: \xc9cole
+ *** Failers
+No match
+ école
+No match
+
+/École/iLfr_FR
+ École
+ 0: École
+ école
+ 0: école
+
+/\w/IS
+Capturing subpattern count = 0
+No options
+No first char
+No need char
+Subject length lower bound = 1
+Starting chars: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
+ Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
+
+/\w/ISLfr_FR
+Capturing subpattern count = 0
+No options
+No first char
+No need char
+Subject length lower bound = 1
+Starting chars: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
+ Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
+ ª µ º À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ø Ù Ú Û Ü Ý Þ ß à á â
+ ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ø ù ú û ü ý þ ÿ
+
+/^[\xc8-\xc9]/iLfr_FR
+ École
+ 0: É
+ école
+ 0: é
+
+/^[\xc8-\xc9]/Lfr_FR
+ École
+ 0: É
+ *** Failers
+No match
+ école
+No match
+
+/\W+/Lfr_FR
+ >>>\xaa<<<
+ 0: >>>
+ >>>\xba<<<
+ 0: >>>
+
+/[\W]+/Lfr_FR
+ >>>\xaa<<<
+ 0: >>>
+ >>>\xba<<<
+ 0: >>>
+
+/[^[:alpha:]]+/Lfr_FR
+ >>>\xaa<<<
+ 0: >>>
+ >>>\xba<<<
+ 0: >>>
+
+/\w+/Lfr_FR
+ >>>\xaa<<<
+ 0: ª
+ >>>\xba<<<
+ 0: º
+
+/[\w]+/Lfr_FR
+ >>>\xaa<<<
+ 0: ª
+ >>>\xba<<<
+ 0: º
+
+/[[:alpha:]]+/Lfr_FR
+ >>>\xaa<<<
+ 0: ª
+ >>>\xba<<<
+ 0: º
+
+/[[:alpha:]][[:lower:]][[:upper:]]/DZLfr_FR
+------------------------------------------------------------------
+ Bra
+ [A-Za-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\xff]
+ [a-z\xaa\xb5\xba\xdf-\xf6\xf8-\xff]
+ [A-Z\xc0-\xd6\xd8-\xde]
+ Ket
+ End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+No options
+No first char
+No need char
+
+/-- End of testinput3 --/
diff --git a/testdata/testoutput3B b/testdata/testoutput3B
new file mode 100644
index 0000000..8d9fe7d
--- /dev/null
+++ b/testdata/testoutput3B
@@ -0,0 +1,174 @@
+/-- This set of tests checks local-specific features, using the "fr_FR" locale.
+ It is not Perl-compatible. When run via RunTest, the locale is edited to
+ be whichever of "fr_FR", "french", or "fr" is found to exist. There is
+ different version of this file called wintestinput3 for use on Windows,
+ where the locale is called "french" and the tests are run using
+ RunTest.bat. --/
+
+< forbid 8W
+
+/^[\w]+/
+ *** Failers
+No match
+ École
+No match
+
+/^[\w]+/Lfr_FR
+ École
+ 0: École
+
+/^[\w]+/
+ *** Failers
+No match
+ École
+No match
+
+/^[\W]+/
+ École
+ 0: \xc9
+
+/^[\W]+/Lfr_FR
+ *** Failers
+ 0: ***
+ École
+No match
+
+/[\b]/
+ \b
+ 0: \x08
+ *** Failers
+No match
+ a
+No match
+
+/[\b]/Lfr_FR
+ \b
+ 0: \x08
+ *** Failers
+No match
+ a
+No match
+
+/^\w+/
+ *** Failers
+No match
+ École
+No match
+
+/^\w+/Lfr_FR
+ École
+ 0: École
+
+/(.+)\b(.+)/
+ École
+ 0: \xc9cole
+ 1: \xc9
+ 2: cole
+
+/(.+)\b(.+)/Lfr_FR
+ *** Failers
+ 0: *** Failers
+ 1: ***
+ 2: Failers
+ École
+No match
+
+/École/i
+ École
+ 0: \xc9cole
+ *** Failers
+No match
+ école
+No match
+
+/École/iLfr_FR
+ École
+ 0: École
+ école
+ 0: école
+
+/\w/IS
+Capturing subpattern count = 0
+No options
+No first char
+No need char
+Subject length lower bound = 1
+Starting chars: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
+ Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
+
+/\w/ISLfr_FR
+Capturing subpattern count = 0
+No options
+No first char
+No need char
+Subject length lower bound = 1
+Starting chars: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
+ Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
+ ª µ º À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ø Ù Ú Û Ü Ý Þ ß à á â
+ ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ø ù ú û ü ý þ ÿ
+
+/^[\xc8-\xc9]/iLfr_FR
+ École
+ 0: É
+ école
+ 0: é
+
+/^[\xc8-\xc9]/Lfr_FR
+ École
+ 0: É
+ *** Failers
+No match
+ école
+No match
+
+/\W+/Lfr_FR
+ >>>\xaa<<<
+ 0: >>>
+ >>>\xba<<<
+ 0: >>>
+
+/[\W]+/Lfr_FR
+ >>>\xaa<<<
+ 0: >>>
+ >>>\xba<<<
+ 0: >>>
+
+/[^[:alpha:]]+/Lfr_FR
+ >>>\xaa<<<
+ 0: >>>
+ >>>\xba<<<
+ 0: >>>
+
+/\w+/Lfr_FR
+ >>>\xaa<<<
+ 0: ª
+ >>>\xba<<<
+ 0: º
+
+/[\w]+/Lfr_FR
+ >>>\xaa<<<
+ 0: ª
+ >>>\xba<<<
+ 0: º
+
+/[[:alpha:]]+/Lfr_FR
+ >>>\xaa<<<
+ 0: ª
+ >>>\xba<<<
+ 0: º
+
+/[[:alpha:]][[:lower:]][[:upper:]]/DZLfr_FR
+------------------------------------------------------------------
+ Bra
+ [A-Za-z\x83\x8a\x8c\x8e\x9a\x9c\x9e\x9f\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\xff]
+ [a-z\x83\x9a\x9c\x9e\xaa\xb5\xba\xdf-\xf6\xf8-\xff]
+ [A-Z\x8a\x8c\x8e\x9f\xc0-\xd6\xd8-\xde]
+ Ket
+ End
+------------------------------------------------------------------
+Capturing subpattern count = 0
+No options
+No first char
+No need char
+
+/-- End of testinput3 --/
diff --git a/testdata/wintestoutput3 b/testdata/wintestoutput3
index 0088007..456ad19 100644
--- a/testdata/wintestoutput3
+++ b/testdata/wintestoutput3
@@ -84,7 +84,7 @@ No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
+Starting chars: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
/\w/ISLfrench
@@ -93,7 +93,7 @@ No options
No first char
No need char
Subject length lower bound = 1
-Starting byte set: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
+Starting chars: 0 1 2 3 4 5 6 7 8 9 A B C D E F G H I J K L M N O P
Q R S T U V W X Y Z _ a b c d e f g h i j k l m n o p q r s t u v w x y z
ƒ Š Œ Ž š œ ž Ÿ ª ² ³ µ ¹ º À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö
Ø Ù Ú Û Ü Ý Þ ß à á â ã ä å æ ç è é ê ë ì í î ï ð ñ ò ó ô õ ö ø ù ú û ü ý