test/CMakeLists.txt
author Peter Madarasi <madarasip@caesar.elte.hu>
Tue, 19 Sep 2017 14:08:20 +0200
changeset 1405 3feba0ea1bda
parent 1350 a037254714b3
child 1406 120b9031eada
permissions -rw-r--r--
Vf2 improvements and Vf2pp implementation (#597)
ladanyi@539
     1
INCLUDE_DIRECTORIES(
ladanyi@596
     2
  ${PROJECT_SOURCE_DIR}
ladanyi@539
     3
  ${PROJECT_BINARY_DIR}
ladanyi@539
     4
)
ladanyi@141
     5
ladanyi@726
     6
LINK_DIRECTORIES(
ladanyi@726
     7
  ${PROJECT_BINARY_DIR}/lemon
ladanyi@726
     8
)
ladanyi@539
     9
alpar@1044
    10
SET(TEST_WITH_VALGRIND "NO" CACHE STRING
alpar@1044
    11
  "Run the test with valgrind (YES/NO).")
alpar@1044
    12
SET(VALGRIND_FLAGS "" CACHE STRING "Valgrind flags used by the tests.")
ladanyi@141
    13
alpar@225
    14
SET(TESTS
deba@559
    15
  adaptors_test
alpar@1149
    16
  arc_look_up_test
kpeter@745
    17
  bellman_ford_test
ladanyi@141
    18
  bfs_test
deba@1186
    19
  bpgraph_test
alpar@443
    20
  circulation_test
kpeter@696
    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@559
    27
  edge_set_test
ladanyi@141
    28
  error_test
ladanyi@569
    29
  euler_test
deba@948
    30
  fractional_matching_test
tapolcai@590
    31
  gomory_hu_test
deba@200
    32
  graph_copy_test
ladanyi@141
    33
  graph_test
kpeter@171
    34
  graph_utils_test
deba@426
    35
  hao_orlin_test
deba@203
    36
  heap_test
ladanyi@141
    37
  kruskal_test
deba@1198
    38
  lgf_reader_writer_test
alpar@1067
    39
  lgf_test
ladanyi@141
    40
  maps_test
kpeter@641
    41
  matching_test
thoneyvazul@1020
    42
  max_cardinality_search_test
kpeter@999
    43
  max_clique_test
kpeter@1228
    44
  max_flow_test
deba@522
    45
  min_cost_arborescence_test
kpeter@648
    46
  min_cost_flow_test
kpeter@810
    47
  min_mean_cycle_test
deba@1017
    48
  nagamochi_ibaraki_test
alpar@443
    49
  path_test
deba@861
    50
  planarity_test
ladanyi@496
    51
  radix_sort_test
alpar@225
    52
  random_test
alpar@443
    53
  suurballe_test
ladanyi@141
    54
  time_measure_test
kpeter@1203
    55
  tsp_test
ladanyi@726
    56
  unionfind_test
madarasip@1350
    57
  vf2_test
madarasip@1405
    58
  vf2pp_test
ladanyi@726
    59
)
ladanyi@539
    60
ladanyi@674
    61
IF(LEMON_HAVE_LP)
alpar@1033
    62
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
alpar@1033
    63
    ADD_EXECUTABLE(lp_test lp_test.cc)
alpar@1033
    64
  ELSE()
alpar@1033
    65
    ADD_EXECUTABLE(lp_test EXCLUDE_FROM_ALL lp_test.cc)
alpar@1033
    66
  ENDIF()
alpar@1033
    67
ladanyi@667
    68
  SET(LP_TEST_LIBS lemon)
ladanyi@726
    69
ladanyi@674
    70
  IF(LEMON_HAVE_GLPK)
ladanyi@667
    71
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@726
    72
  ENDIF()
ladanyi@674
    73
  IF(LEMON_HAVE_CPLEX)
alpar@1230
    74
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${ILOG_LIBRARIES})
ladanyi@726
    75
  ENDIF()
ladanyi@674
    76
  IF(LEMON_HAVE_CLP)
ladanyi@668
    77
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
ladanyi@726
    78
  ENDIF()
alpar@1264
    79
  IF(LEMON_HAVE_SOPLEX)
alpar@1264
    80
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${SOPLEX_LIBRARIES})
alpar@1264
    81
  ENDIF()
