/[pcre]/code/trunk/CMakeLists.txt
ViewVC logotype

Diff of /code/trunk/CMakeLists.txt

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1028 by ph10, Thu Sep 6 16:55:38 2012 UTC revision 1053 by zherczeg, Tue Oct 9 15:43:08 2012 UTC
# Line 682  IF(PCRE_BUILD_TESTS) Line 682  IF(PCRE_BUILD_TESTS)
682    FILE(WRITE ${PROJECT_BINARY_DIR}/CTestCustom.ctest    FILE(WRITE ${PROJECT_BINARY_DIR}/CTestCustom.ctest
683    "# This is a generated file.    "# This is a generated file.
684  MESSAGE(\"When testing is complete, review test output in the  MESSAGE(\"When testing is complete, review test output in the
685  ${PROJECT_BINARY_DIR}/Testing/Temporary folder.\")  \\\"${PROJECT_BINARY_DIR}/Testing/Temporary\\\" folder.\")
686  MESSAGE(\"\")  MESSAGE(\" \")
687  ")  ")
688    
689    FILE(WRITE ${PROJECT_BINARY_DIR}/pcre_test.sh    FILE(WRITE ${PROJECT_BINARY_DIR}/pcre_test.sh
# Line 719  if test \"$?\" != \"0\"; then exit 1; fi Line 719  if test \"$?\" != \"0\"; then exit 1; fi
719    
720    IF(WIN32)    IF(WIN32)
721      # Provide environment for executing the bat file version of RunTest      # Provide environment for executing the bat file version of RunTest
722      string(REPLACE "/" "\\" winsrc "${PROJECT_SOURCE_DIR}")      FILE(TO_NATIVE_PATH ${PROJECT_SOURCE_DIR} winsrc)
723        FILE(TO_NATIVE_PATH ${PROJECT_BINARY_DIR} winbin)
724        FILE(TO_NATIVE_PATH ${PCRETEST_EXE} winexe)
725    
726      FILE(WRITE ${PROJECT_BINARY_DIR}/pcre_test.txt      FILE(WRITE ${PROJECT_BINARY_DIR}/pcre_test.bat
727      "\@REM This is a generated file.      "\@REM This is a generated file.
728  \@Echo off  \@echo off
729  setlocal  setlocal
730  SET\ srcdir=\${srcdir}  SET srcdir=\"${winsrc}\"
731  SET\ pcretest=\${pcretest}  SET pcretest=\"${winexe}\"
732  call \"\${srcdir}\\RunTest.Bat\"  if not [%CMAKE_CONFIG_TYPE%]==[] SET pcretest=\"${winbin}\\%CMAKE_CONFIG_TYPE%\\pcretest.exe\"
733    call %srcdir%\\RunTest.Bat
734  if errorlevel 1 exit /b 1  if errorlevel 1 exit /b 1
735  echo RunTest.bat tests successfully completed  echo RunTest.bat tests successfully completed
736  ")  ")
737    
   FILE(WRITE ${PROJECT_BINARY_DIR}/BatDriver.cmake  
   "# This is a generated file.  
 # this script is run with arguments via the cmake command in add_test(NAME pcre_test_bat)  
 # BatDriver feeds the actual location of pcretest.exe  
 FILE(TO_NATIVE_PATH \${pcretestx} pcretest)  
 FILE(TO_NATIVE_PATH \${srcdirx} srcdir)  
 configure_file(\"\${bindirx}/pcre_test.txt\" \"\${bindirx}/pcre_test.bat\")  
 # MESSAGE(\"cmake\ variable\ pcretest\ is\ \${pcretest}\")  
 # STRING(REPLACE \" \" \"\\ \" bindir \${bindirx})  
 MESSAGE(\"COMMAND pcre_test.bat \")  
 EXECUTE_PROCESS(COMMAND pcre_test.bat  
 WORKING_DIRECTORY .  
 OUTPUT_VARIABLE batoutput)  
 MESSAGE(\"OUTPUT: \${batoutput}\")  
 ")  
   
738    ADD_TEST(NAME pcre_test_bat    ADD_TEST(NAME pcre_test_bat
739    COMMAND ${CMAKE_COMMAND} -D bindirx=${PROJECT_BINARY_DIR} -D srcdirx=${PROJECT_SOURCE_DIR} -D pcretestx=$<TARGET_FILE:pcretest> -P "${PROJECT_BINARY_DIR}/BatDriver.cmake")    COMMAND pcre_test.bat)
740    SET_TESTS_PROPERTIES(pcre_test_bat PROPERTIES    SET_TESTS_PROPERTIES(pcre_test_bat PROPERTIES
741    PASS_REGULAR_EXPRESSION "RunTest\\.bat tests successfully completed")    PASS_REGULAR_EXPRESSION "RunTest\\.bat tests successfully completed")
742    

Legend:
Removed from v.1028  
changed lines
  Added in v.1053

  ViewVC Help
Powered by ViewVC 1.1.5