summaryrefslogtreecommitdiff
path: root/RunTest
diff options
context:
space:
mode:
authorph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2011-09-23 10:11:35 +0000
committerph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15>2011-09-23 10:11:35 +0000
commit1f7c50ca03b975a4adf278d85c6228d1a792748b (patch)
tree13040b8ccd4d5bdc3d9065b49413b5a8f90aa045 /RunTest
parent4e19e57fe86d77826eb14db6bb3d9c5b1cf41237 (diff)
downloadpcre-1f7c50ca03b975a4adf278d85c6228d1a792748b.tar.gz
RunTest uses Windows files for "fr" locale and looks for testdata in parent
directory. CMakeLists.txt uses RunTest for testing in msys environment. git-svn-id: svn://vcs.exim.org/pcre/code/trunk@706 2f5784b3-3f2a-0410-8824-cb99058d5e15
Diffstat (limited to 'RunTest')
-rwxr-xr-xRunTest30
1 files changed, 22 insertions, 8 deletions
diff --git a/RunTest b/RunTest
index 59d315b..951392e 100755
--- a/RunTest
+++ b/RunTest
@@ -77,9 +77,15 @@ if diff -u /dev/null /dev/null; then cf="diff -u"; else cf="diff"; fi
# Find the test data
-testdata=testdata
if [ -n "$srcdir" -a -d "$srcdir" ] ; then
testdata="$srcdir/testdata"
+elif [ -d "./testdata" ] ; then
+ testdata=./testdata
+elif [ -d "../testdata" ] ; then
+ testdata=../testdata
+else
+ echo "Cannot find the testdata directory"
+ exit 1
fi
# Find which optional facilities are available
@@ -186,11 +192,11 @@ if [ $do1 = no -a $do2 = no -a $do3 = no -a $do4 = no -a \
do15=yes
fi
-# Show which release
+# Show which release and which test data
echo ""
-echo PCRE C library tests
-./pcretest /dev/null
+echo PCRE C library tests using test data from $testdata
+$sim ./pcretest /dev/null
# Primary test, compatible with JIT and all versions of Perl >= 5.8
@@ -237,7 +243,8 @@ 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.
+# for Windows. Another possibility is "fr", which needs to be run against
+# the Windows-specific input and output files.
if [ $do3 = yes ] ; then
locale -a | grep '^fr_FR$' >/dev/null
@@ -246,15 +253,22 @@ if [ $do3 = yes ] ; then
infile=$testdata/testinput3
outfile=$testdata/testoutput3
else
+ infile=test3input
+ outfile=test3output
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
- infile=test3input
- outfile=test3output
else
- locale=
+ 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
+ else
+ locale=
+ fi
fi
fi