1
+
#
 
2
+
# Copyright by The HDF Group.
 
3
+
# All rights reserved.
 
4
+
#
 
5
+
# This file is part of HDF5.  The full HDF5 copyright notice, including
 
6
+
# terms governing use, modification, and redistribution, is contained in
 
7
+
# the COPYING file, which can be found at the root of the source code
 
8
+
# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases.
 
9
+
# If you do not have access to either file, you may request a copy from
 
10
+
# help@hdfgroup.org.
 
11
+
#
 
12
+
 
13
+
##############################################################################
 
14
+
##############################################################################
 
15
+
###           T E S T I N G                                                ###
 
16
+
##############################################################################
 
17
+
##############################################################################
 
18
+
  file (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/red ${PROJECT_BINARY_DIR}/blue ${PROJECT_BINARY_DIR}/u2w)
 
19
+
  if (BUILD_SHARED_LIBS)
 
20
+
    file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/H5EX-shared")
 
21
+
    file (MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared/red ${PROJECT_BINARY_DIR}/H5EX-shared/blue ${PROJECT_BINARY_DIR}/H5EX-shared/u2w)
 
22
+
  endif ()
 
23
+
 
24
+
  # Remove any output file left over from previous test run
 
25
+
  add_test (
 
26
+
      NAME EXAMPLES-clear-objects
 
27
+
      COMMAND    ${CMAKE_COMMAND}
 
28
+
          -E remove
 
29
+
          Attributes.h5
 
30
+
          btrees_file.h5
 
31
+
          cmprss.h5
 
32
+
          default_file.h5
 
33
+
          dset.h5
 
34
+
          extend.h5
 
35
+
          extlink_prefix_source.h5
 
36
+
          extlink_source.h5
 
37
+
          extlink_target.h5
 
38
+
          group.h5
 
39
+
          groups.h5
 
40
+
          hard_link.h5
 
41
+
          mount1.h5
 
42
+
          mount2.h5
 
43
+
          one_index_file.h5
 
44
+
          only_dspaces_and_attrs_file.h5
 
45
+
          only_huge_mesgs_file.h5
 
46
+
          REF_REG.h5
 
47
+
          refere.h5
 
48
+
          SDS.h5
 
49
+
          SDScompound.h5
 
50
+
          SDSextendible.h5
 
51
+
          Select.h5
 
52
+
          separate_indexes_file.h5
 
53
+
          small_lists_file.h5
 
54
+
          soft_link.h5
 
55
+
          subset.h5
 
56
+
          unix2win.h5
 
57
+
          blue/prefix_target.h5
 
58
+
          red/prefix_target.h5
 
59
+
          u2w/u2w_target.h5
 
60
+
          vds.h5
 
61
+
          vds-exc.h5
 
62
+
          vds-excalibur.h5
 
63
+
          vds-exclim.h5
 
64
+
          vds-percival.h5
 
65
+
          vds-percival-unlim.h5
 
66
+
          vds-percival-unlim-maxmin.h5
 
67
+
          a.h5
 
68
+
          b.h5
 
69
+
          c.h5
 
70
+
          d.h5
 
71
+
          vds-simpleIO.h5
 
72
+
          vds-eiger.h5
 
73
+
  )
 
74
+
  if (NOT "${last_test}" STREQUAL "")
 
75
+
    set_tests_properties (EXAMPLES-clear-objects PROPERTIES DEPENDS ${last_test})
 
76
+
  endif ()
 
77
+
  set (last_test "EXAMPLES-clear-objects")
 
78
+
 
79
+
  foreach (example ${examples})
 
80
+
    if (HDF5_ENABLE_USING_MEMCHECKER)
 
81
+
      add_test (NAME EXAMPLES-${example} COMMAND $<TARGET_FILE:${example}>)
 
82
+
    else ()
 
