Skip to content

Fix filters tools testing and ZFP tools tests#223

Merged
lrknox merged 1 commit into
HDFGroup:masterfrom
jhendersonHDF:fix_testing
Feb 27, 2026
Merged

Fix filters tools testing and ZFP tools tests#223
lrknox merged 1 commit into
HDFGroup:masterfrom
jhendersonHDF:fix_testing

Conversation

@jhendersonHDF
Copy link
Copy Markdown
Contributor

No description provided.

set (ENV{LD_LIBRARY_PATH} "$ENV{LD_LIBRARY_PATH}:${TEST_LIBRARY_DIRECTORY}")
endif ()
set (ENV{HDF5_PLUGIN_PATH} "${TEST_LIBRARY_DIRECTORY}/plugins:$ENV{HDF5_PLUGIN_PATH}")
set (ENV{HDF5_PLUGIN_PATH} "${TEST_LIBRARY_DIRECTORY}/plugins:${TEST_LIBRARY_DIRECTORY}/plugin:$ENV{HDF5_PLUGIN_PATH}")
Copy link
Copy Markdown
Contributor Author

@jhendersonHDF jhendersonHDF Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plugin appears to be the actual directory name at this point, so updated many places. I left plugins in case there is some reason it's here that I'm not aware of.

message (FATAL_ERROR "Require TEST_OUTPUT to be defined")
endif ()
if (NOT TEST_EXPECT)
if (NOT DEFINED TEST_EXPECT)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be NOT DEFINED, otherwise when TEST_EXPECT is 0, this is treated as TRUE and prints out the misleading message below.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This filter's DDL file was out of date from the data not being tested previously.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This filter's DDL file was out of date from the data not being tested previously.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ZFP testing files were several years out of date.

set_tests_properties (${testname} PROPERTIES DEPENDS ${testname}-clearall)
endif ()
set (last_test "${testname}")
if (HDF5_BUILD_TOOLS)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing of the tools has been broken since 2.0.0 due to the change in name from HDF5_BUILD_TOOLS -> HDF5_PROVIDES_TOOLS. After fixing this, several tests were failing and needed fixed.

OUTPUT_FILE ${TEST_OUTPUT}
ERROR_FILE ${TEST_OUTPUT}.err
OUTPUT_VARIABLE TEST_OUT
ERROR_VARIABLE TEST_ERROR
Copy link
Copy Markdown
Contributor Author

@jhendersonHDF jhendersonHDF Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the latest CMake docs,

If more than one OUTPUT_* or ERROR_* option is given for the same pipe the precedence is not specified. If no OUTPUT_* or ERROR_* options are given the output will be shared with the corresponding pipes of the CMake process itself.

This had the effect that TEST_ERROR would be empty after stderr was redirected to ERROR_FILE ${TEST_OUTPUT}.err and no error output would show up in ctest, making it difficult to know why tests failed. This needs to be fixed in HDF5 as well, but in a slightly different manner.

if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err")
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_STREAM)
list (LENGTH TEST_STREAM test_len)
file (READ ${TEST_FOLDER}/${TEST_OUTPUT}.err TEST_ERROR)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than use ERROR_VARIABLE above, read the error output file into TEST_ERROR so it can be displayed correctly.

else ()
set (PLUGIN_RELATIVE_PATH "../../../lib/plugin")
set (_plugin_path "${PROJECT_SOURCE_DIR}/../../../lib/plugin")
set (_plugin_path "${_plugin_path}:${PROJECT_SOURCE_DIR}/../../../lib64/plugin")
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ZFP gets installed to lib64 instead of lib, meaning more paths needed to be added here.

-D "TEST_REFERENCE=${testname}.${resultfile}.tst"
-D "TEST_LIBRARY_DIRECTORY=${TESTLIBDIR}"
-D "TEST_ENV_VAR=HDF5_PLUGIN_PATH"
-D "TEST_ENV_VALUE=${_plugin_path}"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These needed to be added for Windows, matching other add_test calls above. For some reason TEST_LIBRARY_DIRECTORY does not appear to have an effect.

@lrknox lrknox merged commit a68108e into HDFGroup:master Feb 27, 2026
13 checks passed
@jhendersonHDF jhendersonHDF deleted the fix_testing branch March 1, 2026 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants