summaryrefslogtreecommitdiffstats
path: root/testff/CMakeLists.txt
blob: f35b9525d0c9b4d9c7fbfd05838b08c907826a17 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
cmake_minimum_required (VERSION 2.8.10)
PROJECT (HDF5_TEST_FF)

#-----------------------------------------------------------------------------
# Apply Definitions to compiler in this directory and below
#-----------------------------------------------------------------------------
ADD_DEFINITIONS (${HDF5_EXTRA_C_FLAGS})

INCLUDE_DIRECTORIES (${HDF5_TEST_SRC_DIR})
INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib )

#------------------------------------------------------------------------------
# Compile kwsys library and setup TestDriver
#------------------------------------------------------------------------------
CONFIGURE_FILE (
  ${CMAKE_CURRENT_SOURCE_DIR}/h5ff_test_config.h.in
  ${CMAKE_CURRENT_BINARY_DIR}/h5ff_test_config.h
)

INCLUDE_DIRECTORIES (${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})

ADD_SUBDIRECTORY (driver)

#------------------------------------------------------------------------------
# Set up test macros
#------------------------------------------------------------------------------
# BUILD_H5FF_TEST: build and create executable from target file
MACRO (BUILD_H5FF_TEST file)
  ADD_EXECUTABLE (${file} ${HDF5_TEST_FF_SOURCE_DIR}/${file}.c)
  TARGET_NAMING (${file} ${LIB_TYPE})
  TARGET_LINK_LIBRARIES (${file}
    ${HDF5_TEST_LIB_TARGET} ${HDF5_LIB_TARGET} ${LINK_LIBS})
  SET_TARGET_PROPERTIES (${file} PROPERTIES FOLDER test/ff)
ENDMACRO (BUILD_H5FF_TEST)

# ADD_H5FF_TEST: add parallel test from target file
MACRO (ADD_H5FF_TEST file)
  ADD_TEST (NAME TEST_FF_${file} COMMAND ${MPIEXEC} ${MPIEXEC_PREFLAGS} 
    ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_POSTFLAGS}
    $<TARGET_FILE:${file}>)
ENDMACRO (ADD_H5FF_TEST)

# ADD_H5FF_DRIVER_TEST: add client/server test from target server and target client
MACRO (ADD_H5FF_DRIVER_TEST test_name server client)
  ADD_TEST (NAME TEST_FF_${test_name}
    COMMAND $<TARGET_FILE:h5ff_test_driver>
    --server $<TARGET_FILE:${server}>
    --client $<TARGET_FILE:${client}>
  )
ENDMACRO (ADD_H5FF_DRIVER_TEST)

# Save that for later if we need to launch using MPMD run
#MACRO (ADD_H5EFF_MPMD_TEST test_name server client)
#  ADD_TEST (NAME "${test_name}"
#    COMMAND ${MPIEXEC} ${MPIEXEC_NUMPROC_FLAG} 1 ${MPIEXEC_PREFLAGS}
#    $<TARGET_FILE:${server}> : ${MPIEXEC_NUMPROC_FLAG}
#    ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:${client}>
#  )
#MACRO (ADD_H5EFF_MPMD_TEST)

#-----------------------------------------------------------------------------
# Build Tests
#-----------------------------------------------------------------------------
# hello
BUILD_H5FF_TEST(hello_server)
BUILD_H5FF_TEST(hello_client)

BUILD_H5FF_TEST(h5ff_query)

# h5ff
# ADD_H5FF_DRIVER_TEST(<target>)
BUILD_H5FF_TEST(h5ff_server)
BUILD_H5FF_TEST(h5ff_client_analysis)
BUILD_H5FF_TEST(h5ff_client_adv_analysis)
BUILD_H5FF_TEST(h5ff_client_attr)
BUILD_H5FF_TEST(h5ff_client_dset)
BUILD_H5FF_TEST(h5ff_client_evict_deltas)
BUILD_H5FF_TEST(h5ff_client_index)
BUILD_H5FF_TEST(h5ff_client_links)
BUILD_H5FF_TEST(h5ff_client_M6.2_demo)
BUILD_H5FF_TEST(h5ff_client_M7.2-pep_demo)
BUILD_H5FF_TEST(h5ff_client_map)
BUILD_H5FF_TEST(h5ff_client_multiple_cont)
BUILD_H5FF_TEST(h5ff_client_obj)
BUILD_H5FF_TEST(h5ff_client_prefetch)
BUILD_H5FF_TEST(h5ff_client_time_datasets)
BUILD_H5FF_TEST(h5ff_client_timings)
BUILD_H5FF_TEST(h5ff_client_trans)
BUILD_H5FF_TEST(h5ff_client_view)
BUILD_H5FF_TEST(h5ff_client_vl_data)

IF (HDF5_ENABLE_PYTHON)
  BUILD_H5FF_TEST(h5ff_python_exec)
ENDIF (HDF5_ENABLE_PYTHON)
# BUILD_H5FF_TEST(h5ff_client_container_open)

#-----------------------------------------------------------------------------
# Define Tests
#-----------------------------------------------------------------------------
# hello
ADD_H5FF_DRIVER_TEST(hello hello_server hello_client)

# h5ff
# ADD_H5FF_DRIVER_TEST(<test_name> <server_target> <client_target>)
ADD_H5FF_DRIVER_TEST(h5ff_attr h5ff_server h5ff_client_attr)
ADD_H5FF_DRIVER_TEST(h5ff_dset h5ff_server h5ff_client_dset)
ADD_H5FF_DRIVER_TEST(h5ff_links h5ff_server h5ff_client_links)
ADD_H5FF_DRIVER_TEST(h5ff_map h5ff_server h5ff_client_map)
ADD_H5FF_DRIVER_TEST(h5ff_multiple_count h5ff_server h5ff_client_multiple_cont)
ADD_H5FF_DRIVER_TEST(h5ff_obj h5ff_server h5ff_client_obj)
ADD_H5FF_DRIVER_TEST(h5ff_trans h5ff_server h5ff_client_trans)

# ADD_H5FF_DRIVER_TEST(h5ff_container_open h5ff_server h5ff_client_container_open)

# TODO make a list of test and loop over list with foreach
#SET (H5FF_TESTS
#    attr
#    dset
#    links
#    ...
#)

#FOREACH (testff ${H5FF_TESTS})
#  ADD_H5FF_DRIVER_TEST(${testff} ${testff}_server ${testff}_client)
#ENDFOREACH (testff ${H5FF_TESTS})