|
From: Stefan K. <en...@ho...> - 2005-03-04 16:17:37
|
hi, sorry if this has been answered before ... I look for a way to integrate valgrind into my unit-test suite. The unit-tests are written using check (http://check.sf.net). The project uses the autotools. Thus 'make check' runns the binaries and scripts listed in the TESTS variable of the Makefile.am. Now it would be nice to run the tests under valgrind, use the macros from e.g. memcheck.h at the end of each test and make the test fail if there are leaks. The problem is that the program is started without valgrind. One hack to solve it would be something like if(!RUNNING_ON_VALGRIND) { char cmd[FILENAME_MAX]; sprintf(cmd,"valgrind %s %s",valgrind_opts,argv[0]); argv[0]=cmd; execv(cmd, argv); } I've not yet tried it. Anyone a better idea? Commants? Ciao Stefan |