diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 4d542917..c8bdda47 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -55,8 +55,7 @@ if(JSON_Coverage) # add target to collect coverage information and generate HTML file # (filter script from https://stackoverflow.com/a/43726240/266378) add_custom_target(lcov_html2 - COMMAND ${CMAKE_SOURCE_DIR}/test/thirdparty/fastcov/fastcov.py --branch-coverage --lcov -o json.info --gcov ${GCOV_BIN} - COMMAND gsed -i 's%build_coverage/%%g' json.info + COMMAND ${CMAKE_SOURCE_DIR}/test/thirdparty/fastcov/fastcov.py --branch-coverage --lcov -o json.info --gcov ${GCOV_BIN} --compiler-directory ${CMAKE_BINARY_DIR} #--source-files ${SOURCE_FILES} COMMAND ${CMAKE_SOURCE_DIR}/test/thirdparty/imapdl/filterbr.py json.info > json.info.filtered.noexcept COMMAND genhtml --title "JSON for Modern C++" --legend --demangle-cpp --output-directory html --show-details --branch-coverage json.info.filtered.noexcept COMMENT "Generating HTML report test/html/index.html" diff --git a/test/thirdparty/fastcov/fastcov.py b/test/thirdparty/fastcov/fastcov.py index dd4c9132..8fc1eab5 100755 --- a/test/thirdparty/fastcov/fastcov.py +++ b/test/thirdparty/fastcov/fastcov.py @@ -61,7 +61,7 @@ def getFilteredGcdaFiles(gcda_files, exclude): def getGcdaFiles(cwd, gcda_files): if not gcda_files: - gcda_files = glob.glob(os.path.join(cwd, "**/*.gcda"), recursive=True) + gcda_files = glob.glob(os.path.join(os.path.abspath(cwd), "**/*.gcda"), recursive=True) return gcda_files def gcovWorker(cwd, gcov, files, chunk, gcov_filter_options, branch_coverage):