diff options
author | Nils Gladitz <nilsgladitz@gmail.com> | 2015-04-02 15:02:08 (GMT) |
---|---|---|
committer | Nils Gladitz <nilsgladitz@gmail.com> | 2015-04-04 10:25:15 (GMT) |
commit | 9a544f2d987df940625465129a5f00bea01ad4eb (patch) | |
tree | 5ef0b0cfd39cd226e5aa363290710f910bdd261d /Tests/CTestCoverageCollectGCOV/TestProject/CMakeLists.txt | |
parent | f707460e42949e4ca372bf23892a7d6fb9eb1b86 (diff) | |
download | CMake-9a544f2d987df940625465129a5f00bea01ad4eb.zip CMake-9a544f2d987df940625465129a5f00bea01ad4eb.tar.gz CMake-9a544f2d987df940625465129a5f00bea01ad4eb.tar.bz2 |
CTestCoverageCollectGCOV: Support CTEST_CUSTOM_COVERAGE_EXCLUDE
Diffstat (limited to 'Tests/CTestCoverageCollectGCOV/TestProject/CMakeLists.txt')
-rw-r--r-- | Tests/CTestCoverageCollectGCOV/TestProject/CMakeLists.txt | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/Tests/CTestCoverageCollectGCOV/TestProject/CMakeLists.txt b/Tests/CTestCoverageCollectGCOV/TestProject/CMakeLists.txt new file mode 100644 index 0000000..ce6fac4 --- /dev/null +++ b/Tests/CTestCoverageCollectGCOV/TestProject/CMakeLists.txt @@ -0,0 +1,41 @@ +cmake_minimum_required(VERSION 3.2) + +project(TestProject CXX) + +include(CTest) + +set(SOURCES + main.cpp + 3rdparty/foo.cpp + extra/extra.cpp +) + +add_executable(myexecutable ${SOURCES}) + +set_property(SOURCE main.cpp APPEND PROPERTY LABELS SourceLabel) +set_property(TARGET myexecutable APPEND PROPERTY LABELS TargetLabel) + +set(MYEXECUTABLE_INFO_FILE "${CMAKE_CURRENT_BINARY_DIR}/myexecutable_info.cmake") + +file(WRITE "${MYEXECUTABLE_INFO_FILE}" " + set(TARGET myexecutable) + set(SOURCE_DIR \"${CMAKE_CURRENT_SOURCE_DIR}\") + set(SOURCES \"${SOURCES}\") +") + +add_custom_command(TARGET myexecutable + POST_BUILD + COMMAND ${CMAKE_COMMAND} + "-DINFO_FILE=${MYEXECUTABLE_INFO_FILE}" + -P "${CMAKE_CURRENT_SOURCE_DIR}/fake_compile_time_gcno.cmake" + VERBATIM +) + +add_test(NAME mytest + COMMAND ${CMAKE_COMMAND} + "-DMYEXECUTABLE=$<TARGET_FILE:myexecutable>" + "-DTARGETDIR=${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/myexecutable.dir" + -P "${CMAKE_CURRENT_SOURCE_DIR}/fake_run_time_gcda.cmake" +) + +set_property(TEST mytest APPEND PROPERTY LABELS TestLabel) |