Use <TARGET_FILE> expression to run ctest so it works with Xcode and VS IDE.
Also add -crlf to the .gitconfig to handle the coverage data.
This commit is contained in:
parent
62f6bce7a5
commit
220afcaf84
|
@ -1719,14 +1719,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
|
||||||
"${CMake_BINARY_DIR}/Testing/MumpsCoverage/gtm_coverage.mcov")
|
"${CMake_BINARY_DIR}/Testing/MumpsCoverage/gtm_coverage.mcov")
|
||||||
file(COPY "${CMake_SOURCE_DIR}/Tests/MumpsCoverage/VistA-FOIA"
|
file(COPY "${CMake_SOURCE_DIR}/Tests/MumpsCoverage/VistA-FOIA"
|
||||||
DESTINATION "${CMake_BINARY_DIR}/Testing/MumpsCoverage")
|
DESTINATION "${CMake_BINARY_DIR}/Testing/MumpsCoverage")
|
||||||
set(_MUMPS_TEST_DIR MumpsCoverage)
|
add_test(NAME CTestGTMCoverage
|
||||||
configure_file(
|
COMMAND cmake -E chdir
|
||||||
"${CMake_SOURCE_DIR}/Tests/MumpsCoverage/RunTest.ctest.in"
|
${CMake_BINARY_DIR}/Testing/MumpsCoverage
|
||||||
"${CMake_BINARY_DIR}/Testing/MumpsCoverage/RunTest.ctest"
|
$<TARGET_FILE:ctest> -T Coverage --debug)
|
||||||
@ONLY)
|
|
||||||
add_test(CTestGTMCoverage
|
|
||||||
${CMAKE_CTEST_COMMAND}
|
|
||||||
-S ${CMake_BINARY_DIR}/Testing/MumpsCoverage/RunTest.ctest)
|
|
||||||
set_tests_properties(CTestGTMCoverage PROPERTIES
|
set_tests_properties(CTestGTMCoverage PROPERTIES
|
||||||
PASS_REGULAR_EXPRESSION
|
PASS_REGULAR_EXPRESSION
|
||||||
"Process file.*XINDEX.m.*Total LOC:.*127.*Percentage Coverage: 85.83.*")
|
"Process file.*XINDEX.m.*Total LOC:.*127.*Percentage Coverage: 85.83.*")
|
||||||
|
@ -1739,14 +1735,10 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
|
||||||
"${CMake_BINARY_DIR}/Testing/MumpsCacheCoverage/cache_coverage.cmcov")
|
"${CMake_BINARY_DIR}/Testing/MumpsCacheCoverage/cache_coverage.cmcov")
|
||||||
file(COPY "${CMake_SOURCE_DIR}/Tests/MumpsCoverage/VistA-FOIA"
|
file(COPY "${CMake_SOURCE_DIR}/Tests/MumpsCoverage/VistA-FOIA"
|
||||||
DESTINATION "${CMake_BINARY_DIR}/Testing/MumpsCacheCoverage")
|
DESTINATION "${CMake_BINARY_DIR}/Testing/MumpsCacheCoverage")
|
||||||
set(_MUMPS_TEST_DIR MumpsCacheCoverage)
|
add_test(NAME CTestCacheCoverage
|
||||||
configure_file(
|
COMMAND cmake -E chdir
|
||||||
"${CMake_SOURCE_DIR}/Tests/MumpsCoverage/RunTest.ctest.in"
|
${CMake_BINARY_DIR}/Testing/MumpsCacheCoverage
|
||||||
"${CMake_BINARY_DIR}/Testing/MumpsCacheCoverage/RunTest.ctest"
|
$<TARGET_FILE:ctest> -T Coverage --debug)
|
||||||
@ONLY)
|
|
||||||
add_test(CTestCacheCoverage
|
|
||||||
${CMAKE_CTEST_COMMAND}
|
|
||||||
-S ${CMake_BINARY_DIR}/Testing/MumpsCacheCoverage/RunTest.ctest)
|
|
||||||
set_tests_properties(CTestCacheCoverage PROPERTIES
|
set_tests_properties(CTestCacheCoverage PROPERTIES
|
||||||
PASS_REGULAR_EXPRESSION
|
PASS_REGULAR_EXPRESSION
|
||||||
"Process file.*XINDEX.m.*Total LOC:.*125.*Percentage Coverage: 85.60.*")
|
"Process file.*XINDEX.m.*Total LOC:.*125.*Percentage Coverage: 85.60.*")
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
*.cmcov -whitespace
|
*.cmcov -crlf -whitespace
|
||||||
*.mcov -whitespace
|
*.mcov -crlf -whitespace
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
execute_process(COMMAND "@CMAKE_CTEST_COMMAND@" -T Coverage --debug
|
|
||||||
WORKING_DIRECTORY "@CMake_BINARY_DIR@/Testing/@_MUMPS_TEST_DIR@"
|
|
||||||
RESULT_VARIABLE RES)
|
|
||||||
if(${RES} EQUAL 0)
|
|
||||||
message("Test passed")
|
|
||||||
else()
|
|
||||||
message(FATAL_ERROR "Error code running ctest=${RES}")
|
|
||||||
endif()
|
|
Loading…
Reference in New Issue