Merge #416 to branch 1.1 1.1
authorAlpar Juttner <alpar@cs.elte.hu>
Thu, 17 Mar 2011 18:12:57 +0100
branch1.1
changeset 748c1e8f6342149
parent 746 27ddc8009ac3
parent 747 66156a3498ea
child 750 632a72b27123
Merge #416 to branch 1.1
     1.1 --- a/test/CMakeLists.txt	Fri Mar 04 11:22:50 2011 +0100
     1.2 +++ b/test/CMakeLists.txt	Thu Mar 17 18:12:57 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    bfs_test
    1.14 @@ -129,6 +133,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()