Skip to content

Commit

Permalink
Update to match develop and allow hdf5 as subdirectory build
Browse files Browse the repository at this point in the history
  • Loading branch information
byrnHDF committed May 22, 2024
1 parent c5c3e3c commit 1717722
Show file tree
Hide file tree
Showing 147 changed files with 4,448 additions and 1,026 deletions.
2 changes: 1 addition & 1 deletion C/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required (VERSION 3.12)
PROJECT (HDF5Examples_C)
project (HDF5Examples_C C)

#-----------------------------------------------------------------------------
# Build the C Examples
Expand Down
47 changes: 27 additions & 20 deletions C/H5D/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -221,33 +221,40 @@ if (H5EX_BUILD_TESTING)
-E remove
${testname}.h5
)
add_test (
NAME ${EXAMPLE_VARNAME}_${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=$<TARGET_FILE:${EXAMPLE_VARNAME}_${testname}>"
-D "TEST_ARGS:STRING="
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_EXPECT=0"
-D "TEST_OUTPUT=${testname}.out"
-D "TEST_REFERENCE=${testname}.tst"
-D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_LIB_DIRECTORY}"
-P "${H5EX_RESOURCES_DIR}/runTest.cmake"
)
set_tests_properties (${EXAMPLE_VARNAME}_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_${testname}-clearall)
if (HDF5_BUILD_TOOLS)
if (HDF5_USING_ANALYSIS_TOOL)
add_test (NAME ${EXAMPLE_VARNAME}_${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:${EXAMPLE_VARNAME}_${testname}>)
set_tests_properties (${EXAMPLE_VARNAME}_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_${testname}-clearall)
else ()
add_test (
NAME ${EXAMPLE_VARNAME}_H5DUMP-${testname}
NAME ${EXAMPLE_VARNAME}_${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=${H5EX_HDF5_DUMP_EXECUTABLE}"
-D "TEST_ARGS:STRING=${ARGN};${testname}.h5"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:${EXAMPLE_VARNAME}_${testname}>"
-D "TEST_ARGS:STRING="
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${testname}.ddl.out"
-D "TEST_EXPECT=0"
-D "TEST_REFERENCE=${testname}.ddl"
-D "TEST_OUTPUT=${testname}.out"
-D "TEST_REFERENCE=${testname}.tst"
-D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_LIB_DIRECTORY}"
-P "${H5EX_RESOURCES_DIR}/runTest.cmake"
)
set_tests_properties (${EXAMPLE_VARNAME}_H5DUMP-${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_${testname})
set_tests_properties (${EXAMPLE_VARNAME}_${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_${testname}-clearall)
if (HDF5_BUILD_TOOLS)
add_test (
NAME ${EXAMPLE_VARNAME}_H5DUMP-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=${H5EX_HDF5_DUMP_EXECUTABLE}"
-D "TEST_ARGS:STRING=${ARGN};${testname}.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${testname}.ddl.out"
-D "TEST_EXPECT=0"
-D "TEST_REFERENCE=${testname}.ddl"
-D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_LIB_DIRECTORY}"
-P "${H5EX_RESOURCES_DIR}/runTest.cmake"
)
set_tests_properties (${EXAMPLE_VARNAME}_H5DUMP-${testname} PROPERTIES DEPENDS ${EXAMPLE_VARNAME}_${testname})
endif ()
endif ()
endmacro ()

Expand Down
10 changes: 4 additions & 6 deletions C/H5D/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
#
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the files COPYING and Copyright.html. COPYING can be found at the root
# of the source code distribution tree; Copyright.html can be found at the
# root level of an installed copy of the electronic HDF5 document set and
# is linked from the top-level documents page. It can also be found at
# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
# access to either file, you may request a copy from help@hdfgroup.org.
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.
##
## Makefile.am
## Run automake to generate a Makefile.in from this file.
Expand Down
10 changes: 4 additions & 6 deletions C/H5D/test.sh.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@
#
# This file is part of HDF5. The full HDF5 copyright notice, including
# terms governing use, modification, and redistribution, is contained in
# the files COPYING and Copyright.html. COPYING can be found at the root
# of the source code distribution tree; Copyright.html can be found at the
# root level of an installed copy of the electronic HDF5 document set and
# is linked from the top-level documents page. It can also be found at
# http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have
# access to either file, you may request a copy from help@hdfgroup.org.
# the COPYING file, which can be found at the root of the source code
# distribution tree, or in https://www.hdfgroup.org/licenses.
# If you do not have access to either file, you may request a copy from
# help@hdfgroup.org.

srcdir=@srcdir@

Expand Down
26 changes: 20 additions & 6 deletions C/H5FLT/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@ else ()
set (BLOSC_AVAILABLE 0)
endif ()

option (ENABLE_BLOSC2 "Enable Library Building for blosc2 plugin" ON)
if (ENABLE_BLOSC2)
set (BLOSC_AVAILABLE 1)
set (dyn_examples ${dyn_examples} h5ex_d_blosc2)
else ()
set (BLOSC_AVAILABLE 0)
endif ()

option (ENABLE_BSHUF "Enable Library Building for bshuf plugin" ON)
if (ENABLE_BSHUF)
if (NOT CMAKE_C_COMPILER_ID STREQUAL "Intel")
Expand Down Expand Up @@ -188,6 +196,7 @@ if (H5EX_BUILD_TESTING)
add_test (
NAME ${EXAMPLE_VARNAME}_${testname}-ERR
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:${EXAMPLE_VARNAME}_${testname}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
Expand Down Expand Up @@ -215,6 +224,7 @@ if (H5EX_BUILD_TESTING)
add_test (
NAME ${EXAMPLE_VARNAME}_${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=$<TARGET_FILE:${EXAMPLE_VARNAME}_${testname}>"
-D "TEST_ARGS:STRING=${ARGN}"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
Expand All @@ -234,7 +244,8 @@ if (H5EX_BUILD_TESTING)
add_test (
NAME ${EXAMPLE_VARNAME}_H5DUMP-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_PROGRAM=${H5EX_HDF5_DUMP_EXECUTABLE}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=${H5EX_HDF5_DUMP_EXECUTABLE}"
-D "TEST_ARGS:STRING=--enable-error-stack;-p;${testname}.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
-D "TEST_OUTPUT=${testname}.ddl.out"
Expand All @@ -251,6 +262,7 @@ if (H5EX_BUILD_TESTING)
add_test (
NAME ${EXAMPLE_VARNAME}_H5DUMP-${testname}
COMMAND "${CMAKE_COMMAND}"
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
-D "TEST_PROGRAM=${H5EX_HDF5_DUMP_EXECUTABLE}"
-D "TEST_ARGS:STRING=--enable-error-stack;-p;${testname}.h5"
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
Expand Down Expand Up @@ -287,11 +299,13 @@ if (H5EX_BUILD_TESTING)
add_custom_target(${EXAMPLE_VARNAME}_example_files ALL COMMENT "Copying files needed by example tests" DEPENDS ${example_files_list})

foreach (h5_file ${dyn_examples})
if (${h5_file} MATCHES "h5ex_d_zfp")
## special filter
ADD_H5_TEST (h5ex_d_zfp FILTERALL)
else ()
ADD_H5_TEST (${h5_file})
if (NOT HDF5_USING_ANALYSIS_TOOL)
if (${h5_file} MATCHES "h5ex_d_zfp")
## special filter
ADD_H5_TEST (h5ex_d_zfp FILTERALL)
else ()
ADD_H5_TEST (${h5_file})
endif ()
endif ()
endforeach ()

Expand Down
2 changes: 1 addition & 1 deletion C/H5FLT/h5ex_d_blosc.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ main(void)
herr_t status;
htri_t avail;
H5Z_filter_t filter_id = 0;
char filter_name[80];
char filter_name[128];
hsize_t dims[2] = {DIM0, DIM1}, chunk[2] = {CHUNK0, CHUNK1};
size_t nelmts = 7; /* number of elements in cd_values */
unsigned int flags;
Expand Down
Loading

0 comments on commit 1717722

Please sign in to comment.