summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/ContainTest.cmake23
1 files changed, 23 insertions, 0 deletions
diff --git a/cmake/ContainTest.cmake b/cmake/ContainTest.cmake
index 9f0c760b..5572b588 100644
--- a/cmake/ContainTest.cmake
+++ b/cmake/ContainTest.cmake
@@ -15,4 +15,27 @@ macro(contain_test test_name)
TIMEOUT 42
ENVIRONMENT "${TEST_ENV}"
)
+
+ add_custom_target("gdb-${test_name}"
+ COMMAND env ${TEST_ENV} gdb
+ --batch -ex 'set print thread-events off'
+ -ex 'run' -ex 'bt'
+ ${CMAKE_BINARY_DIR}/tests/${UNIT}
+ )
+
+ add_custom_target("valgrind-${test_name}"
+ COMMAND env ${TEST_ENV} valgrind
+ -q --leak-check=no --num-callers=4
+ --show-possibly-lost=no
+ --undef-value-errors=yes
+ --track-origins=yes
+ ${CMAKE_BINARY_DIR}/tests/${UNIT}
+ )
+
+ add_custom_target("callgrind-${test_name}"
+ COMMAND env ${TEST_ENV} valgrind
+ --tool=callgrind
+ --callgrind-out-file=${UNIT}.callgrind
+ ${CMAKE_BINARY_DIR}/tests/${UNIT}
+ )
endmacro(contain_test)