[510] | 1 | INCLUDE_DIRECTORIES( |
---|
[549] | 2 | ${PROJECT_SOURCE_DIR} |
---|
[510] | 3 | ${PROJECT_BINARY_DIR} |
---|
| 4 | ) |
---|
[141] | 5 | |
---|
[679] | 6 | LINK_DIRECTORIES( |
---|
| 7 | ${PROJECT_BINARY_DIR}/lemon |
---|
| 8 | ) |
---|
[510] | 9 | |
---|
[933] | 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.") |
---|
[141] | 13 | |
---|
[225] | 14 | SET(TESTS |
---|
[488] | 15 | adaptors_test |
---|
[993] | 16 | arc_look_up_test |
---|
[698] | 17 | bellman_ford_test |
---|
[141] | 18 | bfs_test |
---|
[1018] | 19 | bpgraph_test |
---|
[424] | 20 | circulation_test |
---|
[649] | 21 | connectivity_test |
---|
[141] | 22 | counter_test |
---|
| 23 | dfs_test |
---|
| 24 | digraph_test |
---|
[170] | 25 | dijkstra_test |
---|
[141] | 26 | dim_test |
---|
[488] | 27 | edge_set_test |
---|
[141] | 28 | error_test |
---|
[522] | 29 | euler_test |
---|
[869] | 30 | fractional_matching_test |
---|
[543] | 31 | gomory_hu_test |
---|
[200] | 32 | graph_copy_test |
---|
[141] | 33 | graph_test |
---|
[171] | 34 | graph_utils_test |
---|
[410] | 35 | hao_orlin_test |
---|
[203] | 36 | heap_test |
---|
[141] | 37 | kruskal_test |
---|
[1030] | 38 | lgf_reader_writer_test |
---|
[949] | 39 | lgf_test |
---|
[141] | 40 | maps_test |
---|
[594] | 41 | matching_test |
---|
[916] | 42 | max_cardinality_search_test |
---|
[904] | 43 | max_clique_test |
---|
[1060] | 44 | max_flow_test |
---|
[501] | 45 | min_cost_arborescence_test |
---|
[601] | 46 | min_cost_flow_test |
---|
[763] | 47 | min_mean_cycle_test |
---|
[913] | 48 | nagamochi_ibaraki_test |
---|
[424] | 49 | path_test |
---|
[797] | 50 | planarity_test |
---|
[473] | 51 | radix_sort_test |
---|
[225] | 52 | random_test |
---|
[424] | 53 | suurballe_test |
---|
[141] | 54 | time_measure_test |
---|
[1035] | 55 | tsp_test |
---|
[679] | 56 | unionfind_test |
---|
[1141] | 57 | vf2_test |
---|
[679] | 58 | ) |
---|
[510] | 59 | |
---|
[627] | 60 | IF(LEMON_HAVE_LP) |
---|
[927] | 61 | IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") |
---|
| 62 | ADD_EXECUTABLE(lp_test lp_test.cc) |
---|
| 63 | ELSE() |
---|
| 64 | ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc) |
---|
| 65 | ENDIF() |
---|
| 66 | |
---|
[620] | 67 | SET(LP_TEST_LIBS lemon) |
---|
[679] | 68 | |
---|
[627] | 69 | IF(LEMON_HAVE_GLPK) |
---|
[620] | 70 | SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES}) |
---|
[679] | 71 | ENDIF() |
---|
[627] | 72 | IF(LEMON_HAVE_CPLEX) |
---|
[1062] | 73 | SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${ILOG_LIBRARIES}) |
---|
[679] | 74 | ENDIF() |
---|
[627] | 75 | IF(LEMON_HAVE_CLP) |
---|
[621] | 76 | SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES}) |
---|
[679] | 77 | ENDIF() |
---|
[1088] | 78 | IF(LEMON_HAVE_SOPLEX) |
---|
| 79 | SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${SOPLEX_LIBRARIES}) |
---|
| 80 | ENDIF() |
---|
[679] | 81 | |
---|
[620] | 82 | TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS}) |
---|
[473] | 83 | ADD_TEST(lp_test lp_test) |
---|
[945] | 84 | ADD_DEPENDENCIES(check lp_test) |
---|
[473] | 85 | |
---|
[627] | 86 | IF(WIN32 AND LEMON_HAVE_GLPK) |
---|
[473] | 87 | ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD |
---|
[1204] | 88 | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll $<TARGET_FILE_DIR:lp_test> |
---|
| 89 | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll $<TARGET_FILE_DIR:lp_test> |
---|
| 90 | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll $<TARGET_FILE_DIR:lp_test> |
---|
[473] | 91 | ) |
---|
[679] | 92 | ENDIF() |
---|
| 93 | |
---|
[627] | 94 | IF(WIN32 AND LEMON_HAVE_CPLEX) |
---|
[620] | 95 | GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION) |
---|
| 96 | GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) |
---|
| 97 | ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD |
---|
[1062] | 98 | COMMAND ${CMAKE_COMMAND} -E copy ${ILOG_CPLEX_DLL} ${TARGET_PATH} |
---|
[620] | 99 | ) |
---|
[679] | 100 | ENDIF() |
---|
| 101 | ENDIF() |
---|
[473] | 102 | |
---|
[627] | 103 | IF(LEMON_HAVE_MIP) |
---|
[927] | 104 | IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") |
---|
| 105 | ADD_EXECUTABLE(mip_test mip_test.cc) |
---|
| 106 | ELSE() |
---|
| 107 | ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc) |
---|
| 108 | ENDIF() |
---|
| 109 | |
---|
[620] | 110 | SET(MIP_TEST_LIBS lemon) |
---|
[679] | 111 | |
---|
[627] | 112 | IF(LEMON_HAVE_GLPK) |
---|
[620] | 113 | SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES}) |
---|
[679] | 114 | ENDIF() |
---|
[627] | 115 | IF(LEMON_HAVE_CPLEX) |
---|
[1062] | 116 | SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${ILOG_LIBRARIES}) |
---|
[679] | 117 | ENDIF() |
---|
[627] | 118 | IF(LEMON_HAVE_CBC) |
---|
[621] | 119 | SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES}) |
---|
[679] | 120 | ENDIF() |
---|
| 121 | |
---|
[620] | 122 | TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS}) |
---|
[473] | 123 | ADD_TEST(mip_test mip_test) |
---|
[945] | 124 | ADD_DEPENDENCIES(check mip_test) |
---|
[473] | 125 | |
---|
[627] | 126 | IF(WIN32 AND LEMON_HAVE_GLPK) |
---|
[473] | 127 | GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION) |
---|
| 128 | GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) |
---|
| 129 | ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD |
---|
[679] | 130 | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH} |
---|
| 131 | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH} |
---|
| 132 | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH} |
---|
[473] | 133 | ) |
---|
[679] | 134 | ENDIF() |
---|
| 135 | |
---|
[627] | 136 | IF(WIN32 AND LEMON_HAVE_CPLEX) |
---|
[620] | 137 | GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION) |
---|
| 138 | GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) |
---|
| 139 | ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD |
---|
[1062] | 140 | COMMAND ${CMAKE_COMMAND} -E copy ${ILOG_CPLEX_DLL} ${TARGET_PATH} |
---|
[620] | 141 | ) |
---|
[679] | 142 | ENDIF() |
---|
| 143 | ENDIF() |
---|
[141] | 144 | |
---|
[225] | 145 | FOREACH(TEST_NAME ${TESTS}) |
---|
[927] | 146 | IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") |
---|
| 147 | ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc) |
---|
| 148 | ELSE() |
---|
| 149 | ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc) |
---|
| 150 | ENDIF() |
---|
[225] | 151 | TARGET_LINK_LIBRARIES(${TEST_NAME} lemon) |
---|
[933] | 152 | IF(TEST_WITH_VALGRIND) |
---|
| 153 | ADD_TEST(${TEST_NAME} |
---|
| 154 | valgrind --error-exitcode=1 ${VALGRIND_FLAGS} |
---|
| 155 | ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} ) |
---|
| 156 | ELSE() |
---|
| 157 | ADD_TEST(${TEST_NAME} ${TEST_NAME}) |
---|
| 158 | ENDIF() |
---|
[927] | 159 | ADD_DEPENDENCIES(check ${TEST_NAME}) |
---|
[679] | 160 | ENDFOREACH() |
---|