Skip to content

Commit 24efd77

Browse files
authored
ci, tests: Initial HDF5 version 2 support (#94)
The relevant changes in HDF5 v2 are: - s/Z_LIB/ZLIB/ for CMake variables, e.g. `HDF5_ENABLE_ZLIB_SUPPORT`. - the default file version is 1.8 (not earliest). As a result this commit: - Updates the CI to build against HDF5 v2. - Updates the test for default file version. - Silences a free space manager related test.
1 parent ec19848 commit 24efd77

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ jobs:
101101
runs-on: ubuntu-latest
102102
strategy:
103103
matrix:
104-
hdf5_version : [ hdf5-1_8_23, hdf5-1_10_11, hdf5-1_12_3, hdf5_1.14.6 ]
104+
hdf5_version : [ hdf5-1_8_23, hdf5-1_10_11, hdf5-1_12_3, hdf5_1.14.6, hdf5_2.0.0]
105105

106106
steps:
107107
- uses: actions/checkout@v5
@@ -117,7 +117,7 @@ jobs:
117117
wget https://github.com/HDFGroup/hdf5/archive/refs/tags/${{ matrix.hdf5_version }}.tar.gz --output-document hdf5.tar.gz
118118
tar xf hdf5.tar.gz
119119
mkdir -p hdf5-${{ matrix.hdf5_version }}/BUILD && cd hdf5-${{ matrix.hdf5_version }}/BUILD
120-
cmake .. -DCMAKE_BUILD_TYPE=Release -GNinja -DCMAKE_INSTALL_PREFIX=$HOME/${{ matrix.hdf5_version }} -DHDF5_ENABLE_Z_LIB_SUPPORT=ON -DUSE_LIBAEC=ON -DHDF5_BUILD_EXAMPLES=OFF -DBUILD_STATIC_LIBS=OFF -DBUILD_TESTING=OFF
120+
cmake .. -DCMAKE_BUILD_TYPE=Release -GNinja -DCMAKE_INSTALL_PREFIX=$HOME/${{ matrix.hdf5_version }} -DHDF5_ENABLE_ZLIB_SUPPORT=ON -DHDF5_ENABLE_Z_LIB_SUPPORT=ON -DUSE_LIBAEC=ON -DHDF5_BUILD_EXAMPLES=OFF -DBUILD_STATIC_LIBS=OFF -DBUILD_TESTING=OFF
121121
ninja && ninja install
122122
123123
- name: Build

tests/unit/tests_high_five_base.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,11 @@ TEST_CASE("Test file version bounds") {
180180
{
181181
File file(file_name, File::Truncate);
182182
auto bounds = file.getVersionBounds();
183+
#if H5_VERSION_GE(2, 0, 0)
184+
CHECK(bounds.first == H5F_LIBVER_V18);
185+
#else
183186
CHECK(bounds.first == H5F_LIBVER_EARLIEST);
187+
#endif
184188
CHECK(bounds.second == H5F_LIBVER_LATEST);
185189
}
186190

@@ -630,7 +634,7 @@ TEST_CASE("FreeSpace (default)") {
630634
}
631635
}
632636

633-
#if H5_VERSION_GE(1, 10, 1)
637+
#if H5_VERSION_GE(1, 10, 1) && !H5_VERSION_GE(2, 0, 0)
634638
TEST_CASE("FreeSpace (tracked)") {
635639
const std::string filename = "freespace_tracked.h5";
636640
const std::string ds_path = "dataset";

0 commit comments

Comments
 (0)