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.")
28 fractional_matching_test
39 max_cardinality_search_test
41 min_cost_arborescence_test
44 nagamochi_ibaraki_test
56 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
57 ADD_EXECUTABLE(lp_test lp_test.cc)
59 ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
62 SET(LP_TEST_LIBS lemon)
65 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
68 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
71 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
74 TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
75 ADD_TEST(lp_test lp_test)
76 ADD_DEPENDENCIES(check lp_test)
78 IF(WIN32 AND LEMON_HAVE_GLPK)
79 GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
80 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
81 ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
82 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
83 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
84 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
88 IF(WIN32 AND LEMON_HAVE_CPLEX)
89 GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
90 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
91 ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
92 COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
98 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
99 ADD_EXECUTABLE(mip_test mip_test.cc)
101 ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
104 SET(MIP_TEST_LIBS lemon)
107 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
110 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
113 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
116 TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
117 ADD_TEST(mip_test mip_test)
118 ADD_DEPENDENCIES(check mip_test)
120 IF(WIN32 AND LEMON_HAVE_GLPK)
121 GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
122 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
123 ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
124 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
125 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
126 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
130 IF(WIN32 AND LEMON_HAVE_CPLEX)
131 GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
132 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
133 ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
134 COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
139 FOREACH(TEST_NAME ${TESTS})
140 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
141 ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
143 ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
145 TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
146 IF(TEST_WITH_VALGRIND)
147 ADD_TEST(${TEST_NAME}
148 valgrind --error-exitcode=1 ${VALGRIND_FLAGS}
149 ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} )
151 ADD_TEST(${TEST_NAME} ${TEST_NAME})
153 ADD_DEPENDENCIES(check ${TEST_NAME})