COIN-OR::LEMON - Graph Library

Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/CMakeLists.txt

    r679 r959  
    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
     
    2832  heap_test
    2933  kruskal_test
     34  lgf_test
    3035  maps_test
    3136  matching_test
     
    4247
    4348IF(LEMON_HAVE_LP)
    44   ADD_EXECUTABLE(lp_test lp_test.cc)
     49  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
     50    ADD_EXECUTABLE(lp_test lp_test.cc)
     51  ELSE()
     52    ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
     53  ENDIF()
     54
    4555  SET(LP_TEST_LIBS lemon)
    4656
     
    5767  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
    5868  ADD_TEST(lp_test lp_test)
     69  ADD_DEPENDENCIES(check lp_test)
    5970
    6071  IF(WIN32 AND LEMON_HAVE_GLPK)
     
    7889
    7990IF(LEMON_HAVE_MIP)
    80   ADD_EXECUTABLE(mip_test mip_test.cc)
     91  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
     92    ADD_EXECUTABLE(mip_test mip_test.cc)
     93  ELSE()
     94    ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
     95  ENDIF()
     96
    8197  SET(MIP_TEST_LIBS lemon)
    8298
     
    93109  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
    94110  ADD_TEST(mip_test mip_test)
     111  ADD_DEPENDENCIES(check mip_test)
    95112
    96113  IF(WIN32 AND LEMON_HAVE_GLPK)
     
    114131
    115132FOREACH(TEST_NAME ${TESTS})
    116   ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
     133  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
     134    ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
     135  ELSE()
     136    ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
     137  ENDIF()
    117138  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
    118   ADD_TEST(${TEST_NAME} ${TEST_NAME})
     139    IF(TEST_WITH_VALGRIND)
     140      ADD_TEST(${TEST_NAME}
     141        valgrind --error-exitcode=1 ${VALGRIND_FLAGS}
     142        ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} )
     143    ELSE()
     144      ADD_TEST(${TEST_NAME} ${TEST_NAME})
     145    ENDIF()
     146  ADD_DEPENDENCIES(check ${TEST_NAME})
    119147ENDFOREACH()
Note: See TracChangeset for help on using the changeset viewer.