diff options
author | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2011-09-23 10:11:35 +0000 |
---|---|---|
committer | ph10 <ph10@2f5784b3-3f2a-0410-8824-cb99058d5e15> | 2011-09-23 10:11:35 +0000 |
commit | 1f7c50ca03b975a4adf278d85c6228d1a792748b (patch) | |
tree | 13040b8ccd4d5bdc3d9065b49413b5a8f90aa045 | |
parent | 4e19e57fe86d77826eb14db6bb3d9c5b1cf41237 (diff) | |
download | pcre-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
-rw-r--r-- | CMakeLists.txt | 17 | ||||
-rwxr-xr-x | RunTest | 30 |
2 files changed, 34 insertions, 13 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b1014a..aeed161 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -487,12 +487,18 @@ IF(PCRE_BUILD_TESTS) ") IF(UNIX) - ADD_TEST(pcre_test ${PROJECT_SOURCE_DIR}/RunTest) - ADD_TEST(pcre_grep_test ${PROJECT_SOURCE_DIR}/RunGrepTest) + ADD_TEST(pcre_test ${PROJECT_SOURCE_DIR}/RunTest) + ADD_TEST(pcre_grep_test ${PROJECT_SOURCE_DIR}/RunGrepTest) ENDIF(UNIX) + IF(WIN32) - # ADD_TEST(pcre_test cmd /C ${PROJECT_SOURCE_DIR}/RunTest.bat) - ADD_TEST(pcre_test ${PROJECT_SOURCE_DIR}/RunTest.bat) + IF("$ENV{OSTYPE}" STREQUAL "msys") + ADD_TEST(pcre_test ${PROJECT_SOURCE_DIR}/RunTest) + ADD_TEST(pcre_grep_test ${PROJECT_SOURCE_DIR}/RunGrepTest) + ELSE("$ENV{OSTYPE}" STREQUAL "msys") + # ADD_TEST(pcre_test cmd /C ${PROJECT_SOURCE_DIR}/RunTest.bat) + ADD_TEST(pcre_test ${PROJECT_SOURCE_DIR}/RunTest.bat) + ENDIF("$ENV{OSTYPE}" STREQUAL "msys") ENDIF(WIN32) IF(PCRE_SUPPORT_JIT) @@ -514,8 +520,9 @@ IF(PCRE_BUILD_TESTS) DEBUG_LOCATION) IF(PCRE_SUPPORT_JIT) - ADD_TEST(pcre_jit_test ${PCRE_JIT_TEST_EXE}) + ADD_TEST(pcre_jit_test ${PCRE_JIT_TEST_EXE}) ENDIF(PCRE_SUPPORT_JIT) + ADD_TEST(pcrecpp_test ${PCRECPP_UNITTEST_EXE}) ADD_TEST(pcre_scanner_test ${PCRE_SCANNER_UNITTEST_EXE}) ADD_TEST(pcre_stringpiece_test ${PCRE_STRINGPIECE_UNITTEST_EXE}) @@ -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 |