<div dir="ltr">I can't say I have much experience with these markups, but after searching a bit I found this relevant post on stackoverflow:<div><br></div><div><a href="https://stackoverflow.com/questions/38618136/lcov-excl-start-stop-has-no-effect-when-using-gcovr">https://stackoverflow.com/questions/38618136/lcov-excl-start-stop-has-no-effect-when-using-gcovr</a><br></div><div><br></div><div>Their solution was to use gcovr v3.4.</div><div><br></div><div>I haven't used this tool either, but it looks like it also has an option to output coverage data in Cobertura XML format:</div><div><a href="https://gcovr.com/en/stable/guide.html#getting-started">https://gcovr.com/en/stable/guide.html#getting-started</a><br></div><div>That's another coverage format that CTest knows how to parse.<br></div><div><br></div><div>Good luck! Let us know how it goes.</div><div><div><br></div><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 26, 2020 at 5:04 AM Nikhil Reddy Ramolla <<a href="mailto:rnr1410@gmail.com">rnr1410@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_default"><font face="verdana, sans-serif">Hello, this is my current CTest script for a C++ Project:</font></div><div class="gmail_default"><font face="verdana, sans-serif"><span style="background-color:rgb(26,28,29);white-space:pre-wrap"> set(CTEST_SOURCE_DIRECTORY ${CTEST_SCRIPT_DIRECTORY}/src)</span><br></font></div><div class="gmail_default"><span style="white-space:pre-wrap;background-color:rgb(26,28,29)"><font face="verdana, sans-serif"> set(CTEST_BINARY_DIRECTORY ${CTEST_SCRIPT_DIRECTORY}/bin)
include(${CTEST_SOURCE_DIRECTORY}/CTestConfig.cmake)
set(CTEST_CMAKE_GENERATOR "Unix Makefiles")
set(CTEST_COVERAGE_COMMAND gcov)
ctest_empty_binary_directory(${CTEST_BINARY_DIRECTORY})
ctest_start(Experimental)
ctest_configure()
ctest_build()
ctest_test()
ctest_coverage()
ctest_submit()</font></span></div><div class="gmail_default"><span style="white-space:pre-wrap;background-color:rgb(26,28,29)"><font face="verdana, sans-serif"><br></font></span></div><div class="gmail_default"><font face="verdana, sans-serif"><span style="white-space:pre-wrap;background-color:rgb(26,28,29)">The GCC coverage flags are enabled by default in src/CMakeLists.txt.</span></font></div><div class="gmail_default"><span style="background-color:rgb(26,28,29);white-space:pre-wrap"><font face="verdana, sans-serif">I see that everything is working as intended, but [GL]COVR?_EXCL_LINE is not working.</font></span></div><div class="gmail_default"><font face="verdana, sans-serif">lcov and genhtml are two other tools which are useful to create coverage report in html, but I want it to submit to CDash instead, as a part of CDash's coverage.</font></div><div class="gmail_default"><font face="verdana, sans-serif">So I changed CTEST_COVERAGE_COMMAND to lcov and got this eror:</font></div><div class="gmail_default"><span style="white-space:pre-wrap;background-color:rgb(26,28,29)"><font face="verdana, sans-serif"> lcov -o /path/to/testThis.dir /path/to/testThis.dir/this.cpp.gcda
lcov: Need one of options -z, -c, -a, -e, -r, -l, --diff or --summary
Use lcov --help to get usage information
Coverage command returned: 2 while processing: /path/to/testThis.dir/this.cpp.gcda
Command produced error: 0</font></span><font face="verdana, sans-serif"><br></font></div><div class="gmail_default"><font face="verdana, sans-serif"><span style="white-space:pre-wrap;background-color:rgb(26,28,29)">>From this it is clear to me that lcov is not intended to use for this case.</span></font></div><div class="gmail_default"><span style="background-color:rgb(26,28,29);font-family:verdana,sans-serif;white-space:pre-wrap">But I really want an alternative/patch of gcov which can exclude [GL]COVR?_EXCL_(LINE|START|STOP)</span><br></div><div class="gmail_default"><font face="verdana, sans-serif"><span style="white-space:pre-wrap;background-color:rgb(26,28,29)">Is a solution present for this?</span></font></div><div class="gmail_default"><font face="verdana, sans-serif"><span style="white-space:pre-wrap;background-color:rgb(26,28,29)">I have already posted in <a href="http://goog_1415041473" target="_blank">https://</a></span><a href="http://discourse.cmake.org" target="_blank">discourse.cmake.org</a> but got no reply.</font></div></div>
_______________________________________________<br>
CDash mailing list<br>
<a href="mailto:CDash@public.kitware.com" target="_blank">CDash@public.kitware.com</a><br>
<a href="https://public.kitware.com/mailman/listinfo/cdash" rel="noreferrer" target="_blank">https://public.kitware.com/mailman/listinfo/cdash</a><br>
</blockquote></div>