summaryrefslogtreecommitdiffstats
path: root/Tests/CTestCoverageCollectGCOV/fakegcov.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/CTestCoverageCollectGCOV/fakegcov.cmake')
-rw-r--r--Tests/CTestCoverageCollectGCOV/fakegcov.cmake12
1 files changed, 9 insertions, 3 deletions
diff --git a/Tests/CTestCoverageCollectGCOV/fakegcov.cmake b/Tests/CTestCoverageCollectGCOV/fakegcov.cmake
index e704f14..b0c3a9b 100644
--- a/Tests/CTestCoverageCollectGCOV/fakegcov.cmake
+++ b/Tests/CTestCoverageCollectGCOV/fakegcov.cmake
@@ -3,6 +3,12 @@ foreach(I RANGE 0 ${CMAKE_ARGC})
set(gcda_file "${CMAKE_ARGV${I}}")
endif()
endforeach()
-get_filename_component(gcda_file ${gcda_file} NAME_WE)
-file(WRITE "${CMAKE_SOURCE_DIR}/${gcda_file}.gcov"
-"fake gcov file")
+
+get_filename_component(gcda_name ${gcda_file} NAME)
+string(REPLACE ".gcda" ".gcov" gcov_name "${gcda_name}")
+
+file(STRINGS "${gcda_file}" source_file LIMIT_COUNT 1 ENCODING UTF-8)
+
+file(WRITE "${CMAKE_SOURCE_DIR}/${gcov_name}"
+ " -: 0:Source:${source_file}"
+)