COIN-OR::LEMON - Graph Library

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/CMakeLists.txt

    r679 r933  
    77  ${PROJECT_BINARY_DIR}/lemon
    88)
     9
     10SET(TEST_WITH_VALGRIND "NO" CACHE STRING
     11  "Run the test with valgrind (YES/NO).")
     12SET(VALGRIND_FLAGS "" CACHE STRING "Valgrind flags used by the tests.")
    913
    1014SET(TESTS
     
    4246
    4347IF(LEMON_HAVE_LP)
    44   ADD_EXECUTABLE(lp_test lp_test.cc)
     48  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
     49    ADD_EXECUTABLE(lp_test lp_test.cc)
     50  ELSE()
     51    ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
     52  ENDIF()
     53
    4554  SET(LP_TEST_LIBS lemon)
    4655
     
    7887
    7988IF(LEMON_HAVE_MIP)
    80   ADD_EXECUTABLE(mip_test mip_test.cc)
     89  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
     90    ADD_EXECUTABLE(mip_test mip_test.cc)
     91  ELSE()
     92    ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
     93  ENDIF()
     94
    8195  SET(MIP_TEST_LIBS lemon)
    8296
     
    114128
    115129FOREACH(TEST_NAME ${TESTS})
    116   ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
     130  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
     131    ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
     132  ELSE()
     133    ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
     134  ENDIF()
    117135  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
    118   ADD_TEST(${TEST_NAME} ${TEST_NAME})
     136    IF(TEST_WITH_VALGRIND)
     137      ADD_TEST(${TEST_NAME}
     138        valgrind --error-exitcode=1 ${VALGRIND_FLAGS}
     139        ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} )
     140    ELSE()
     141      ADD_TEST(${TEST_NAME} ${TEST_NAME})
     142    ENDIF()
     143  ADD_DEPENDENCIES(check ${TEST_NAME})
    119144ENDFOREACH()
Note: See TracChangeset for help on using the changeset viewer.