# HG changeset patch # User Alpar Juttner # Date 2011-03-17 18:12:25 # Node ID cc9bb4f95ed3b1b6d5d83ec27b5e42ccd9e79303 # Parent 4e36fdf856b7e1c4875140cbcf361af178be3665 # Parent 66156a3498ea35da40a6aa7bbfa0d4b5a3564abc Merge #416 to branch 1.2 diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -7,6 +7,10 @@ ${PROJECT_BINARY_DIR}/lemon ) +SET(TEST_WITH_VALGRIND "NO" CACHE STRING + "Run the test with valgrind (YES/NO).") +SET(VALGRIND_FLAGS "" CACHE STRING "Valgrind flags used by the tests.") + SET(TESTS adaptors_test bellman_ford_test @@ -133,6 +137,12 @@ ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc) ENDIF() TARGET_LINK_LIBRARIES(${TEST_NAME} lemon) - ADD_TEST(${TEST_NAME} ${TEST_NAME}) + IF(TEST_WITH_VALGRIND) + ADD_TEST(${TEST_NAME} + valgrind --error-exitcode=1 ${VALGRIND_FLAGS} + ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} ) + ELSE() + ADD_TEST(${TEST_NAME} ${TEST_NAME}) + ENDIF() ADD_DEPENDENCIES(check ${TEST_NAME}) ENDFOREACH()