Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ctest does not find valgrind

Calling

ctest -j4 -DCTEST_MEMORYCHECK_COMMAND="/usr/bin/valgrind" -DMemoryCheckCommand="/usr/bin/valgrind" --output-on-failure -T MemCheck 

says

Memory checker (MemoryCheckCommand) not set, or cannot find the specified program.

Why doesn't it find valgrind automatically nor when specified manually?

like image 259
Baradé Avatar asked Mar 19 '23 03:03

Baradé


1 Answers

As described on the CTest Wiki page, CTest reads the location of the memory check command (among other settings) from a file DartConfiguration.tcl in the build directory. One way to create the dart configuration file is to simply include the CTest CMake module in your CMakeLists.txt:

include (CTest)

The CTest module will find your valgrind installation in /usr/bin and put a variable MemoryCheckCommand pointing to it in the DartConfiguration.tcl file.

like image 65
sakra Avatar answered Mar 28 '23 00:03

sakra