83
+
      add_test (NAME EXAMPLES-${example} COMMAND "${CMAKE_COMMAND}"
 
84
+
          -D "TEST_PROGRAM=$<TARGET_FILE:${example}>"
 
85
+
          -D "TEST_ARGS:STRING="
 
86
+
          -D "TEST_EXPECT=0"
 
87
+
          -D "TEST_SKIP_COMPARE=TRUE"
 
88
+
          -D "TEST_OUTPUT=${example}.txt"
 
89
+
          #-D "TEST_REFERENCE=${example}.out"
 
90
+
          -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
 
91
+
          -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
 
92
+
      )
 
93
+
    endif ()
 
94
+
    if (NOT "${last_test}" STREQUAL "")
 
95
+
      set_tests_properties (EXAMPLES-${example} PROPERTIES DEPENDS ${last_test})
 
96
+
    endif ()
 
97
+
    set (last_test "EXAMPLES-${example}")
 
98
+
  endforeach ()
 
99
+
 
100
+
  if (BUILD_SHARED_LIBS)
 
101
+
    # Remove any output file left over from previous test run
 
102
+
    add_test (
 
103
+
        NAME EXAMPLES-shared-clear-objects
 
104
+
        COMMAND    ${CMAKE_COMMAND}
 
105
+
            -E remove
 
106
+
            Attributes.h5
 
107
+
            btrees_file.h5
 
108
+
            cmprss.h5
 
109
+
            default_file.h5
 
110
+
            dset.h5
 
111
+
            extend.h5
 
112
+
            extlink_prefix_source.h5
 
113
+
            extlink_source.h5
 
114
+
            extlink_target.h5
 
115
+
            group.h5
 
116
+
            groups.h5
 
117
+
            hard_link.h5
 
118
+
            mount1.h5
 
119
+
            mount2.h5
 
120
+
            one_index_file.h5
 
121
+
            only_dspaces_and_attrs_file.h5
 
122
+
            only_huge_mesgs_file.h5
 
123
+
            REF_REG.h5
 
124
+
            refere.h5
 
125
+
            SDS.h5
 
126
+
            SDScompound.h5
 
127
+
            SDSextendible.h5
 
128
+
            Select.h5
 
129
+
            separate_indexes_file.h5
 
130
+
            small_lists_file.h5
 
131
+
            soft_link.h5
 
132
+
            subset.h5
 
133
+
            unix2win.h5
 
134
+
            vds.h5
 
135
+
            vds-exc.h5
 
136
+
            vds-excalibur.h5
 
137
+
            vds-exclim.h5
 
138
+
            vds-percival.h5
 
139
+
            vds-percival-unlim.h5
 
140
+
            vds-percival-unlim-maxmin.h5
 
141
+
            a.h5
 
142
+
            b.h5
 
143
+
            c.h5
 
144
+
            d.h5
 
145
+
            vds-simpleIO.h5
 
146
+
            vds-eiger.h5
 
147
+
            blue/prefix_target.h5
 
148
+
            red/prefix_target.h5
 
149
+
            u2w/u2w_target.h5
 
150
+
        WORKING_DIRECTORY
 
151
+
            ${PROJECT_BINARY_DIR}/H5EX-shared
 
152
+
    )
 
153
+
    if (NOT "${last_test}" STREQUAL "")
 
154
+
      set_tests_properties (EXAMPLES-shared-clear-objects PROPERTIES DEPENDS ${last_test})
 
155
+
    endif ()
 
156
+
    set (last_test "EXAMPLES-shared-clear-objects")
 
157
+
 
158
+
    foreach (example ${examples})
 
159
+
      if (HDF5_ENABLE_USING_MEMCHECKER)
 
160
+
        add_test (NAME EXAMPLES-shared-${example} COMMAND $<TARGET_FILE:${example}-shared>)
 
161
+
      else ()
 