ladanyi@726
    82
ladanyi@667
    83
  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
ladanyi@496
    84
  ADD_TEST(lp_test lp_test)
alpar@1061
    85
  ADD_DEPENDENCIES(check lp_test)
ladanyi@496
    86
ladanyi@674
    87
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@496
    88
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@496
    89
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@496
    90
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@726
    91
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@726
    92
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@726
    93
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@496
    94
    )
ladanyi@726
    95
  ENDIF()
ladanyi@726
    96
ladanyi@674
    97
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@667
    98
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@667
    99
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@667
   100
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
alpar@1230
   101
      COMMAND ${CMAKE_COMMAND} -E copy ${ILOG_CPLEX_DLL} ${TARGET_PATH}
ladanyi@667
   102
    )
ladanyi@726
   103
  ENDIF()
ladanyi@726
   104
ENDIF()
ladanyi@496
   105
ladanyi@674
   106
IF(LEMON_HAVE_MIP)
alpar@1033
   107
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
alpar@1033
   108
    ADD_EXECUTABLE(mip_test mip_test.cc)
alpar@1033
   109
  ELSE()
alpar@1033
   110
    ADD_EXECUTABLE(mip_test EXCLUDE_FROM_ALL mip_test.cc)
alpar@1033
   111
  ENDIF()
alpar@1033
   112
ladanyi@667
   113
  SET(MIP_TEST_LIBS lemon)
ladanyi@726
   114
ladanyi@674
   115
  IF(LEMON_HAVE_GLPK)
ladanyi@667
   116
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@726
   117
  ENDIF()
ladanyi@674
   118
  IF(LEMON_HAVE_CPLEX)
alpar@1230
   119
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${ILOG_LIBRARIES})
ladanyi@726
   120
  ENDIF()
ladanyi@674
   121
  IF(LEMON_HAVE_CBC)
ladanyi@668
   122
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
ladanyi@726
   123
  ENDIF()
ladanyi@726
   124
ladanyi@667
   125
  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
ladanyi@496
   126
  ADD_TEST(mip_test mip_test)
alpar@1061
   127
  ADD_DEPENDENCIES(check mip_test)
ladanyi@496
   128
ladanyi@674
   129
  IF(WIN32 AND LEMON_HAVE_GLPK)
ladanyi@496
   130
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@496
   131
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@496
   132
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@726
   133
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@726
   134
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@726
   135
      COMMAND ${CMAKE_COMMAND} -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@496
   136
    )
ladanyi@726
   137
  ENDIF()
ladanyi@726
   138
ladanyi@674
   139
  IF(WIN32 AND LEMON_HAVE_CPLEX)
ladanyi@667
   140
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@667
   141
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@667
   142
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
alpar@1230
   143
      COMMAND ${CMAKE_COMMAND} -E copy ${ILOG_CPLEX_DLL} ${TARGET_PATH}
ladanyi@667
   144
    )
ladanyi@726
   145
  ENDIF()
ladanyi@726
   146
ENDIF()
ladanyi@141
   147
alpar@225
   148
FOREACH(TEST_NAME ${TESTS})
alpar@1033
   149
  IF(${CMAKE_BUILD_TYPE} STREQUAL "Maintainer")
alpar@1033
   150
    ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
alpar@1033
   151
  ELSE()
alpar@1033
   152
    ADD_EXECUTABLE(${TEST_NAME} EXCLUDE_FROM_ALL ${TEST_NAME}.cc)
alpar@1033
   153
  ENDIF()
alpar@225
   154
  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
alpar@1044
   155
    IF(TEST_WITH_VALGRIND)
alpar@1044
   156
      ADD_TEST(${TEST_NAME}
alpar@1044
   157
        valgrind --error-exitcode=1 ${VALGRIND_FLAGS}
alpar@1044
   158
        ${CMAKE_CURRENT_BINARY_DIR}/${TEST_NAME} )
alpar@1044
   159
    ELSE()
alpar@1044
   160
      ADD_TEST(${TEST_NAME} ${TEST_NAME})
alpar@1044
   161
    ENDIF()
alpar@1033
   162
  ADD_DEPENDENCIES(check ${TEST_NAME})
ladanyi@726
   163
ENDFOREACH()