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