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