[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 |
---|
[949] | 38 | lgf_test |
---|
[141] | 39 | maps_test |
---|
[594] | 40 | matching_test |
---|
[916] | 41 | max_cardinality_search_test |
---|
[904] | 42 | max_clique_test |
---|
[501] | 43 | min_cost_arborescence_test |
---|
[601] | 44 | min_cost_flow_test |
---|
[763] | 45 | min_mean_cycle_test |
---|
[913] | 46 | nagamochi_ibaraki_test |
---|
[424] | 47 | path_test |
---|
[797] | 48 | planarity_test |
---|
[424] | 49 | preflow_test |
---|
[473] | 50 | radix_sort_test |
---|
[225] | 51 | random_test |
---|
[424] | 52 | suurballe_test |
---|
[141] | 53 | time_measure_test |
---|
[679] | 54 | unionfind_test |
---|
| 55 | ) |
---|
[510] | 56 | |
---|
[627] | 57 | IF(LEMON_HAVE_LP) |
---|
[927] | 58 | IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") |
---|
| 59 | ADD_EXECUTABLE(lp_test lp_test.cc) |
---|
| 60 | ELSE() |
---|
| 61 | ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc) |
---|
| 62 | ENDIF() |
---|
| 63 | |
---|
[620] | 64 | SET(LP_TEST_LIBS lemon) |
---|
[679] | 65 | |
---|
[627] | 66 | IF(LEMON_HAVE_GLPK) |
---|
[620] | 67 | SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES}) |
---|
[679] | 68 | ENDIF() |
---|
[627] | 69 | IF(LEMON_HAVE_CPLEX) |
---|
[620] | 70 | SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES}) |
---|
[679] | 71 | ENDIF() |
---|
[627] | 72 | IF(LEMON_HAVE_CLP) |
---|
[621] | 73 | SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES}) |
---|
[679] | 74 | ENDIF() |
---|
| 75 | |
---|
[620] | 76 | TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS}) |
---|
[473] | 77 | ADD_TEST(lp_test lp_test) |
---|
[945] | 78 | ADD_DEPENDENCIES(check lp_test) |
---|
[473] | 79 | |
---|
[627] | 80 | IF(WIN32 AND LEMON_HAVE_GLPK) |
---|
[473] | 81 | GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION) |
---|
| 82 | GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) |
---|
| 83 | ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD |
---|
[679] | 84 | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH} |
---|
| 85 | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH} |
---|
| 86 | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH} |
---|
[473] | 87 | ) |
---|
[679] | 88 | ENDIF() |
---|
| 89 | |
---|
[627] | 90 | IF(WIN32 AND LEMON_HAVE_CPLEX) |
---|
[620] | 91 | GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION) |
---|
| 92 | GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) |
---|
| 93 | ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD |
---|
[972] | 94 | COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH} |
---|
[620] | 95 | ) |
---|
[679] | 96 | ENDIF() |
---|
| 97 | ENDIF() |
---|
[473] | 98 | |
---|
[627] | 99 | IF(LEMON_HAVE_MIP) |
---|
[927] | 100 | IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") |
---|
| 101 | ADD_EXECUTABLE(mip_test mip_test.cc) |
---|
| 102 | ELSE() |
---|
| 103 | ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc) |
---|
| 104 | ENDIF() |
---|
| 105 | |
---|
[620] | 106 | SET(MIP_TEST_LIBS lemon) |
---|
[679] | 107 | |
---|
[627] | 108 | IF(LEMON_HAVE_GLPK) |
---|
[620] | 109 | SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES}) |
---|
[679] | 110 | ENDIF() |
---|
[627] | 111 | IF(LEMON_HAVE_CPLEX) |
---|
[620] | 112 | SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES}) |
---|
[679] | 113 | ENDIF() |
---|
[627] | 114 | IF(LEMON_HAVE_CBC) |
---|
[621] | 115 | SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES}) |
---|
[679] | 116 | ENDIF() |
---|
| 117 | |
---|
[620] | 118 | TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS}) |
---|
[473] | 119 | ADD_TEST(mip_test mip_test) |
---|
[945] | 120 | ADD_DEPENDENCIES(check mip_test) |
---|
[473] | 121 | |
---|
[627] | 122 | IF(WIN32 AND LEMON_HAVE_GLPK) |
---|
[473] | 123 | GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION) |
---|
| 124 | GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) |
---|
| 125 | ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD |
---|
[679] | 126 | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH} |
---|
| 127 | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH} |
---|
| 128 | COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH} |
---|
[473] | 129 | ) |
---|
[679] | 130 | ENDIF() |
---|
| 131 | |
---|
[627] | 132 | IF(WIN32 AND LEMON_HAVE_CPLEX) |
---|
[620] | 133 | GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION) |
---|
| 134 | GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH) |
---|
| 135 | ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD |
---|
[972] | 136 | COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH} |
---|
[620] | 137 | ) |
---|
[679] | 138 | ENDIF() |
---|
| 139 | ENDIF() |
---|
[141] | 140 | |
---|
[225] | 141 | FOREACH(TEST_NAME ${TESTS}) |
---|
[927] | 142 | IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer") |
---|
| 143 | ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc) |
---|
| 144 | ELSE() |
---|
| 145 | ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc) |
---|
| 146 | ENDIF() |
---|
[225] | 147 | TARGET_LINK_LIBRARIES(${TEST_NAME} lemon) |
---|
[933] | 148 | IF(TEST_WITH_VALGRIND) |
---|
| 149 | ADD_TEST(${TEST_NAME} |
---|
| 150 | valgrind --error-exitcode=1 ${VALGRIND_FLAGS} |
---|
| 151 | ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} ) |
---|
| 152 | ELSE() |
---|
| 153 | ADD_TEST(${TEST_NAME} ${TEST_NAME}) |
---|
| 154 | ENDIF() |
---|
[927] | 155 | ADD_DEPENDENCIES(check ${TEST_NAME}) |
---|
[679] | 156 | ENDFOREACH() |
---|