7 ${PROJECT_BINARY_DIR}/lemon
10 SET(TEST_WITH_VALGRIND "NO" CACHE STRING
11 "Run the test with valgrind (YES/NO).")
12 SET(VALGRIND_FLAGS "" CACHE STRING "Valgrind flags used by the tests.")
30 fractional_matching_test
38 lgf_reader_writer_test
42 max_cardinality_search_test
45 min_cost_arborescence_test
48 nagamochi_ibaraki_test
60 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
61 ADD_EXECUTABLE(lp_test lp_test.cc)
63 ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
66 SET(LP_TEST_LIBS lemon)
69 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
72 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${ILOG_LIBRARIES})
75 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
78 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${SOPLEX_LIBRARIES})
81 TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
82 ADD_TEST(lp_test lp_test)
83 ADD_DEPENDENCIES(check lp_test)
85 IF(WIN32 AND LEMON_HAVE_GLPK)
86 GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
87 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
88 ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
89 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
90 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
91 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
95 IF(WIN32 AND LEMON_HAVE_CPLEX)
96 GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
97 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
98 ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
99 COMMAND ${CMAKE_COMMAND} -E copy ${ILOG_CPLEX_DLL} ${TARGET_PATH}
105 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
106 ADD_EXECUTABLE(mip_test mip_test.cc)
108 ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
111 SET(MIP_TEST_LIBS lemon)
114 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
117 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${ILOG_LIBRARIES})
120 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
123 TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
124 ADD_TEST(mip_test mip_test)
125 ADD_DEPENDENCIES(check mip_test)
127 IF(WIN32 AND LEMON_HAVE_GLPK)
128 GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
129 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
130 ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
131 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
132 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
133 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
137 IF(WIN32 AND LEMON_HAVE_CPLEX)
138 GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
139 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
140 ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
141 COMMAND ${CMAKE_COMMAND} -E copy ${ILOG_CPLEX_DLL} ${TARGET_PATH}
146 FOREACH(TEST_NAME ${TESTS})
147 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
148 ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
150 ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
152 TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
153 IF(TEST_WITH_VALGRIND)
154 ADD_TEST(${TEST_NAME}
155 valgrind --error-exitcode=1 ${VALGRIND_FLAGS}
156 ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} )
158 ADD_TEST(${TEST_NAME} ${TEST_NAME})
160 ADD_DEPENDENCIES(check ${TEST_NAME})