test/CMakeLists.txt
author Peter Kovacs <kpeter@inf.elte.hu>
Thu, 28 Feb 2013 18:17:53 +0100
changeset 1057 6a8a688eacf6
parent 1038 a2d142bb5d3c
child 1060 45befc97b1bc
permissions -rw-r--r--
Improve and fix API doc of EdmondsKarp according to Preflow (#177)
ladanyi@499
     1
INCLUDE_DIRECTORIES(
ladanyi@549
     2
  ${PROJECT_SOURCE_DIR}
ladanyi@499
     3
  ${PROJECT_BINARY_DIR}
ladanyi@499
     4
)
ladanyi@141
     5
ladanyi@679
     6
LINK_DIRECTORIES(
ladanyi@679
     7
  ${PROJECT_BINARY_DIR}/lemon
ladanyi@679
     8
)
ladanyi@141
     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@499
    13
alpar@225
    14
SET(TESTS
deba@512
    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@512
    27
  edge_set_test
thoneyvazul@1056
    28
  edmonds_karp_test
ladanyi@141
    29
  error_test
ladanyi@522
    30
  euler_test
deba@869
    31
  fractional_matching_test
tapolcai@543
    32
  gomory_hu_test
deba@200
    33
  graph_copy_test
ladanyi@141
    34
  graph_test
kpeter@171
    35
  graph_utils_test
deba@410
    36
  hao_orlin_test
deba@203
    37
  heap_test
ladanyi@141
    38
  kruskal_test
deba@1030
    39
  lgf_reader_writer_test
alpar@949
    40
  lgf_test
ladanyi@141
    41
  maps_test
kpeter@594
    42
  matching_test
thoneyvazul@916
    43
  max_cardinality_search_test
kpeter@904
    44
  max_clique_test
deba@490
    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
alpar@424
    51
  preflow_test
ladanyi@473
    52
  radix_sort_test
alpar@225
    53
  random_test
alpar@424
    54
  suurballe_test
ladanyi@141
    55
  time_measure_test
kpeter@1035
    56
  tsp_test
ladanyi@679
    57
  unionfind_test
ladanyi@679
    58
)
ladanyi@141
    59
ladanyi@627
    60
IF(LEMON_HAVE_LP)
alpar@909
    61
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
alpar@909
    62
    ADD_EXECUTABLE(lp_test lp_test.cc)
alpar@909
    63
  ELSE()
alpar@909
    64
    ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
alpar@909
    65
  ENDIF()
alpar@909
    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)
ladanyi@620
    73
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_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()
ladanyi@679
    78
ladanyi@620
    79
  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
ladanyi@473
    80
  ADD_TEST(lp_test lp_test)
alpar@945
    81
  ADD_DEPENDENCIES(check lp_test)
ladanyi@473
    82
ladanyi@627
    83
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@473
    84
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@473
    85
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@473
    86
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@679
    87
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@679
    88
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@679
    89
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@473
    90
    )
ladanyi@679
    91
  ENDIF()
ladanyi@679
    92
ladanyi@627
    93
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@620
    94
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@620
    95
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@620
    96
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
alpar@972
    97
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
ladanyi@620
    98
    )
ladanyi@679
    99
  ENDIF()
ladanyi@679
   100
ENDIF()
ladanyi@473
   101
ladanyi@627
   102
IF(LEMON_HAVE_MIP)
alpar@909
   103
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
alpar@909
   104
    ADD_EXECUTABLE(mip_test mip_test.cc)
alpar@909
   105
  ELSE()
alpar@909
   106
    ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
alpar@909
   107
  ENDIF()
alpar@909
   108
ladanyi@620
   109
  SET(MIP_TEST_LIBS lemon)
ladanyi@679
   110
ladanyi@627
   111
  IF(LEMON_HAVE_GLPK)
ladanyi@620
   112
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@679
   113
  ENDIF()
ladanyi@627
   114
  IF(LEMON_HAVE_CPLEX)
ladanyi@620
   115
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@679
   116
  ENDIF()
ladanyi@627
   117
  IF(LEMON_HAVE_CBC)
ladanyi@621
   118
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
ladanyi@679
   119
  ENDIF()
ladanyi@679
   120
ladanyi@620
   121
  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
ladanyi@473
   122
  ADD_TEST(mip_test mip_test)
alpar@945
   123
  ADD_DEPENDENCIES(check mip_test)
ladanyi@473
   124
ladanyi@627
   125
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@473
   126
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@473
   127
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@473
   128
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@679
   129
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@679
   130
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@679
   131
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@473
   132
    )
ladanyi@679
   133
  ENDIF()
ladanyi@679
   134
ladanyi@627
   135
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@620
   136
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@620
   137
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@620
   138
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
alpar@972
   139
      COMMAND ${CMAKE_COMMAND} -E copy ${CPLEX_BIN_DIR}/cplex.dll ${TARGET_PATH}
ladanyi@620
   140
    )
ladanyi@679
   141
  ENDIF()
ladanyi@679
   142
ENDIF()
ladanyi@473
   143
alpar@225
   144
FOREACH(TEST_NAME ${TESTS})
alpar@901
   145
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
alpar@901
   146
    ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
alpar@901
   147
  ELSE()
alpar@901
   148
    ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
alpar@901
   149
  ENDIF()
alpar@225
   150
  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
alpar@933
   151
    IF(TEST_WITH_VALGRIND)
alpar@933
   152
      ADD_TEST(${TEST_NAME}
alpar@933
   153
        valgrind --error-exitcode=1 ${VALGRIND_FLAGS}
alpar@933
   154
        ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} )
alpar@933
   155
    ELSE()
alpar@933
   156
      ADD_TEST(${TEST_NAME} ${TEST_NAME})
alpar@933
   157
    ENDIF()
ladanyi@897
   158
  ADD_DEPENDENCIES(check ${TEST_NAME})
ladanyi@679
   159
ENDFOREACH()