162
+
        add_test (NAME EXAMPLES-shared-${example} COMMAND "${CMAKE_COMMAND}"
 
163
+
            -D "TEST_PROGRAM=$<TARGET_FILE:${example}>"
 
164
+
            -D "TEST_ARGS:STRING="
 
165
+
            -D "TEST_EXPECT=0"
 
166
+
            -D "TEST_SKIP_COMPARE=TRUE"
 
167
+
            -D "TEST_OUTPUT=${example}.txt"
 
168
+
            #-D "TEST_REFERENCE=${example}.out"
 
169
+
            -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5EX-shared"
 
170
+
            -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
 
171
+
        )
 
172
+
      endif ()
 
173
+
      set_tests_properties (EXAMPLES-shared-${example} PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared)
 
174
+
      if (NOT "${last_test}" STREQUAL "")
 
175
+
        set_tests_properties (EXAMPLES-shared-${example} PROPERTIES DEPENDS ${last_test})
 
176
+
      endif ()
 
177
+
      set (last_test "EXAMPLES-shared-${example}")
 
178
+
    endforeach ()
 
179
+
  endif ()
 
180
+
 
181
+
### Windows pops up a modal permission dialog on this test
 
182
+
  if (H5_HAVE_PARALLEL AND NOT WIN32)
 
183
+
    if (HDF5_ENABLE_USING_MEMCHECKER)
 
184
+
      add_test (NAME EXAMPLES-ph5example COMMAND $<TARGET_FILE:ph5example>)
 
185
+
    else ()
 
186
+
      add_test (NAME EXAMPLES-ph5example COMMAND "${CMAKE_COMMAND}"
 
187
+
          -D "TEST_PROGRAM=$<TARGET_FILE:ph5example>"
 
188
+
          -D "TEST_ARGS:STRING="
 
189
+
          -D "TEST_EXPECT=0"
 
190
+
          -D "TEST_SKIP_COMPARE=TRUE"
 
191
+
          -D "TEST_OUTPUT=ph5example.txt"
 
192
+
          #-D "TEST_REFERENCE=ph5example.out"
 
193
+
          -D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
 
194
+
          -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
 
195
+
      )
 
196
+
    endif ()
 
197
+
    if (NOT "${last_test}" STREQUAL "")
 
198
+
      set_tests_properties (EXAMPLES-ph5example PROPERTIES DEPENDS ${last_test})
 
199
+
    endif ()
 
200
+
    set (last_test "EXAMPLES-ph5example")
 
201
+
    if (BUILD_SHARED_LIBS)
 
202
+
      if (HDF5_ENABLE_USING_MEMCHECKER)
 
203
+
        add_test (NAME EXAMPLES-shared-ph5example COMMAND $<TARGET_FILE:ph5example-shared>)
 
204
+
      else ()
 
205
+
        add_test (NAME EXAMPLES-shared-ph5example COMMAND "${CMAKE_COMMAND}"
 
206
+
            -D "TEST_PROGRAM=$<TARGET_FILE:ph5example-shared>"
 
207
+
            -D "TEST_ARGS:STRING="
 
208
+
            -D "TEST_EXPECT=0"
 
209
+
            -D "TEST_SKIP_COMPARE=TRUE"
 
210
+
            -D "TEST_OUTPUT=ph5example-shared.txt"
 
211
+
            #-D "TEST_REFERENCE=ph5example-shared.out"
 
212
+
            -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/H5EX-shared"
 
213
+
            -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake"
 
214
+
        )
 
215
+
      endif ()
 
216
+
      set_tests_properties (EXAMPLES-shared-ph5example PROPERTIES WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/H5EX-shared)
 
217
+
      if (NOT "${last_test}" STREQUAL "")
 
218
+
        set_tests_properties (EXAMPLES-shared-ph5example PROPERTIES DEPENDS ${last_test})
 
219
+
      endif ()
 
220
+
      set (last_test "EXAMPLES-shared-ph5example")
 
221
+
    endif ()
 
222
+
  endif ()