From b86ab201541d1e0e10db647cc0f64ab9fc112624 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Sun, 2 Feb 2020 23:14:57 +0100 Subject: [PATCH] OpenCppCoverage skips coverage of non-source directories Previously, we would collect coverage data for all source files in Catch2's directory, including tests and examples, and we would then ask codecov.io to ignore those. With this change, OpenCppCoverage only collects coverage data for source files in the `src/` directory. This cuts the size of the coverage report in half, and also speeds up the coverage collection. --- tools/misc/coverage-helper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/misc/coverage-helper.cpp b/tools/misc/coverage-helper.cpp index a31e927f..9e7a8ca4 100644 --- a/tools/misc/coverage-helper.cpp +++ b/tools/misc/coverage-helper.cpp @@ -95,7 +95,7 @@ int exec_cmd(std::string const& cmd, int log_num, std::string const& path) { // cmd has already been escaped outside this function. auto real_cmd = "OpenCppCoverage --export_type binary:cov-report" + std::to_string(log_num) - + ".bin --quiet " + "--sources " + escape_arg(path) + " --cover_children -- " + cmd; + + ".bin --quiet " + "--sources " + escape_arg(path) + "\\src" + " --cover_children -- " + cmd; std::cout << "=== Marker ===: Cmd: " << real_cmd << '\n'; auto pipe = _popen(real_cmd.c_str(), "r");