summaryrefslogtreecommitdiff
path: root/pcre
diff options
context:
space:
mode:
Diffstat (limited to 'pcre')
-rw-r--r--pcre/CMakeLists.txt63
-rw-r--r--pcre/pcre_grep_test.sh13
-rw-r--r--pcre/pcre_test.bat9
-rw-r--r--pcre/pcre_test.sh11
4 files changed, 51 insertions, 45 deletions
diff --git a/pcre/CMakeLists.txt b/pcre/CMakeLists.txt
index 80e402e5713..ca60d9ed265 100644
--- a/pcre/CMakeLists.txt
+++ b/pcre/CMakeLists.txt
@@ -364,12 +364,6 @@ IF(PCRE_BUILD_TESTS)
# exes in Debug location tested by the RunTest shell script
# via "make test"
- IF(PCRE_BUILD_PCREGREP)
- GET_TARGET_PROPERTY(PCREGREP_EXE pcregrep DEBUG_LOCATION)
- ENDIF(PCRE_BUILD_PCREGREP)
-
- GET_TARGET_PROPERTY(PCRETEST_EXE pcretest DEBUG_LOCATION)
- STRING(REGEX REPLACE "[^/]+$" "" PCRETEST_DIR ${PCRETEST_EXE})
# =================================================
# Write out a CTest configuration file
@@ -381,36 +375,24 @@ MESSAGE(\"When testing is complete, review test output in the
MESSAGE(\" \")
")
- FILE(WRITE ${PROJECT_BINARY_DIR}/pcre_test.sh
- "#! /bin/sh
-# This is a generated file.
-srcdir=${PROJECT_SOURCE_DIR}
-pcretest=${PCRETEST_EXE}
-cd ${PCRETEST_DIR}
-. ${PROJECT_SOURCE_DIR}/RunTest
-if test \"$?\" != \"0\"; then exit 1; fi
-# End
-")
-
IF(UNIX)
- ADD_TEST(pcre_test sh ${PROJECT_BINARY_DIR}/pcre_test.sh)
+ ADD_TEST(NAME pcre_test
+ COMMAND sh pcre_test.sh
+ ${PROJECT_SOURCE_DIR}
+ $<TARGET_FILE:pcretest>
+ $<TARGET_FILE_DIR:pcretest>
+ )
ENDIF(UNIX)
IF(PCRE_BUILD_PCREGREP)
- FILE(WRITE ${PROJECT_BINARY_DIR}/pcre_grep_test.sh
- "#! /bin/sh
-# This is a generated file.
-srcdir=${PROJECT_SOURCE_DIR}
-pcregrep=${PCREGREP_EXE}
-pcretest=${PCRETEST_EXE}
-cd ${PCRETEST_DIR}
-. ${PROJECT_SOURCE_DIR}/RunGrepTest
-if test \"$?\" != \"0\"; then exit 1; fi
-# End
-")
-
IF(UNIX)
- ADD_TEST(pcre_grep_test sh ${PROJECT_BINARY_DIR}/pcre_grep_test.sh)
+ ADD_TEST(NAME pcre_grep_test
+ COMMAND sh pcre_grep_test.sh
+ ${PROJECT_SOURCE_DIR}
+ $<TARGET_FILE:pcregrep>
+ $<TARGET_FILE:pcretest>
+ $<TARGET_FILE_DIR:pcretest>
+ )
ENDIF(UNIX)
ENDIF(PCRE_BUILD_PCREGREP)
@@ -418,22 +400,13 @@ if test \"$?\" != \"0\"; then exit 1; fi
# Provide environment for executing the bat file version of RunTest
FILE(TO_NATIVE_PATH ${PROJECT_SOURCE_DIR} winsrc)
FILE(TO_NATIVE_PATH ${PROJECT_BINARY_DIR} winbin)
- FILE(TO_NATIVE_PATH ${PCRETEST_EXE} winexe)
-
- FILE(WRITE ${PROJECT_BINARY_DIR}/pcre_test.bat
- "\@REM This is a generated file.
-\@echo off
-setlocal
-SET srcdir=\"${winsrc}\"
-SET pcretest=\"${winexe}\"
-if not [%CMAKE_CONFIG_TYPE%]==[] SET pcretest=\"${winbin}\\%CMAKE_CONFIG_TYPE%\\pcretest.exe\"
-call %srcdir%\\RunTest.Bat
-if errorlevel 1 exit /b 1
-echo RunTest.bat tests successfully completed
-")
ADD_TEST(NAME pcre_test_bat
- COMMAND pcre_test.bat)
+ COMMAND pcre_test.bat
+ ${winsrc}
+ ${winbin}
+ $<TARGET_FILE:pcretest>
+ )
SET_TESTS_PROPERTIES(pcre_test_bat PROPERTIES
PASS_REGULAR_EXPRESSION "RunTest\\.bat tests successfully completed")
diff --git a/pcre/pcre_grep_test.sh b/pcre/pcre_grep_test.sh
new file mode 100644
index 00000000000..7165aeeb0e2
--- /dev/null
+++ b/pcre/pcre_grep_test.sh
@@ -0,0 +1,13 @@
+#! /bin/sh
+#
+srcdir="$1"
+pcregrep="$2"
+pcretest="$3"
+cd "$4"
+shift
+shift
+shift
+shift
+. "$srcdir"/RunGrepTest
+if test "$?" != "0"; then exit 1; fi
+# End
diff --git a/pcre/pcre_test.bat b/pcre/pcre_test.bat
new file mode 100644
index 00000000000..c3f8dc3d43b
--- /dev/null
+++ b/pcre/pcre_test.bat
@@ -0,0 +1,9 @@
+@echo off
+setlocal
+SET srcdir="%1"
+SET bindir="%1"
+SET pcretest="%3"
+if not [%CMAKE_CONFIG_TYPE%]==[] SET pcretest="%bindir%\%CMAKE_CONFIG_TYPE%\pcretest.exe"
+call %srcdir%\RunTest.Bat
+if errorlevel 1 exit /b 1
+echo RunTest.bat tests successfully completed
diff --git a/pcre/pcre_test.sh b/pcre/pcre_test.sh
new file mode 100644
index 00000000000..8fadc671c9a
--- /dev/null
+++ b/pcre/pcre_test.sh
@@ -0,0 +1,11 @@
+#! /bin/sh
+#
+srcdir="$1"
+pcretest="$2"
+cd "$3"
+shift
+shift
+shift
+. "$srcdir"/RunTest
+if test "$?" != "0"; then exit 1; fi
+# End