diff --git a/CMakeLists.txt b/CMakeLists.txt index 51226aac4d37fae8082c5ac40f25282c350008c1..122179ad413d770454c54412f98687d0eb1da08c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -177,28 +177,31 @@ endif (${COMPILE_PACKAGING} STREQUAL "1") configure_file(tests/valgrind.suppr tests/valgrind.suppr COPYONLY) configure_file(tests/helgrind.suppr tests/helgrind.suppr COPYONLY) +set(VALGRIND valgrind) +set(VALGRIND_OPTS --track-fds=yes --leak-check=full --demangle=yes --gen-suppressions=all --show-reachable=yes --error-exitcode=1 --suppressions=tests/valgrind.suppr) +set(HELGRIND_OPTS -v --demangle=yes --gen-suppressions=all --num-callers=25 --conflict-cache-size=30000000 --error-exitcode=1 --suppressions=tests/helgrind.suppr --sim-hints=no-nptl-pthread-stackcache) add_custom_target(fullunittests tests/cta-unitTests COMMAND tests/cta-unitTests-multiProcess - COMMAND valgrind --track-fds=yes --leak-check=full --demangle=yes --gen-suppressions=all --show-reachable=yes --error-exitcode=1 --suppressions=tests/valgrind.suppr tests/cta-unitTests - COMMAND valgrind --tool=helgrind -v --demangle=yes --gen-suppressions=all --num-callers=25 --conflict-cache-size=30000000 --error-exitcode=1 --suppressions=tests/helgrind.suppr --sim-hints=no-nptl-pthread-stackcache tests/cta-unitTests + COMMAND ${VALGRIND} ${VALGRIND_OPTS} tests/cta-unitTests + COMMAND ${VALGRIND} --tool=helgrind ${HELGRIND_OPTS} tests/cta-unitTests COMMAND tests/cta-unitTests-multiProcess - COMMAND valgrind --track-fds=yes --child-silent-after-fork=yes --leak-check=full --demangle=yes --gen-suppressions=all --show-reachable=yes --error-exitcode=1 --suppressions=tests/valgrind.suppr tests/cta-unitTests-multiProcess - COMMAND valgrind --tool=helgrind -v --demangle=yes --gen-suppressions=all --num-callers=25 --conflict-cache-size=30000000 --error-exitcode=1 --suppressions=tests/helgrind.suppr --sim-hints=no-nptl-pthread-stackcache tests/cta-unitTests-multiProcess + COMMAND ${VALGRIND} ${VALGRIND_OPTS} --child-silent-after-fork=yes tests/cta-unitTests-multiProcess + COMMAND ${VALGRIND} --tool=helgrind ${HELGRIND_OPTS} tests/cta-unitTests-multiProcess DEPENDS tests/cta-unitTests tests/cta-unitTests-multiProcess tests/valgrind.suppr tests/helgrind.suppr COMMENT "Running unit tests with memory leak and race conditions detection" VERBATIM) add_custom_target(valgrind - valgrind --track-fds=yes --leak-check=full --demangle=yes --gen-suppressions=all --show-reachable=yes --error-exitcode=1 --suppressions=tests/valgrind.suppr tests/cta-unitTests - COMMAND valgrind --track-fds=yes --child-silent-after-fork=yes --leak-check=full --demangle=yes --gen-suppressions=all --show-reachable=yes --error-exitcode=1 --suppressions=tests/valgrind.suppr tests/cta-unitTests-multiProcess + ${VALGRIND} ${VALGRIND_OPTS} tests/cta-unitTests + COMMAND ${VALGRIND} ${VALGRIND_OPTS} --child-silent-after-fork=yes tests/cta-unitTests-multiProcess DEPENDS tests/cta-unitTests tests/cta-unitTests-multiProcess tests/valgrind.suppr COMMENT "Running unit tests with memory leak detection" VERBATIM) add_custom_target(helgrind - valgrind --tool=helgrind -v --demangle=yes --gen-suppressions=all --num-callers=25 --conflict-cache-size=30000000 --error-exitcode=1 --suppressions=tests/helgrind.suppr tests/cta-unitTests --sim-hints=no-nptl-pthread-stackcache - COMMAND valgrind --tool=helgrind -v --child-silent-after-fork=yes --demangle=yes --gen-suppressions=all --num-callers=25 --conflict-cache-size=30000000 --error-exitcode=1 --suppressions=tests/helgrind.suppr --sim-hints=no-nptl-pthread-stackcache tests/cta-unitTests-multiProcess + ${VALGRIND} --tool=helgrind ${HELGRIND_OPTS} tests/cta-unitTests + COMMAND ${VALGRIND} --tool=helgrind ${HELGRIND_OPTS} tests/cta-unitTests-multiProcess DEPENDS tests/cta-unitTests tests/cta-unitTests-multiProcess tests/helgrind.suppr COMMENT "Running unit tests with race conditions detection" VERBATIM)