test/CMakeLists.txt
author Peter Kovacs <kpeter@inf.elte.hu>
Wed, 29 Apr 2009 16:54:27 +0200
changeset 689 111698359429
parent 667 c3ce597c11ae
child 674 20dac2104519
permissions -rw-r--r--
Less map copying in NetworkSimplex (#234)

- The graph is copied in the constructor instead of the init() function.
It must not be modified after the class is constructed.
- The maps are copied once (instead of twice).
- Remove FlowMap, PotentialMap typedefs and flowMap(), pontentialMap()
setter functions.
- flowMap() and potentialMap() query functions copy the values into the
given map (reference) instead of returning a const reference to a
previously constructed map.
ladanyi@496
     1
INCLUDE_DIRECTORIES(
ladanyi@596
     2
  ${PROJECT_SOURCE_DIR}
ladanyi@596
     3
  ${PROJECT_BINARY_DIR}
ladanyi@496
     4
)
deba@426
     5
ladanyi@596
     6
LINK_DIRECTORIES(${PROJECT_BINARY_DIR}/lemon)
ladanyi@141
     7
alpar@225
     8
SET(TESTS
deba@559
     9
  adaptors_test
ladanyi@141
    10
  bfs_test
alpar@443
    11
  circulation_test
ladanyi@141
    12
  counter_test
ladanyi@141
    13
  dfs_test
ladanyi@141
    14
  digraph_test
kpeter@170
    15
  dijkstra_test
ladanyi@141
    16
  dim_test
deba@559
    17
  edge_set_test
ladanyi@141
    18
  error_test
ladanyi@569
    19
  euler_test
tapolcai@590
    20
  gomory_hu_test
deba@200
    21
  graph_copy_test
ladanyi@141
    22
  graph_test
kpeter@171
    23
  graph_utils_test
deba@426
    24
  hao_orlin_test
deba@203
    25
  heap_test
ladanyi@141
    26
  kruskal_test
ladanyi@141
    27
  maps_test
kpeter@641
    28
  matching_test
deba@522
    29
  min_cost_arborescence_test
kpeter@648
    30
  min_cost_flow_test
alpar@443
    31
  path_test
alpar@443
    32
  preflow_test
ladanyi@496
    33
  radix_sort_test
alpar@225
    34
  random_test
alpar@443
    35
  suurballe_test
ladanyi@141
    36
  time_measure_test
ladanyi@141
    37
  unionfind_test)
ladanyi@141
    38
ladanyi@496
    39
IF(HAVE_LP)
ladanyi@496
    40
  ADD_EXECUTABLE(lp_test lp_test.cc)
ladanyi@667
    41
  SET(LP_TEST_LIBS lemon)
ladanyi@498
    42
  IF(HAVE_GLPK)
ladanyi@667
    43
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@498
    44
  ENDIF(HAVE_GLPK)
ladanyi@667
    45
  IF(HAVE_CPLEX)
ladanyi@667
    46
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@667
    47
  ENDIF(HAVE_CPLEX)
ladanyi@668
    48
  IF(HAVE_CLP)
ladanyi@668
    49
    SET(LP_TEST_LIBS ${LP_TEST_LIBS} ${COIN_CLP_LIBRARIES})
ladanyi@668
    50
  ENDIF(HAVE_CLP)
ladanyi@667
    51
  TARGET_LINK_LIBRARIES(lp_test ${LP_TEST_LIBS})
ladanyi@496
    52
  ADD_TEST(lp_test lp_test)
ladanyi@496
    53
ladanyi@498
    54
  IF(WIN32 AND HAVE_GLPK)
ladanyi@496
    55
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@496
    56
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@496
    57
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@496
    58
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@496
    59
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@496
    60
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@496
    61
    )
ladanyi@498
    62
  ENDIF(WIN32 AND HAVE_GLPK)
ladanyi@667
    63
  IF(WIN32 AND HAVE_CPLEX)
ladanyi@667
    64
    GET_TARGET_PROPERTY(TARGET_LOC lp_test LOCATION)
ladanyi@667
    65
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@667
    66
    ADD_CUSTOM_COMMAND(TARGET lp_test POST_BUILD
ladanyi@667
    67
      COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@667
    68
    )
ladanyi@667
    69
  ENDIF(WIN32 AND HAVE_CPLEX)
ladanyi@496
    70
ENDIF(HAVE_LP)
ladanyi@496
    71
ladanyi@496
    72
IF(HAVE_MIP)
ladanyi@496
    73
  ADD_EXECUTABLE(mip_test mip_test.cc)
ladanyi@667
    74
  SET(MIP_TEST_LIBS lemon)
ladanyi@498
    75
  IF(HAVE_GLPK)
ladanyi@667
    76
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${GLPK_LIBRARIES})
ladanyi@498
    77
  ENDIF(HAVE_GLPK)
ladanyi@667
    78
  IF(HAVE_CPLEX)
ladanyi@667
    79
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${CPLEX_LIBRARIES})
ladanyi@667
    80
  ENDIF(HAVE_CPLEX)
ladanyi@668
    81
  IF(HAVE_CBC)
ladanyi@668
    82
    SET(MIP_TEST_LIBS ${MIP_TEST_LIBS} ${COIN_CBC_LIBRARIES})
ladanyi@668
    83
  ENDIF(HAVE_CBC)
ladanyi@667
    84
  TARGET_LINK_LIBRARIES(mip_test ${MIP_TEST_LIBS})
ladanyi@496
    85
  ADD_TEST(mip_test mip_test)
ladanyi@496
    86
ladanyi@498
    87
  IF(WIN32 AND HAVE_GLPK)
ladanyi@496
    88
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@496
    89
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@496
    90
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@496
    91
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/glpk.dll ${TARGET_PATH}
ladanyi@496
    92
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/libltdl3.dll ${TARGET_PATH}
ladanyi@496
    93
      COMMAND cmake -E copy ${GLPK_BIN_DIR}/zlib1.dll ${TARGET_PATH}
ladanyi@496
    94
    )
ladanyi@498
    95
  ENDIF(WIN32 AND HAVE_GLPK)
ladanyi@667
    96
  IF(WIN32 AND HAVE_CPLEX)
ladanyi@667
    97
    GET_TARGET_PROPERTY(TARGET_LOC mip_test LOCATION)
ladanyi@667
    98
    GET_FILENAME_COMPONENT(TARGET_PATH ${TARGET_LOC} PATH)
ladanyi@667
    99
    ADD_CUSTOM_COMMAND(TARGET mip_test POST_BUILD
ladanyi@667
   100
      COMMAND cmake -E copy ${CPLEX_BIN_DIR}/cplex91.dll ${TARGET_PATH}
ladanyi@667
   101
    )
ladanyi@667
   102
  ENDIF(WIN32 AND HAVE_CPLEX)
ladanyi@496
   103
ENDIF(HAVE_MIP)
ladanyi@496
   104
alpar@225
   105
FOREACH(TEST_NAME ${TESTS})
alpar@225
   106
  ADD_EXECUTABLE(${TEST_NAME} ${TEST_NAME}.cc)
alpar@225
   107
  TARGET_LINK_LIBRARIES(${TEST_NAME} lemon)
alpar@225
   108
  ADD_TEST(${TEST_NAME} ${TEST_NAME})
alpar@225
   109
ENDFOREACH(TEST_NAME)