Minor refactoring of testframe.c testing framework (#4930)

Added setup and cleanup callback parameters to TestInit() to perform
setup and cleanup tasks once for whole test program

Removed TestCleanup() function since its functionality is covered by
PerformTests()

Added check of the HDF5_NOCLEANUP environment variable in
GetTestCleanup()
This commit is contained in:
jhendersonHDF
2024-10-07 12:27:09 -05:00
committed by GitHub
parent 54f8f12ed9
commit 302ba0a7f7
8 changed files with 161 additions and 110 deletions
+1 -7
View File
@@ -32,8 +32,6 @@
PerformTests() -- Perform requested testing
GetTestSummary() -- Retrieve Summary request value
TestSummary() -- Display test summary
GetTestCleanup() -- Retrieve Cleanup request value
TestCleanup() -- Clean up files from testing
GetTestNumErrs() -- Retrieve the number of testing errors
***************************************************************************/
@@ -57,7 +55,7 @@ main(int argc, char *argv[])
// caused deliberately and expected.
Exception::dontPrint();
/* Initialize testing framework */
TestInit(argv[0], NULL, NULL, 0);
TestInit(argv[0], NULL, NULL, NULL, NULL, 0);
// testing file creation and opening in tfile.cpp
AddTest("tfile", test_file, NULL, cleanup_file, NULL, 0, "File I/O Operations");
@@ -112,10 +110,6 @@ main(int argc, char *argv[])
if (GetTestSummary())
TestSummary(stdout);
/* Clean up test files, if allowed */
if (GetTestCleanup() && !getenv(HDF5_NOCLEANUP))
TestCleanup();
/* Release test infrastructure */
TestShutdown();