Skip to content

Commit

Permalink
Rework the TestExpress usage and refactor dead code (HDFGroup#4590)
Browse files Browse the repository at this point in the history
  • Loading branch information
byrnHDF authored and lrknox committed Jul 2, 2024
1 parent 8a3063b commit e6f8118
Show file tree
Hide file tree
Showing 90 changed files with 248 additions and 280 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/abi-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
mkdir "${{ github.workspace }}/hdf5R"
cd "${{ github.workspace }}/hdf5R"
wget -q https://github.com/HDFGroup/hdf5/releases/download/hdf5-${{ inputs.file_ref }}/hdf5-${{ inputs.file_ref }}-ubuntu-2204.tar.gz
tar zxf hdf5-${{ inputs.file_ref }}-ubuntu-2204.tar.gz
tar zxf hdf5-${{ inputs.file_ref }}-ubuntu-2204_gcc.tar.gz
- name: List files for the space (Linux)
run: |
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/cmake-bintest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ jobs:
ls ${{ runner.workspace }}
# symlinks the compiler executables to a common location
# - name: Setup GNU Fortran
# uses: fortran-lang/setup-fortran@v1
# id: setup-fortran
# with:
# compiler: gcc
# version: 12
- name: Setup GNU Fortran
uses: fortran-lang/setup-fortran@v1
id: setup-fortran
with:
compiler: gcc
version: 12

- name: Run ctest (MacOS)
id: run-ctest
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/testxpr-cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ jobs:
working-directory: ${{ runner.workspace }}/build

- name: CMake Run Tests
env:
HDF5TestExpress: 0
run: ctest . --parallel 2 -C ${{ matrix.build_mode }} -V -R H5TESTXPR
working-directory: ${{ runner.workspace }}/build

1 change: 0 additions & 1 deletion c++/test/dsets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
EXTERNAL ROUTINES/VARIABLES:
These routines are in the test directory of the C library:
h5_reset() -- in h5test.c, resets the library by closing it
h5_fileaccess() -- in h5test.c, returns a file access template
***************************************************************************/
Expand Down
3 changes: 2 additions & 1 deletion c++/test/tlinks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,8 @@ test_links()
/* Close 2nd FAPL */
H5Pclose(fapl2_id);

h5_clean_files(FILENAME, fapl_id);
h5_delete_all_test_files(FILENAME, fapl_id);
H5Pclose(fapl_id);
}
catch (Exception &E) {
issue_fail_msg("test_links()", __LINE__, __FILE__, E.getCDetailMsg());
Expand Down
8 changes: 4 additions & 4 deletions config/cmake/LIBAEC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ set (CMAKE_POSITION_INDEPENDENT_CODE ON)
set (EXE_EXT "")
if (WIN32)
set (EXE_EXT ".exe")
add_definitions (-D_BIND_TO_CURRENT_VCLIBS_VERSION=1)
add_definitions (-D_CRT_SECURE_NO_WARNINGS)
add_definitions (-D_CONSOLE)
add_compile_definitions (_BIND_TO_CURRENT_VCLIBS_VERSION=1)
add_compile_definitions (_CRT_SECURE_NO_WARNINGS)
add_compile_definitions (_CONSOLE)
endif ()

if (MSVC)
Expand Down Expand Up @@ -161,7 +161,7 @@ configure_file(
#-----------------------------------------------------------------------------
# All libs/tests/examples need the main include directories
#-----------------------------------------------------------------------------
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES
"${LIBAEC_BINARY_DIR};${LIBAEC_SOURCE_DIR}/src;${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
)

Expand Down
2 changes: 1 addition & 1 deletion config/cmake/LIBAEC/CPack.Info.plist.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>@CPACK_PACKAGE_VERSIO@</string>
<string>@CPACK_PACKAGE_VERSION@</string>
<key>CFBundleShortVersionString</key>
<string>@CPACK_SHORT_VERSION_STRING@</string>
<key>CSResourcesFileMapped</key>
Expand Down
2 changes: 1 addition & 1 deletion config/cmake/ZLIB/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ HDF_DIR_PATHS(ZLIB)
#-----------------------------------------------------------------------------
# All libs/tests/examples need the main include directories
#-----------------------------------------------------------------------------
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES
set_directory_properties(PROPERTIES INCLUDE_DIRECTORIES
"${ZLIB_BINARY_DIR};${ZLIB_SOURCE_DIR};${CMAKE_RUNTIME_OUTPUT_DIRECTORY}"
)

Expand Down
2 changes: 1 addition & 1 deletion java/src/hdf/overview.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,6 @@ <h3>
and the HDF5 library.

<h3>To Obtain</h3>
The JHI5 is included with the <a href="https://portal.hdfgroup.org/downloads/index.html">HDF5</a> library.
The JHI5 is included with the <a href="https://support.hdfgroup.org/downloads/index.html">HDF5</a> library.

</body>
2 changes: 1 addition & 1 deletion test/accum.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ main(void)
puts("Testing the metadata accumulator");

/* File access property list */
h5_reset();
h5_test_init();
if ((fapl = h5_fileaccess()) < 0)
FAIL_STACK_ERROR;
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
Expand Down
2 changes: 1 addition & 1 deletion test/accum_swmr_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ main(void)
bool api_ctx_pushed = false; /* Whether API context pushed */

/* Testing setup */
h5_reset();
h5_test_init();

/* Skip this test if SWMR I/O is not supported for the VFD specified
* by the environment variable.
Expand Down
6 changes: 3 additions & 3 deletions test/app_ref.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ main(void)
int i;
char filename[1024];

h5_reset();
h5_test_init();
h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof filename);

HDsrand((unsigned)time(NULL));
Expand Down Expand Up @@ -179,11 +179,11 @@ main(void)

PASSED();

/* Restore the default error handler (set in h5_reset()) */
/* Restore the default error handler (set in h5_test_init()) */
h5_restore_err();

/* Clean up any file(s) created */
h5_reset();
h5_test_init();
fapl = H5Pcreate(H5P_FILE_ACCESS);
h5_cleanup(FILENAME, fapl);

Expand Down
9 changes: 6 additions & 3 deletions test/big.c
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,8 @@ test_sec2(hid_t fapl)
quit:
/* End with normal return code */
/* Clean up the test file */
h5_clean_files(FILENAME, fapl);
h5_delete_all_test_files(FILENAME, fapl);
H5Pclose(fapl);
HDremove(DNAME);
return 0;

Expand Down Expand Up @@ -628,7 +629,8 @@ test_stdio(hid_t fapl)
quit:
/* End with normal return code */
/* Clean up the test file */
h5_clean_files(FILENAME, fapl);
h5_delete_all_test_files(FILENAME, fapl);
H5Pclose(fapl);
HDremove(DNAME);
fflush(stdout);
return 0;
Expand Down Expand Up @@ -683,7 +685,8 @@ test_family(hid_t fapl)
quit:
/* End with normal return code */
/* Clean up the test file */
h5_clean_files(FILENAME, fapl);
h5_delete_all_test_files(FILENAME, fapl);
H5Pclose(fapl);
HDremove(DNAME);
return 0;

Expand Down
16 changes: 7 additions & 9 deletions test/btree2.c
Original file line number Diff line number Diff line change
Expand Up @@ -9915,22 +9915,20 @@ main(void)
hid_t fapl = H5I_INVALID_HID; /* File access property list for data files */
unsigned nerrors = 0; /* Cumulative error count */
unsigned reopen; /* Whether to reopen B-tree during tests */
int ExpressMode;
const char *driver_name;
bool api_ctx_pushed = false; /* Whether API context pushed */

driver_name = h5_get_test_driver_name();

/* Reset library */
h5_reset();
fapl = h5_fileaccess();
ExpressMode = GetTestExpress();
h5_test_init();
fapl = h5_fileaccess();

/* For the Direct I/O driver, skip intensive tests due to poor performance */
if (!strcmp(driver_name, "direct"))
ExpressMode = 2;
SetTestExpress(2);

if (ExpressMode > 1)
if (TestExpress > 1)
printf("***Express test mode on. Some tests may be skipped\n");

/* Initialize v2 B-tree creation parameters */
Expand Down Expand Up @@ -9967,7 +9965,7 @@ main(void)
nerrors += test_insert_level2_2internal_split(fapl, &cparam, &tparam);
nerrors += test_insert_level2_3internal_redistrib(fapl, &cparam, &tparam);
nerrors += test_insert_level2_3internal_split(fapl, &cparam, &tparam);
if (ExpressMode > 1)
if (TestExpress > 1)
printf("***Express test mode on. test_insert_lots skipped\n");
else
nerrors += test_insert_lots(fapl, &cparam, &tparam);
Expand All @@ -9981,7 +9979,7 @@ main(void)
nerrors += test_update_level1_3leaf_redistrib(fapl, &cparam2, &tparam);
nerrors += test_update_level1_middle_split(fapl, &cparam2, &tparam);
nerrors += test_update_make_level2(fapl, &cparam2, &tparam);
if (ExpressMode > 1)
if (TestExpress > 1)
printf("***Express test mode on. test_update_lots skipped\n");
else
nerrors += test_update_lots(fapl, &cparam2, &tparam);
Expand All @@ -10008,7 +10006,7 @@ main(void)
nerrors += test_remove_level2_2internal_merge_right(fapl, &cparam, &tparam);
nerrors += test_remove_level2_3internal_merge(fapl, &cparam, &tparam);
nerrors += test_remove_level2_collapse_right(fapl, &cparam, &tparam);
if (ExpressMode > 1)
if (TestExpress > 1)
printf("***Express test mode on. test_remove_lots skipped\n");
else
nerrors += test_remove_lots(driver_name, fapl, &cparam);
Expand Down
5 changes: 3 additions & 2 deletions test/cache_logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ test_logging_api(void)
TEST_ERROR;

HDremove(LOG_LOCATION);
h5_clean_files(FILENAME, fapl);
h5_delete_all_test_files(FILENAME, fapl);
H5Pclose(fapl);

PASSED();
return 0;
Expand Down Expand Up @@ -163,7 +164,7 @@ main(void)
int nerrors = 0;

/* Reset library */
h5_reset();
h5_test_init();

printf("Testing basic metadata cache logging functionality.\n");

Expand Down
2 changes: 1 addition & 1 deletion test/chunk_info.c
Original file line number Diff line number Diff line change
Expand Up @@ -2445,7 +2445,7 @@ main(void)
hid_t fapl = H5I_INVALID_HID; /* File access property list */
int nerrors = 0; /* Number of errors so far */

h5_reset();
h5_test_init();

/* Create a copy of file access property list */
if ((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0)
Expand Down
2 changes: 1 addition & 1 deletion test/cmpd_dset.c
Original file line number Diff line number Diff line change
Expand Up @@ -3334,7 +3334,7 @@ main(int argc, char *argv[])
char fname[256];
unsigned nerrors = 0;

h5_reset();
h5_test_init();

/* Turn off optimized compound converter? */
if (argc > 1) {
Expand Down
2 changes: 1 addition & 1 deletion test/cross_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ main(void)
char filename[1024];
int nerrors = 0;

h5_reset();
h5_test_init();

/*
* Skip tests for VFDs that aren't compatible with default VFD.
Expand Down
2 changes: 1 addition & 1 deletion test/del_many_dense_attrs.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ main(void)
int i; /* Local index variable */

/* Testing setup */
h5_reset();
h5_test_init();

/* To exit from the file for SIGABRT signal */
if (signal(SIGABRT, catch_signal) == SIG_ERR)
Expand Down
2 changes: 1 addition & 1 deletion test/dsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -15957,7 +15957,7 @@ main(void)
check_dbl[i] = check_dbl_data + (i * DSET_DIM2);

/* Testing setup */
h5_reset();
h5_test_init();
fapl = h5_fileaccess();

if (h5_driver_is_default_vfd_compatible(fapl, &driver_is_default_compatible) < 0)
Expand Down
Loading

0 comments on commit e6f8118

Please sign in to comment.