Skip to content

Commit

Permalink
Fix vlen depends on version vs api
Browse files Browse the repository at this point in the history
  • Loading branch information
byrnHDF committed Sep 19, 2023
1 parent 7da319c commit 1c03727
Show file tree
Hide file tree
Showing 9 changed files with 124 additions and 4 deletions.
40 changes: 38 additions & 2 deletions C/H5T/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ if (BUILD_TESTING)
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/testfiles/${H5_LIBVER_DIR}/${example_name}.tst ${testdest}.tst
)
if (HDF5_BUILD_TOOLS AND NOT ${example_name} STREQUAL "h5ex_t_convert")
if (HDF5_BUILD_TOOLS)
add_custom_command (
TARGET ${EXAMPLE_VARNAME}_${example_name}
POST_BUILD
Expand All @@ -112,6 +112,42 @@ if (BUILD_TESTING)
ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/testfiles/${H5_LIBVER_DIR}/${example_name}.tst ${PROJECT_BINARY_DIR}/${example_name}.tst
)
ADD_H5_CMP_TEST (${example_name})
elseif (${example_name} STREQUAL "h5ex_t_vlen" OR ${example_name} STREQUAL "h5ex_t_vlenatt")
set (testdest "${PROJECT_BINARY_DIR}/${example_name}")
#message (STATUS " Copying ${example_name}.test")
add_custom_command (
TARGET ${EXAMPLE_VARNAME}_${example_name}
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/testfiles/${H5_LIBVER_DIR}/${example_name}.tst ${testdest}.tst
)
if (HDF5_BUILD_TOOLS)
if (${${EXAMPLE_VARNAME}_USE_16_API} OR ${${EXAMPLE_VARNAME}_USE_18_API} OR ${${EXAMPLE_VARNAME}_USE_110_API} OR ${${EXAMPLE_VARNAME}_USE_112_API})
if (HDF5_VERSION_MAJOR VERSION_GREATER_EQUAL "1.14")
add_custom_command (
TARGET ${EXAMPLE_VARNAME}_${example_name}
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/testfiles/${H5_LIBVER_DIR}/114/${example_name}.ddl ${testdest}.ddl
)
else ()
add_custom_command (
TARGET ${EXAMPLE_VARNAME}_${example_name}
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/testfiles/${H5_LIBVER_DIR}/${example_name}.ddl ${testdest}.ddl
)
endif ()
else ()
add_custom_command (
TARGET ${EXAMPLE_VARNAME}_${example_name}
POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/testfiles/${H5_LIBVER_DIR}/${example_name}.ddl ${testdest}.ddl
)
endif ()
endif ()
ADD_H5_TEST (${example_name})
else ()
set (testdest "${PROJECT_BINARY_DIR}/${example_name}")
#message (STATUS " Copying ${example_name}.test")
Expand All @@ -121,7 +157,7 @@ if (BUILD_TESTING)
COMMAND ${CMAKE_COMMAND}
ARGS -E copy_if_different ${PROJECT_SOURCE_DIR}/testfiles/${H5_LIBVER_DIR}/${example_name}.tst ${testdest}.tst
)
if (HDF5_BUILD_TOOLS AND NOT ${example_name} STREQUAL "h5ex_t_convert")
if (HDF5_BUILD_TOOLS)
if (${${EXAMPLE_VARNAME}_USE_16_API} OR ${${EXAMPLE_VARNAME}_USE_18_API} OR ${${EXAMPLE_VARNAME}_USE_110_API})
if ((HDF5_VERSION_MAJOR VERSION_GREATER_EQUAL "1.12") AND ((${example_name} STREQUAL "h5ex_t_objref" OR ${example_name} STREQUAL "h5ex_t_objrefatt") OR (${example_name} STREQUAL "h5ex_t_regref" OR ${example_name} STREQUAL "h5ex_t_regrefatt")))
add_custom_command (
Expand Down
11 changes: 11 additions & 0 deletions C/H5T/testfiles/110/114/h5ex_t_vlen.ddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
HDF5 "h5ex_t_vlen.h5" {
GROUP "/" {
DATASET "DS1" {
DATATYPE H5T_VLEN { H5T_STD_I32LE }
DATASPACE SIMPLE { ( 2 ) / ( 2 ) }
DATA {
(0): (3, 2, 1), (1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144)
}
}
}
}
17 changes: 17 additions & 0 deletions C/H5T/testfiles/110/114/h5ex_t_vlenatt.ddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
HDF5 "h5ex_t_vlenatt.h5" {
GROUP "/" {
DATASET "DS1" {
DATATYPE H5T_STD_I32LE
DATASPACE NULL
DATA {
}
ATTRIBUTE "A1" {
DATATYPE H5T_VLEN { H5T_STD_I32LE }
DATASPACE SIMPLE { ( 2 ) / ( 2 ) }
DATA {
(0): (3, 2, 1), (1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144)
}
}
}
}
}
11 changes: 11 additions & 0 deletions C/H5T/testfiles/112/114/h5ex_t_vlen.ddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
HDF5 "h5ex_t_vlen.h5" {
GROUP "/" {
DATASET "DS1" {
DATATYPE H5T_VLEN { H5T_STD_I32LE }
DATASPACE SIMPLE { ( 2 ) / ( 2 ) }
DATA {
(0): (3, 2, 1), (1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144)
}
}
}
}
17 changes: 17 additions & 0 deletions C/H5T/testfiles/112/114/h5ex_t_vlenatt.ddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
HDF5 "h5ex_t_vlenatt.h5" {
GROUP "/" {
DATASET "DS1" {
DATATYPE H5T_STD_I32LE
DATASPACE NULL
DATA {
}
ATTRIBUTE "A1" {
DATATYPE H5T_VLEN { H5T_STD_I32LE }
DATASPACE SIMPLE { ( 2 ) / ( 2 ) }
DATA {
(0): (3, 2, 1), (1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144)
}
}
}
}
}
2 changes: 1 addition & 1 deletion C/H5T/testfiles/112/h5ex_t_vlen.ddl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
HDF5 "h5ex_t_vlen.h5" {
GROUP "/" {
DATASET "DS1" {
DATATYPE H5T_VLEN { H5T_STD_I32LE }
DATATYPE H5T_VLEN { H5T_STD_I32LE}
DATASPACE SIMPLE { ( 2 ) / ( 2 ) }
DATA {
(0): (3, 2, 1), (1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144)
Expand Down
2 changes: 1 addition & 1 deletion C/H5T/testfiles/112/h5ex_t_vlenatt.ddl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ GROUP "/" {
DATA {
}
ATTRIBUTE "A1" {
DATATYPE H5T_VLEN { H5T_STD_I32LE }
DATATYPE H5T_VLEN { H5T_STD_I32LE}
DATASPACE SIMPLE { ( 2 ) / ( 2 ) }
DATA {
(0): (3, 2, 1), (1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144)
Expand Down
11 changes: 11 additions & 0 deletions C/H5T/testfiles/18/114/h5ex_t_vlen.ddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
HDF5 "h5ex_t_vlen.h5" {
GROUP "/" {
DATASET "DS1" {
DATATYPE H5T_VLEN { H5T_STD_I32LE }
DATASPACE SIMPLE { ( 2 ) / ( 2 ) }
DATA {
(0): (3, 2, 1), (1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144)
}
}
}
}
17 changes: 17 additions & 0 deletions C/H5T/testfiles/18/114/h5ex_t_vlenatt.ddl
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
HDF5 "h5ex_t_vlenatt.h5" {
GROUP "/" {
DATASET "DS1" {
DATATYPE H5T_STD_I32LE
DATASPACE NULL
DATA {
}
ATTRIBUTE "A1" {
DATATYPE H5T_VLEN { H5T_STD_I32LE }
DATASPACE SIMPLE { ( 2 ) / ( 2 ) }
DATA {
(0): (3, 2, 1), (1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144)
}
}
}
}
}

0 comments on commit 1c03727

Please sign in to comment.