[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 | ) |
---|
[141] | 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.") |
---|
[510] | 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 |
---|
[1056] | 28 | edmonds_karp_test |
---|
[141] | 29 | error_test |
---|
[522] | 30 | euler_test |
---|
[869] | 31 | fractional_matching_test |
---|
[543] | 32 | gomory_hu_test |
---|
[200] | 33 | graph_copy_test |
---|
[141] | 34 | graph_test |
---|
[171] | 35 | graph_utils_test |
---|
[410] | 36 | hao_orlin_test |
---|
[203] | 37 | heap_test |
---|
[141] | 38 | kruskal_test |
---|
[1030] | 39 | lgf_reader_writer_test |
---|
[949] | 40 | lgf_test |
---|
[141] | 41 | maps_test |
---|
[594] | 42 | matching_test |
---|
[916] | 43 | max_cardinality_search_test |
---|
[904] | 44 | max_clique_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 |
---|
[424] | 51 | preflow_test |
---|
[473] | 52 | radix_sort_test |
---|
[225] | 53 | random_test |
---|
[424] | 54 | suurballe_test |
---|
[141] | 55 | time_measure_test |
---|
[1035] | 56 | tsp_test |
---|
[679] | 57 | unionfind_test |
---|
| 58 | ) |
---|
[141] | 59 | |
---|
[627] | 60 | IF(LEMON_HAVE_LP) |
---|
[909] | 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) |
---|
[620] | 73 | SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_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() |
---|
| 78 | |
---|
[620] | 79 | TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS}) |
---|
[473] | 80 | ADD_TEST(lp_test lp_test) |
---|
[945] | 81 | ADD_DEPENDENCIES(check lp_test) |
---|
[473] | 82 | |
---|
[627] | 83 | IF(WIN32 AND LEMON_HAVE_GLPK) |
---|
[473] | 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 |
---|
[679] | 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} |
---|
[473] | 90 | ) |
---|
[679] | 91 | ENDIF() |
---|
| 92 | |
---|
[627] | 93 | IF(WIN32 AND LEMON_HAVE_CPLEX) |
---|
[620] | 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 |
---|
[972] | 97 | COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH} |
---|
[620] | 98 | ) |
---|
[679] | 99 | ENDIF() |
---|
| 100 | ENDIF() |
---|
[473] | 101 | |
---|
[627] | 102 | IF(LEMON_HAVE_MIP) |
---|
[909] | 103 | IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") |
---|
| 104 | ADD_EXECUTABLE(mip_test mip_test.cc) |
---|
| 105 | ELSE() |
---|
| 106 | ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc) |
---|
| 107 | ENDIF() |
---|
| 108 | |
---|
[620] | 109 | SET(MIP_TEST_LIBS lemon) |
---|
[679] | 110 | |
---|
[627] | 111 | IF(LEMON_HAVE_GLPK) |
---|
[620] | 112 | SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES}) |
---|
[679] | 113 | ENDIF() |
---|
[627] | 114 | IF(LEMON_HAVE_CPLEX) |
---|
[620] | 115 | SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES}) |
---|
[679] | 116 | ENDIF() |
---|
[627] | 117 | IF(LEMON_HAVE_CBC) |
---|
[621] | 118 | SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES}) |
---|
[679] | 119 | ENDIF() |
---|
| 120 | |
---|
[620] | 121 | TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS}) |
---|
[473] | 122 | ADD_TEST(mip_test mip_test) |
---|
[945] | 123 | ADD_DEPENDENCIES(check mip_test) |
---|
[473] | 124 | |
---|
[627] | 125 | IF(WIN32 AND LEMON_HAVE_GLPK) |
---|
[473] | 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 |
---|
[679] | 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} |
---|
[473] | 132 | ) |
---|
[679] | 133 | ENDIF() |
---|
| 134 | |
---|
[627] | 135 | IF(WIN32 AND LEMON_HAVE_CPLEX) |
---|
[620] | 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 |
---|
[972] | 139 | COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH} |
---|
[620] | 140 | ) |
---|
[679] | 141 | ENDIF() |
---|
| 142 | ENDIF() |
---|
[473] | 143 | |
---|
[225] | 144 | FOREACH(TEST_NAME ${TESTS}) |
---|
[901] | 145 | IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") |
---|
| 146 | ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc) |
---|
| 147 | ELSE() |
---|
| 148 | ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc) |
---|
| 149 | ENDIF() |
---|
[225] | 150 | TARGET_LINK_LIBRARIES(${TEST_NAME} lemon) |
---|
[933] | 151 | IF(TEST_WITH_VALGRIND) |
---|
| 152 | ADD_TEST(${TEST_NAME} |
---|
| 153 | valgrind --error-exitcode=1 ${VALGRIND_FLAGS} |
---|
| 154 | ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} ) |
---|
| 155 | ELSE() |
---|
| 156 | ADD_TEST(${TEST_NAME} ${TEST_NAME}) |
---|
| 157 | ENDIF() |
---|
[897] | 158 | ADD_DEPENDENCIES(check ${TEST_NAME}) |
---|
[679] | 159 | ENDFOREACH() |
---|