<div dir="ltr"><div><div><div><div><div><div><div><div><div>Hi<br><br></div>I&#39;m currently using the simple way of testing in Cmake, just adding the two following instructions at the end of my CMakeLists.txt; <br><br></div>
enable_testing()<br>add_test(TestMyProgram MyProgram)<br><br></div>I follow this instruction : <a href="http://cmake.org/Wiki/CMake/Testing_With_CTest">http://cmake.org/Wiki/CMake/Testing_With_CTest</a><br><br></div>and I would like to make memory checking (and eventually coverage)<br>
<br></div>In order to do it, I just add &quot;include(CTest)&quot; after enable_testing, and type in a terminal<br><br></div>ctest -D ExperimentalMemCheck<br><br></div>but now, I would like to customize memchecking (I use valgrind) by setting a suppression file and tell valgrind to produce a xml-file (that could used in an other tool or maybe Jenkins).<br>
<br></div><div>So according to the documentation I add <br>file(TO_CMAKE_PATH &quot;${CMAKE_SOURCE_DIR}/resources/valgrind_supp.xml&quot; MEMORYCHECK_SUPPRESSIONS_FILE)<br>set(MEMORYCHECK_COMMAND_OPTIONS &quot;--xml=yes --xml-file=test_memcheck.xml&quot;)<br>
</div><div><br></div>It doesn&#39;t work and it doesn&#39;t even modify CMakeCache.txt<br><br></div><div>What did I miss?<br><br></div><div>Thanks in advance<br></div><div><div><div><div><div><div><div><br><div><div><div>
<div><br><br></div></div></div></div></div></div></div></div></div></div></div></div>