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.")
31 fractional_matching_test
39 lgf_reader_writer_test
43 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} ${CPLEX_LIBRARIES})
76 SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
79 TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
80 ADD_TEST(lp_test lp_test)
81 ADD_DEPENDENCIES(check lp_test)
83 IF(WIN32 AND LEMON_HAVE_GLPK)
84 GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
85 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
86 ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
87 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
88 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
89 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
93 IF(WIN32 AND LEMON_HAVE_CPLEX)
94 GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
95 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
96 ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
97 COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
103 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
104 ADD_EXECUTABLE(mip_test mip_test.cc)
106 ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
109 SET(MIP_TEST_LIBS lemon)
112 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
115 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
118 SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
121 TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
122 ADD_TEST(mip_test mip_test)
123 ADD_DEPENDENCIES(check mip_test)
125 IF(WIN32 AND LEMON_HAVE_GLPK)
126 GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
127 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
128 ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
129 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
130 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
131 COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
135 IF(WIN32 AND LEMON_HAVE_CPLEX)
136 GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
137 GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
138 ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
139 COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
144 FOREACH(TEST_NAME ${TESTS})
145 IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
146 ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
148 ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
150 TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
151 IF(TEST_WITH_VALGRIND)
152 ADD_TEST(${TEST_NAME}
153 valgrind --error-exitcode=1 ${VALGRIND_FLAGS}
154 ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} )
156 ADD_TEST(${TEST_NAME} ${TEST_NAME})
158 ADD_DEPENDENCIES(check ${TEST_NAME})