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
61 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
62 ADD_EXECUTABLE(lp_test lp_test.cc)
64 ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
67 SET(LP_TEST_LIBS lemon)
70 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
73 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${ILOG_LIBRARIES})
76 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
79 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${SOPLEX_LIBRARIES})
82 TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
83 ADD_TEST(lp_test lp_test)
84 ADD_DEPENDENCIES(check lp_test)
86 IF(WIN32 AND LEMON_HAVE_GLPK)
87 GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
88 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
89 ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
90 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
91 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
92 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
96 IF(WIN32 AND LEMON_HAVE_CPLEX)
97 GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
98 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
99 ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
100 COMMAND ${CMAKE_COMMAND} -E copy ${ILOG_CPLEX_DLL} ${TARGET_PATH}
106 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
107 ADD_EXECUTABLE(mip_test mip_test.cc)
109 ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
112 SET(MIP_TEST_LIBS lemon)
115 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
118 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${ILOG_LIBRARIES})
121 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
124 TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
125 ADD_TEST(mip_test mip_test)
126 ADD_DEPENDENCIES(check mip_test)
128 IF(WIN32 AND LEMON_HAVE_GLPK)
129 GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
130 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
131 ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
132 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
133 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
134 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
138 IF(WIN32 AND LEMON_HAVE_CPLEX)
139 GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
140 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
141 ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
142 COMMAND ${CMAKE_COMMAND} -E copy ${ILOG_CPLEX_DLL} ${TARGET_PATH}
147 FOREACH(TEST_NAME ${TESTS})
148 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
149 ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
151 ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
153 TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
154 IF(TEST_WITH_VALGRIND)
155 ADD_TEST(${TEST_NAME}
156 valgrind --error-exitcode=1 ${VALGRIND_FLAGS}
157 ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} )
159 ADD_TEST(${TEST_NAME} ${TEST_NAME})
161 ADD_DEPENDENCIES(check ${TEST_NAME})