# HG changeset patch # User Alpar Juttner # Date 1300381977 -3600 # Node ID c1e8f63421492b312be85e58c51f437b2bdf734f # Parent 27ddc8009ac30121aeb0b66d3819c7c490276427# Parent 66156a3498ea35da40a6aa7bbfa0d4b5a3564abc Merge #416 to branch 1.1 diff -r 27ddc8009ac3 -r c1e8f6342149 test/CMakeLists.txt --- a/test/CMakeLists.txt Fri Mar 04 11:22:50 2011 +0100 +++ b/test/CMakeLists.txt Thu Mar 17 18:12:57 2011 +0100 @@ -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 bfs_test @@ -129,6 +133,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()