diff options
Diffstat (limited to 'pcre/CMakeLists.txt')
-rw-r--r-- | pcre/CMakeLists.txt | 63 |
1 files changed, 18 insertions, 45 deletions
diff --git a/pcre/CMakeLists.txt b/pcre/CMakeLists.txt index 80e402e5713..857a96b9ef9 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 ${CMAKE_CURRENT_SOURCE_DIR}/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 ${CMAKE_CURRENT_SOURCE_DIR}/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") |