diff options
author | Joseph Snyder <joe.snyder@kitware.com> | 2014-05-29 17:47:31 (GMT) |
---|---|---|
committer | Joseph Snyder <joe.snyder@kitware.com> | 2014-06-04 14:26:19 (GMT) |
commit | 50daf239b001ddda61449044e75bb98651e99d21 (patch) | |
tree | ce47d4d773037e2515149de475c7edeee6baff17 /Tests/CMakeLists.txt | |
parent | a2822d30899f3fc2ad96abfdf5de0d0ce4166139 (diff) | |
download | CMake-50daf239b001ddda61449044e75bb98651e99d21.zip CMake-50daf239b001ddda61449044e75bb98651e99d21.tar.gz CMake-50daf239b001ddda61449044e75bb98651e99d21.tar.bz2 |
CTest: Generalize Cobertura coverage format handling
Add support for Cobertura coverage files written by Java.
Add a test which uses the report from a Java run of Cobertura to calculate coverage.
In the documentation of CTEST_COVERAGE_COMMAND, give a sample .sh file to merge
the Cobertura .ser files and generate the XML report from the merged file.
Diffstat (limited to 'Tests/CMakeLists.txt')
-rw-r--r-- | Tests/CMakeLists.txt | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 8d2b7fc..05442a1 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -2184,6 +2184,24 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release "Process file.*foo.py.*Total LOC:.*13.*Percentage Coverage: 84.62.*" ENVIRONMENT COVFILE=) + # Adding a test case for non-python Cobertura Coverage + configure_file( + "${CMake_SOURCE_DIR}/Tests/CoberturaCoverage/DartConfiguration.tcl.in" + "${CMake_BINARY_DIR}/Testing/CoberturaCoverage/DartConfiguration.tcl") + configure_file( + "${CMake_SOURCE_DIR}/Tests/CoberturaCoverage/coverage.xml.in" + "${CMake_BINARY_DIR}/Testing/CoberturaCoverage/coverage.xml") + file(COPY "${CMake_SOURCE_DIR}/Tests/CoberturaCoverage/src" + DESTINATION "${CMake_BINARY_DIR}/Testing/CoberturaCoverage") + add_test(NAME CTestCoberturaCoverage + COMMAND cmake -E chdir + ${CMake_BINARY_DIR}/Testing/CoberturaCoverage + $<TARGET_FILE:ctest> -T Coverage --debug) + set_tests_properties(CTestCoberturaCoverage PROPERTIES + PASS_REGULAR_EXPRESSION + "Process file.*CoverageTest.java.*Total LOC:.*18.*Percentage Coverage: 72.22.*" + ENVIRONMENT COVFILE=) + function(add_config_tests cfg) set(base "${CMake_BINARY_DIR}/Tests/CTestConfig") |