Merge #416
authorAlpar Juttner <alpar@cs.elte.hu>
Thu, 17 Mar 2011 18:12:03 +0100
changeset 105078b9fb1f4454
parent 1049 a07b6b27fe69
parent 1044 66156a3498ea
child 1056 6660ac776acf
Merge #416
test/CMakeLists.txt
     1.1 --- a/test/CMakeLists.txt	Tue Mar 15 19:54:11 2011 +0100
     1.2 +++ b/test/CMakeLists.txt	Thu Mar 17 18:12:03 2011 +0100
     1.3 @@ -7,6 +7,10 @@
     1.4    ${PROJECT_BINARY_DIR}/lemon
     1.5  )
     1.6  
     1.7 +SET(TEST_WITH_VALGRIND "NO" CACHE STRING
     1.8 +  "Run the test with valgrind (YES/NO).")
     1.9 +SET(VALGRIND_FLAGS "" CACHE STRING "Valgrind flags used by the tests.")
    1.10 +
    1.11  SET(TESTS
    1.12    adaptors_test
    1.13    bellman_ford_test
    1.14 @@ -136,6 +140,12 @@
    1.15      ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
    1.16    ENDIF()
    1.17    TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
    1.18 -  ADD_TEST(${TEST_NAME} ${TEST_NAME})
    1.19 +    IF(TEST_WITH_VALGRIND)
    1.20 +      ADD_TEST(${TEST_NAME}
    1.21 +        valgrind --error-exitcode=1 ${VALGRIND_FLAGS}
    1.22 +        ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} )
    1.23 +    ELSE()
    1.24 +      ADD_TEST(${TEST_NAME} ${TEST_NAME})
    1.25 +    ENDIF()
    1.26    ADD_DEPENDENCIES(check ${TEST_NAME})
    1.27  ENDFOREACH()