diff options
author | Jacob Smith <jake.smith@hdfgroup.org> | 2019-09-23 22:23:02 (GMT) |
---|---|---|
committer | Jacob Smith <jake.smith@hdfgroup.org> | 2019-09-23 22:23:02 (GMT) |
commit | 35a9e9c50fbbab20ed920daa3daf903d82cd79d7 (patch) | |
tree | 90299be3be2ffe9eb0e53b530eca309d789ac6c0 /tools/test | |
parent | 1070468dac5d0fd5e02b69514d7a0dfacfd28606 (diff) | |
parent | 7997eb8c84dd07dacbcc427049f838d883e263b8 (diff) | |
download | hdf5-35a9e9c50fbbab20ed920daa3daf903d82cd79d7.zip hdf5-35a9e9c50fbbab20ed920daa3daf903d82cd79d7.tar.gz hdf5-35a9e9c50fbbab20ed920daa3daf903d82cd79d7.tar.bz2 |
Merge branch 'develop' of https://bitbucket.hdfgroup.org/scm/~jake.smith/hdf5 into bugfix/repack_external_storage
Diffstat (limited to 'tools/test')
53 files changed, 2189 insertions, 3382 deletions
diff --git a/tools/test/h5copy/CMakeLists.txt b/tools/test/h5copy/CMakeLists.txt index ecf371f..1130ea7 100644 --- a/tools/test/h5copy/CMakeLists.txt +++ b/tools/test/h5copy/CMakeLists.txt @@ -11,7 +11,7 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) target_link_libraries (h5copygentest PRIVATE ${HDF5_LIB_TARGET}) set_target_properties (h5copygentest PROPERTIES FOLDER generator/tools) - #add_test (NAME h5copygentest COMMAND $<TARGET_FILE:h5copygentest>) + #add_test (NAME h5copygentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copygentest>) endif () #----------------------------------------------------------------------------- diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index df56f1a..b0d1615 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -65,15 +65,13 @@ # Remove any output file left over from previous test run add_test ( NAME H5COPY_F-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${testname}.out.h5 + COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 ) endif () add_test ( NAME H5COPY_F-${testname} - COMMAND $<TARGET_FILE:h5copy${tgt_ext}> -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) if (HDF5_ENABLE_USING_MEMCHECKER) if (last_test) @@ -87,7 +85,7 @@ if (NOT ${resultcode} EQUAL 2) add_test ( NAME H5COPY_F-${testname}-DIFF - COMMAND $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES DEPENDS H5COPY_F-${testname}) if (${resultcode} EQUAL 1) @@ -101,15 +99,13 @@ # Remove any output file left over from previous test run add_test ( NAME H5COPY-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${testname}.out.h5 + COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 ) endif () add_test ( NAME H5COPY-${testname} - COMMAND $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) if (HDF5_ENABLE_USING_MEMCHECKER) if (last_test) @@ -123,7 +119,7 @@ if (NOT ${resultcode} EQUAL 2) add_test ( NAME H5COPY-${testname}-DIFF - COMMAND $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) if (${resultcode} EQUAL 1) @@ -147,15 +143,13 @@ # Remove any output file left over from previous test run add_test ( NAME H5COPY-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${testname}.out.h5 + COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 ) endif () add_test ( NAME H5COPY-${testname}-prefill - COMMAND $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} ) if (HDF5_ENABLE_USING_MEMCHECKER) if (last_test) @@ -167,14 +161,14 @@ add_test ( NAME H5COPY-${testname} - COMMAND $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-prefill) # resultcode=2 will cause the test to skip the diff test if (NOT ${resultcode} EQUAL 2) add_test ( NAME H5COPY-${testname}-DIFF - COMMAND $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${infile} ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES DEPENDS H5COPY-${testname}) if (${resultcode} EQUAL 1) @@ -188,15 +182,13 @@ # Remove any output file left over from previous test run add_test ( NAME H5COPY_SAME-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${testname}.out.h5 + COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 ) endif () add_test ( NAME H5COPY_SAME-${testname}-prefill - COMMAND $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${pfile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${pfile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} ) if (HDF5_ENABLE_USING_MEMCHECKER) if (last_test) @@ -208,14 +200,14 @@ add_test ( NAME H5COPY_SAME-${testname} - COMMAND $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${testname}.out.h5 -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${testname}.out.h5 -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) set_tests_properties (H5COPY_SAME-${testname} PROPERTIES DEPENDS H5COPY_SAME-${testname}-prefill) # resultcode=2 will cause the test to skip the diff test if (NOT ${resultcode} EQUAL 2) add_test ( NAME H5COPY_SAME-${testname}-DIFF - COMMAND $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> -v ./testfiles/${testname}.out.h5 ./testfiles/${testname}.out.h5 ${srcname} ${dstname} ) set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES DEPENDS H5COPY_SAME-${testname}) if (${resultcode} EQUAL 1) @@ -231,7 +223,7 @@ macro (ADD_H5_CMP_TEST testname resultcode infile vparam sparam srcname dparam dstname) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5COPY-CMP-${testname} COMMAND $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) + add_test (NAME H5COPY-CMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) if (${resultcode} EQUAL 1) set_tests_properties (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") endif () @@ -242,15 +234,12 @@ # Remove any output file left over from previous test run add_test ( NAME H5COPY-CMP-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/${testname}.out.h5 - ./testfiles/${testname}.out.out - ./testfiles/${testname}.out.out.err + COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 ) add_test ( NAME H5COPY-CMP-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5copy${tgt_ext}>" -D "TEST_ARGS=-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${vparam};${sparam};${srcname};${dparam};${dstname}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -270,18 +259,13 @@ # Remove any output file left over from previous test run add_test ( NAME H5COPY_UD-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/${testname}.out.h5 - testfiles/${infile}.out - testfiles/${infile}.out.err - testfiles/${testname}.out.h5.out - testfiles/${testname}.out.h5.out.err + COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testname}.out.h5 ) if (${resultcode} EQUAL 2) add_test ( NAME H5COPY_UD-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5copy-shared>" -D "TEST_ARGS:STRING=-v;-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${sparam};${srcname};${dparam};${dstname}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -298,6 +282,7 @@ add_test ( NAME H5COPY_UD-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5copy-shared>" -D "TEST_ARGS:STRING=-v;-i;./testfiles/${infile};-o;./testfiles/${testname}.out.h5;${sparam};${srcname};${dparam};${dstname}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -315,6 +300,7 @@ add_test ( NAME H5COPY_UD-${testname}-DIFF COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>" -D "TEST_ARGS:STRING=-v;./testfiles/${cmpfile};./testfiles/${testname}.out.h5;${srcname};${dstname}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -336,18 +322,13 @@ # Remove any output file left over from previous test run add_test ( NAME H5COPY_UD_ERR-${testname}-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/${testname}_ERR.out.h5 - testfiles/${infile}_ERR.out - testfiles/${infile}_ERR.out.err - testfiles/${testname}_ERR.out.h5.out - testfiles/${testname}_ERR.out.h5.out.err + COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testname}_ERR.out.h5 ) if (${resultcode} EQUAL 2) add_test ( NAME H5COPY_UD_ERR-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5copy-shared>" -D "TEST_ARGS:STRING=-v;--enable-error-stack;-i;./testfiles/${infile};-o;./testfiles/${testname}_ERR.out.h5;${sparam};${srcname};${dparam};${dstname}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -365,6 +346,7 @@ add_test ( NAME H5COPY_UD_ERR-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5copy-shared>" -D "TEST_ARGS:STRING=-v;--enable-error-stack;-i;./testfiles/${infile};-o;./testfiles/${testname}_ERR.out.h5;${sparam};${srcname};${dparam};${dstname}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -383,6 +365,7 @@ add_test ( NAME H5COPY_UD_ERR-${testname}-DIFF COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>" -D "TEST_ARGS:STRING=-v;./testfiles/${cmpfile};./testfiles/${testname}_ERR.out.h5;${srcname};${dstname}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -417,8 +400,7 @@ # Remove any output file left over from previous test run add_test ( NAME H5COPY-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove + COMMAND ${CMAKE_COMMAND} -E remove simple.out.h5 chunk.out.h5 compact.out.h5 @@ -451,8 +433,6 @@ samefile1.out.h5 samefile2.out.h5 h5copy_misc1.out.h5 - h5copy_misc1.out.out - h5copy_misc1.out.out.err ) set_tests_properties (H5COPY-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (last_test) diff --git a/tools/test/h5copy/h5copygentest.c b/tools/test/h5copy/h5copygentest.c index 9f5d916..f6aa72f 100644 --- a/tools/test/h5copy/h5copygentest.c +++ b/tools/test/h5copy/h5copygentest.c @@ -326,7 +326,7 @@ static void gent_nested_vl(hid_t loc_id) * Function: gent_att_compound_vlstr * * Purpose: Generate a dataset and a group. - * Both has an attribute with a compound datatype consisting + * Both has an attribute with a compound datatype consisting * of a variable length string * *------------------------------------------------------------------------- @@ -337,15 +337,15 @@ static void gent_att_compound_vlstr(hid_t loc_id) int i; const char *v; } s1; - hsize_t dim[1] = {1}; /* Dimension size */ - hid_t sid = -1; /* Dataspace ID */ - hid_t tid = -1; /* Datatype ID */ - hid_t aid = -1; /* Attribute ID */ - hid_t did = -1; /* Dataset ID */ - hid_t gid = -1; /* Group ID */ - hid_t vl_str_tid = -1; /* Variable length datatype ID */ - hid_t cmpd_tid = -1; /* Compound datatype ID */ - hid_t null_sid = -1; /* Null dataspace ID */ + hsize_t dim[1] = {1}; /* Dimension size */ + hid_t sid = -1; /* Dataspace ID */ + hid_t tid = -1; /* Datatype ID */ + hid_t aid = -1; /* Attribute ID */ + hid_t did = -1; /* Dataset ID */ + hid_t gid = -1; /* Group ID */ + hid_t vl_str_tid = -1; /* Variable length datatype ID */ + hid_t cmpd_tid = -1; /* Compound datatype ID */ + hid_t null_sid = -1; /* Null dataspace ID */ s1 buf; /* Buffer */ buf.i = 9; @@ -509,7 +509,7 @@ static herr_t gen_obj_ref(hid_t loc_id) sid = H5Screate_simple(1, dims1, NULL); if (sid < 0) { - fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -517,7 +517,7 @@ static herr_t gen_obj_ref(hid_t loc_id) oid = H5Dcreate2 (loc_id, OBJ_REF_DS, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (oid < 0) { - fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -525,7 +525,7 @@ static herr_t gen_obj_ref(hid_t loc_id) status = H5Dwrite(oid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -538,7 +538,7 @@ static herr_t gen_obj_ref(hid_t loc_id) oid = H5Gcreate2 (loc_id, OBJ_REF_GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (oid < 0) { - fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -547,14 +547,14 @@ static herr_t gen_obj_ref(hid_t loc_id) status = H5Rcreate (&or_data[0], loc_id, OBJ_REF_DS, H5R_OBJECT, (hid_t)-1); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } status = H5Rcreate (&or_data[1], loc_id, OBJ_REF_GRP, H5R_OBJECT, (hid_t)-1); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -562,7 +562,7 @@ static herr_t gen_obj_ref(hid_t loc_id) sid = H5Screate_simple (1, dims2, NULL); if (sid < 0) { - fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -570,7 +570,7 @@ static herr_t gen_obj_ref(hid_t loc_id) oid = H5Dcreate2 (loc_id, "Dset_OBJREF", H5T_STD_REF_OBJ, sid, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT); if (oid < 0) { - fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -578,7 +578,7 @@ static herr_t gen_obj_ref(hid_t loc_id) status = H5Dwrite(oid, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, or_data); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -618,7 +618,7 @@ static herr_t gen_region_ref(hid_t loc_id) sid = H5Screate_simple (2, dims2, NULL); if (sid < 0) { - fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -627,7 +627,7 @@ static herr_t gen_region_ref(hid_t loc_id) oid2 = H5Dcreate2 (loc_id, REG_REF_DS2, H5T_STD_I8LE, sid, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT); if (oid2 < 0) { - fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -636,7 +636,7 @@ static herr_t gen_region_ref(hid_t loc_id) status = H5Dwrite (oid2, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -645,7 +645,7 @@ static herr_t gen_region_ref(hid_t loc_id) status = H5Sselect_elements (sid, H5S_SELECT_SET, 4, coords[0]); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -654,7 +654,7 @@ static herr_t gen_region_ref(hid_t loc_id) status = H5Rcreate (&rr_data[0], loc_id, REG_REF_DS2, H5R_DATASET_REGION, sid); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -663,7 +663,7 @@ static herr_t gen_region_ref(hid_t loc_id) status = H5Sselect_hyperslab (sid, H5S_SELECT_SET, start, stride, count, block); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -672,7 +672,7 @@ static herr_t gen_region_ref(hid_t loc_id) status = H5Rcreate (&rr_data[1], loc_id, REG_REF_DS2, H5R_DATASET_REGION, sid); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -683,7 +683,7 @@ static herr_t gen_region_ref(hid_t loc_id) sid = H5Screate_simple (1, dims1, NULL); if (sid < 0) { - fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -692,7 +692,7 @@ static herr_t gen_region_ref(hid_t loc_id) oid1 = H5Dcreate2 (loc_id, REG_REF_DS1, H5T_STD_REF_DSETREG, sid, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT); if (oid1 < 0) { - fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -701,7 +701,7 @@ static herr_t gen_region_ref(hid_t loc_id) status = H5Dwrite (oid1, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rr_data); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -725,30 +725,30 @@ out: *------------------------------------------------------------------------*/ static void Test_Obj_Copy(void) { - hid_t fid = -1; /* File id */ - hid_t fapl_new = (-1); /* File access property id */ - unsigned new_format; /* New format or old format */ + hid_t fid = -1; /* File id */ + hid_t fapl_new = (-1); /* File access property id */ + unsigned new_format; /* New format or old format */ if((fapl_new = H5Pcreate(H5P_FILE_ACCESS)) < 0) { - fprintf(stderr, "Error: H5Pcreate failed.\n"); + HDfprintf(stderr, "Error: H5Pcreate failed.\n"); goto out; } if(H5Pset_libver_bounds(fapl_new, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) { - fprintf(stderr, "Error: H5Pset_libver_bounds failed.\n"); + HDfprintf(stderr, "Error: H5Pset_libver_bounds failed.\n"); goto out; } /* Test with old & new format groups */ for(new_format = FALSE; new_format <= TRUE; new_format++) { - + /* Set the FAPL for the type of format */ /* Create source file */ if(new_format) - fid = H5Fcreate(HDF_FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_new); - else - fid = H5Fcreate(HDF_FILE1_NEW, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); + fid = H5Fcreate(HDF_FILE1, H5F_ACC_TRUNC, H5P_DEFAULT, fapl_new); + else + fid = H5Fcreate(HDF_FILE1_NEW, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if(fid < 0) { - fprintf(stderr, "Error: H5Fcreate failed.\n"); + HDfprintf(stderr, "Error: H5Fcreate failed.\n"); goto out; } @@ -756,7 +756,7 @@ static void Test_Obj_Copy(void) gent_empty_group(fid); gent_nested_datasets(fid); gent_nested_group(fid); - gent_att_compound_vlstr(fid); + gent_att_compound_vlstr(fid); H5Fclose(fid); fid = (-1); @@ -786,19 +786,19 @@ static void Test_Ref_Copy(void) fid = H5Fcreate (HDF_FILE2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_FILE2); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_FILE2); goto out; } /* add object reference */ status = gen_obj_ref(fid); if (status < 0) - fprintf(stderr, "Failed to generate object reference.\n"); + HDfprintf(stderr, "Failed to generate object reference.\n"); /* add region reference */ status = gen_region_ref(fid); if (status < 0) - fprintf(stderr, "Failed to generate region reference.\n"); + HDfprintf(stderr, "Failed to generate region reference.\n"); out: /*----------------------------------------------------------------------- @@ -829,7 +829,7 @@ static herr_t gen_extlink_trg(hid_t loc_id) gid = H5Gcreate2(loc_id, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid < 0) { - fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -845,7 +845,7 @@ static herr_t gen_extlink_trg(hid_t loc_id) status = H5Tcommit2(loc_id, "datatype", tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -878,7 +878,7 @@ static herr_t gen_extlink_src(hid_t loc_id) gid = H5Gcreate2(loc_id, "/group_ext", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid < 0) { - fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -890,7 +890,7 @@ static herr_t gen_extlink_src(hid_t loc_id) status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/simple", gid, "extlink_dset", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -899,7 +899,7 @@ static herr_t gen_extlink_src(hid_t loc_id) status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/group", gid, "extlink_grp", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -908,7 +908,7 @@ static herr_t gen_extlink_src(hid_t loc_id) status = H5Lcreate_external(HDF_EXT_TRG_FILE, "/datatype", gid, "extlink_datatype", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -917,7 +917,7 @@ static herr_t gen_extlink_src(hid_t loc_id) status = H5Lcreate_external(HDF_EXT_TRG_FILE, "notyet", gid, "extlink_notyet1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -926,7 +926,7 @@ static herr_t gen_extlink_src(hid_t loc_id) status = H5Lcreate_external("notyet_file.h5", "notyet", gid, "extlink_notyet2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Lcreate_external failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -953,26 +953,26 @@ static void Test_Extlink_Copy(void) fid1 = H5Fcreate (HDF_EXT_SRC_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_EXT_SRC_FILE); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_EXT_SRC_FILE); goto out; } fid2 = H5Fcreate (HDF_EXT_TRG_FILE, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid2 < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_EXT_TRG_FILE); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", HDF_EXT_TRG_FILE); goto out; } /* add links to source external link file */ status = gen_extlink_src(fid1); if (status < 0) - fprintf(stderr, "Error: %s> gen_extlink_src failed.\n", HDF_EXT_SRC_FILE); + HDfprintf(stderr, "Error: %s> gen_extlink_src failed.\n", HDF_EXT_SRC_FILE); /* add objs to target external link file */ status = gen_extlink_trg(fid2); if (status < 0) - fprintf(stderr, "Error: %s> gen_extlink_trg failed.\n", HDF_EXT_TRG_FILE); + HDfprintf(stderr, "Error: %s> gen_extlink_trg failed.\n", HDF_EXT_TRG_FILE); out: /*----------------------------------------------------------------------- diff --git a/tools/test/h5copy/testh5copy.sh.in b/tools/test/h5copy/testh5copy.sh.in index 50758b5..2440ca4 100644 --- a/tools/test/h5copy/testh5copy.sh.in +++ b/tools/test/h5copy/testh5copy.sh.in @@ -504,22 +504,21 @@ fi TOOLTEST -i $TESTFILE -o $TESTDIR/dsrename.out.h5 -v -s compound -d rename echo "Test copying empty, 'full' & 'nested' groups" -if test $USE_FILTER_DEFLATE = "yes" ; then TOOLTEST -i $TESTFILE -o $TESTDIR/grp_empty.out.h5 -v -s grp_empty -d grp_empty -fi +if test $USE_FILTER_DEFLATE = "yes" ; then TOOLTEST -i $TESTFILE -o $TESTDIR/grp_dsets.out.h5 -v -s grp_dsets -d grp_dsets TOOLTEST -i $TESTFILE -o $TESTDIR/grp_nested.out.h5 -v -s grp_nested -d grp_nested +fi TOOLTEST -i $TESTFILE -o $TESTDIR/grp_attr.out.h5 -v -s grp_attr -d grp_attr -if test $USE_FILTER_DEFLATE = "yes" ; then echo "Test copying dataset within group in source file to group in destination" TOOLTEST_PREFILL -i $TESTFILE -o $TESTDIR/simple_group.out.h5 grp_dsets grp_dsets /grp_dsets/simple /grp_dsets/simple_group +if test $USE_FILTER_DEFLATE = "yes" ; then echo "Test copying & renaming group" TOOLTEST -i $TESTFILE -o $TESTDIR/grp_rename.out.h5 -v -s grp_dsets -d grp_rename -fi - echo "Test copying 'full' group hierarchy into group in destination file" TOOLTEST_PREFILL -i $TESTFILE -o $TESTDIR/grp_dsets_rename.out.h5 grp_dsets grp_rename grp_dsets /grp_rename/grp_dsets +fi echo "Test copying objects into group hier. that doesn't exist yet in destination file" TOOLTEST -i $TESTFILE -o $TESTDIR/A_B1_simple.out.h5 -vp -s simple -d /A/B1/simple diff --git a/tools/test/h5diff/CMakeLists.txt b/tools/test/h5diff/CMakeLists.txt index 0a874ec..cb4397f 100644 --- a/tools/test/h5diff/CMakeLists.txt +++ b/tools/test/h5diff/CMakeLists.txt @@ -11,7 +11,7 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) target_link_libraries (h5diffgentest PRIVATE ${HDF5_LIB_TARGET}) set_target_properties (h5diffgentest PROPERTIES FOLDER generator/tools) - #add_test (NAME h5diffgentest COMMAND $<TARGET_FILE:h5diffgentest>) + #add_test (NAME h5diffgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diffgentest>) endif () #----------------------------------------------------------------------------- diff --git a/tools/test/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 604c8a5..93dfd72 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -324,7 +324,14 @@ # # Overwrite system dependent files (Windows) and not VS2015 # + set (COPY_WINDOWS_FILES false) + if (MINGW) + set (COPY_WINDOWS_FILES true) + endif () if (WIN32 AND MSVC_VERSION LESS 1900) + set (COPY_WINDOWS_FILES true) + endif () + if (COPY_WINDOWS_FILES) foreach (h5_tstfiles ${LIST_WIN_TEST_FILES}) get_filename_component(fname "${h5_tstfiles}" NAME) HDFTEST_COPY_FILE("${HDF5_TOOLS_TEST_H5DIFF_SOURCE_DIR}/testfiles/${h5_tstfiles}w.txt" "${PROJECT_BINARY_DIR}/testfiles/${fname}.txt" "h5diff_files") @@ -358,7 +365,7 @@ macro (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DIFF-${resultfile} COMMAND $<TARGET_FILE:h5diff${tgt_ext}> ${ARGN}) + add_test (NAME H5DIFF-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> ${ARGN}) set_tests_properties (H5DIFF-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (${resultcode}) set_tests_properties (H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") @@ -367,20 +374,10 @@ set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) endif () else () - # Remove any output file left over from previous test run - add_test ( - NAME H5DIFF-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/${resultfile}.out - testfiles/${resultfile}.out.err - ) - if (last_test) - set_tests_properties (H5DIFF-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () add_test ( NAME H5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5diff${tgt_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -390,7 +387,9 @@ -D "TEST_APPEND=EXIT CODE:" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS H5DIFF-${resultfile}-clear-objects) + if (last_test) + set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif () endif () if (H5_HAVE_PARALLEL) ADD_PH5_TEST (${resultfile} ${resultcode} ${ARGN}) @@ -409,17 +408,6 @@ set_tests_properties (MPI_TEST_H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) endif () else () - # Remove any output file left over from previous test run - add_test ( - NAME MPI_TEST_H5DIFF-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - PAR/testfiles/${resultfile}.out - PAR/testfiles/${resultfile}.out.err - ) - if (last_test) - set_tests_properties (MPI_TEST_H5DIFF-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () add_test ( NAME MPI_TEST_H5DIFF-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -435,25 +423,20 @@ -D "TEST_SORT_COMPARE=TRUE" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (MPI_TEST_H5DIFF-${resultfile} PROPERTIES DEPENDS MPI_TEST_H5DIFF-${resultfile}-clear-objects) + if (last_test) + set_tests_properties (MPI_TEST_H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) + endif () set (last_test "PH5DIFF-${resultfile}") endif () endmacro () macro (ADD_H5_UD_TEST testname resultcode resultfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - add_test ( - NAME H5DIFF_UD-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/${resultfile}.out - testfiles/${resultfile}.out.err - ) if (${resultcode} EQUAL 2) add_test ( NAME H5DIFF_UD-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -470,6 +453,7 @@ add_test ( NAME H5DIFF_UD-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5diff-shared>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -483,7 +467,9 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () - set_tests_properties (H5DIFF_UD-${testname} PROPERTIES DEPENDS H5DIFF_UD-${testname}-clear-objects) + if (last_test) + set_tests_properties (H5DIFF_UD-${testname} PROPERTIES DEPENDS ${last_test}) + endif () endif () endmacro () diff --git a/tools/test/h5diff/h5diffgentest.c b/tools/test/h5diff/h5diffgentest.c index 4f92cae..d60e393 100644 --- a/tools/test/h5diff/h5diffgentest.c +++ b/tools/test/h5diff/h5diffgentest.c @@ -310,11 +310,11 @@ int test_basic(const char *fname1, const char *fname2, const char *fname3) /* create the empty file */ if ((fid1 = H5Fcreate(fname3, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - fprintf(stderr, "empty file (%s) creation failed.\n", fname3); + HDfprintf(stderr, "empty file (%s) creation failed.\n", fname3); goto out; } if (H5Fclose(fid1) < 0) { - fprintf(stderr, "empty file (%s) close failed.\n", fname3); + HDfprintf(stderr, "empty file (%s) close failed.\n", fname3); goto out; } @@ -1065,7 +1065,7 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2) * Create file1 *-----------------------------------------------------------------------*/ if ((fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } @@ -1075,28 +1075,28 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2) */ f1_gid = H5Gcreate2(fid1, "g", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (f1_gid < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } f1_gid2 = H5Gcreate2(fid1, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (f1_gid2 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } f1_gid3 = H5Gcreate2(fid1, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (f1_gid3 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } f1_gid4 = H5Gcreate2(fid1, "g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (f1_gid4 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } @@ -1107,13 +1107,13 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2) f1_sid = H5Screate_simple(1, dset_dims, NULL); f1_did = H5Dcreate2(fid1, "dset", H5T_NATIVE_INT, f1_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (f1_did == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = H5Dwrite(f1_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data); if (status < 0) { - fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } @@ -1124,7 +1124,7 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2) f1_tid = H5Tcopy(H5T_NATIVE_INT); status = H5Tcommit2(fid1, "ntype", f1_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname1); status = FAIL; goto out; } @@ -1133,7 +1133,7 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2) * Create file2 *-----------------------------------------------------------------------*/ if ((fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; } @@ -1143,28 +1143,28 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2) */ f2_gid = H5Gcreate2(fid2, "g", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (f2_gid < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } f2_gid2 = H5Gcreate2(fid2, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (f2_gid2 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } f2_gid3 = H5Gcreate2(fid2, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (f2_gid3 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } f2_gid4 = H5Gcreate2(fid2, "g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (f2_gid4 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } @@ -1175,13 +1175,13 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2) f2_sid = H5Screate_simple(1, dset_dims, NULL); f2_did = H5Dcreate2(fid2, "dset", H5T_NATIVE_INT, f2_sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (f2_did == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = H5Dwrite(f2_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data); if (status < 0) { - fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname2); status = FAIL; goto out; } @@ -1192,7 +1192,7 @@ static int test_attributes_verbose_level(const char *fname1, const char *fname2) f2_tid = H5Tcopy(H5T_NATIVE_INT); status = H5Tcommit2(fid2, "ntype", f2_tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Tcommit2 failed.\n", fname2); status = FAIL; goto out; } @@ -1423,7 +1423,7 @@ static int test_link_name(const char *fname1) *------------------------------------------------------------------------*/ fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } @@ -1433,7 +1433,7 @@ static int test_link_name(const char *fname1) *------------------------------------------------------------------------*/ gid1 = H5Gcreate2(fid1, "group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid1 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } @@ -1441,7 +1441,7 @@ static int test_link_name(const char *fname1) H5P_DEFAULT); if (gid2 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } @@ -1451,14 +1451,14 @@ static int test_link_name(const char *fname1) *------------------------------------------------------------------------*/ status = H5Lcreate_soft("group", fid1, "link_g1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("group_longname", fid1, "link_g2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } @@ -1498,7 +1498,7 @@ static int test_soft_links(const char *fname1) *------------------------------------------------------------------------*/ fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } @@ -1508,7 +1508,7 @@ static int test_soft_links(const char *fname1) *------------------------------------------------------------------------*/ gid1 = H5Gcreate2(fid1, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid1 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } @@ -1519,21 +1519,21 @@ static int test_soft_links(const char *fname1) /* file1 */ status = write_dset(fid1, 2, dims2, "target_dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(fid1, 2, dims2, "target_dset2", H5T_NATIVE_INT, data2); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid1, 2, dims2, "dset", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } @@ -1544,42 +1544,42 @@ static int test_soft_links(const char *fname1) /* file 1 */ status = H5Lcreate_soft("/target_dset1", fid1, "softlink_dset1_1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/target_dset1", fid1, "softlink_dset1_2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/target_dset2", fid1, "softlink_dset2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/target_group", fid1, "softlink_group1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/target_group", fid1, "softlink_group2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/no_obj", fid1, "softlink_noexist", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } @@ -1619,7 +1619,7 @@ static int test_linked_softlinks(const char *fname1) *------------------------------------------------------------------------*/ fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } @@ -1629,21 +1629,21 @@ static int test_linked_softlinks(const char *fname1) *------------------------------------------------------------------------*/ gid1 = H5Gcreate2(fid1, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid1 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } gid2 = H5Gcreate2(fid1, "target_group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid2 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } gid3 = H5Gcreate2(fid1, "target_group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid3 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } @@ -1654,20 +1654,20 @@ static int test_linked_softlinks(const char *fname1) /* file1 */ status = write_dset(fid1, 2, dims2, "target_dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(fid1, 2, dims2, "target_dset2", H5T_NATIVE_INT, data2); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid1, 2, dims2, "dset", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } @@ -1679,84 +1679,84 @@ static int test_linked_softlinks(const char *fname1) * file 1 */ status = H5Lcreate_soft("/target_dset1", fid1, "softlink1_to_dset1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink1_to_dset1", fid1, "softlink1_to_slink1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink1_to_slink1", fid1, "softlink1_to_slink2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/target_dset2", fid1, "softlink2_to_dset2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink2_to_dset2", fid1, "softlink2_to_slink1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink2_to_slink1", fid1, "softlink2_to_slink2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("target_group1", fid1, "softlink3_to_group1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink3_to_group1", fid1, "softlink3_to_slink1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink3_to_slink1", fid1, "softlink3_to_slink2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("target_group2", fid1, "softlink4_to_group2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink4_to_group2", fid1, "softlink4_to_slink1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("softlink4_to_slink1", fid1, "softlink4_to_slink2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } @@ -1801,7 +1801,7 @@ static int test_external_links(const char *fname1, const char *fname2) /* source file */ fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } @@ -1809,7 +1809,7 @@ static int test_external_links(const char *fname1, const char *fname2) /* target file */ fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid2 < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; } @@ -1821,14 +1821,14 @@ static int test_external_links(const char *fname1, const char *fname2) * target file */ gid1 = H5Gcreate2(fid2, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid1 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } gid2 = H5Gcreate2(fid2, "target_group2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid2 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } @@ -1839,21 +1839,21 @@ static int test_external_links(const char *fname1, const char *fname2) * target file */ status = write_dset(fid2, 2, dims2, "target_dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid1, 2, dims2, "x_dset", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid2, 2, dims2, "x_dset", H5T_NATIVE_INT, data2); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } @@ -1865,42 +1865,42 @@ static int test_external_links(const char *fname1, const char *fname2) /* source file */ status = H5Lcreate_external(fname2, "/target_group/x_dset", fid1, "ext_link_dset1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/target_group2/x_dset", fid1, "ext_link_dset2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/target_group", fid1, "/ext_link_grp1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/target_group2", fid1, "/ext_link_grp2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "no_obj", fid1, "ext_link_noexist1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external("no_file.h5", "no_obj", fid1, "ext_link_noexist2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } @@ -1945,7 +1945,7 @@ static int test_ext2soft_links(const char *fname1, const char *fname2) /* source file */ fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } @@ -1953,7 +1953,7 @@ static int test_ext2soft_links(const char *fname1, const char *fname2) /* target file */ fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid2 < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; } @@ -1964,7 +1964,7 @@ static int test_ext2soft_links(const char *fname1, const char *fname2) /* target file */ gid2 = H5Gcreate2(fid2, "target_group", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid2 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } @@ -1976,14 +1976,14 @@ static int test_ext2soft_links(const char *fname1, const char *fname2) * target file */ status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data2); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(fid2, 2, dims2, "dset2", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } @@ -1995,14 +1995,14 @@ static int test_ext2soft_links(const char *fname1, const char *fname2) * target file */ status = H5Lcreate_soft("/dset1", fid2, "softlink_to_dset1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("/dset2", fid2, "softlink_to_dset2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } @@ -2014,21 +2014,21 @@ static int test_ext2soft_links(const char *fname1, const char *fname2) * source file */ status = H5Lcreate_external(fname2, "/target_group", fid1, "ext_link", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/softlink_to_dset1", fid1, "ext_link_to_slink1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/softlink_to_dset2", fid1, "ext_link_to_slink2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } @@ -2158,14 +2158,14 @@ static int test_dangle_links(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid2 < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; } @@ -2176,14 +2176,14 @@ static int test_dangle_links(const char *fname1, const char *fname2) /* file1 */ status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(fid1, 2, dims2, "dset2", H5T_NATIVE_INT, data2); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } @@ -2191,14 +2191,14 @@ static int test_dangle_links(const char *fname1, const char *fname2) /* file2 */ status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(fid2, 2, dims2, "dset2", H5T_NATIVE_INT, data2); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } @@ -2209,28 +2209,28 @@ static int test_dangle_links(const char *fname1, const char *fname2) /* file 1 */ status = H5Lcreate_soft("no_obj", fid1, "soft_link1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/dset1", fid1, "soft_link2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("no_obj", fid1, "soft_link3", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("no_obj1", fid1, "soft_link4", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } @@ -2238,28 +2238,28 @@ static int test_dangle_links(const char *fname1, const char *fname2) /* file 2 */ status = H5Lcreate_soft("no_obj", fid2, "soft_link1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("no_obj", fid2, "soft_link2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("/dset2", fid2, "soft_link3", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("no_obj2", fid2, "soft_link4", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } @@ -2270,28 +2270,28 @@ static int test_dangle_links(const char *fname1, const char *fname2) /* file1 */ status = H5Lcreate_external(fname2, "no_obj", fid1, "ext_link1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/dset1", fid1, "ext_link2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "no_obj", fid1, "ext_link3", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external("no_file.h5", "no_obj", fid1, "ext_link4", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } @@ -2299,28 +2299,28 @@ static int test_dangle_links(const char *fname1, const char *fname2) /* file2 */ status = H5Lcreate_external(fname1, "no_obj", fid2, "ext_link1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_external(fname1, "no_obj", fid2, "ext_link2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_external(fname1, "/dset2", fid2, "ext_link3", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_external("no_file.h5", "no_obj", fid2, "ext_link4", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } @@ -2361,14 +2361,14 @@ static int test_group_recurse(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid2 < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; } @@ -2379,28 +2379,28 @@ static int test_group_recurse(const char *fname1, const char *fname2) /* file1 */ gid1_f1 = H5Gcreate2(fid1, "/grp1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid1_f1 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } gid2_f1 = H5Gcreate2(fid1, "/grp1/grp2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid2_f1 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } gid3_f1 = H5Gcreate2(fid1, "/grp1/grp2/grp3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid3_f1 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } gid10_f1 = H5Gcreate2(fid1, "/grp10", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid10_f1 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } @@ -2408,28 +2408,28 @@ static int test_group_recurse(const char *fname1, const char *fname2) /* file2 */ gid1_f2 = H5Gcreate2(fid2, "/grp1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid1_f2 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } gid2_f2 = H5Gcreate2(fid2, "/grp1/grp2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid2_f2 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } gid3_f2 = H5Gcreate2(fid2, "/grp1/grp2/grp3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid3_f2 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } gid11_f2 = H5Gcreate2(fid2, "/grp11", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid11_f2 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } @@ -2440,21 +2440,21 @@ static int test_group_recurse(const char *fname1, const char *fname2) /* file1 */ status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(fid1, 2, dims2, "dset2", H5T_NATIVE_INT, data2); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(fid1, 2, dims2, "dset3", H5T_NATIVE_INT, data3); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } @@ -2462,21 +2462,21 @@ static int test_group_recurse(const char *fname1, const char *fname2) /* file2 */ status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(fid2, 2, dims2, "dset2", H5T_NATIVE_INT, data2); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(fid2, 2, dims2, "dset3", H5T_NATIVE_INT, data3); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } @@ -2487,54 +2487,54 @@ static int test_group_recurse(const char *fname1, const char *fname2) /* file1 */ status = write_dset(gid1_f1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid2_f1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid2_f1, 2, dims2, "dset2", H5T_NATIVE_INT, data2); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid3_f1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid3_f1, 2, dims2, "dset2", H5T_NATIVE_INT, data2); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid3_f1, 2, dims2, "dset3", H5T_NATIVE_INT, data3); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid10_f1, 2, dims2, "dset4", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid10_f1, 2, dims2, "dset5", H5T_NATIVE_INT, data3); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } @@ -2542,54 +2542,54 @@ static int test_group_recurse(const char *fname1, const char *fname2) /* file2 */ status = write_dset(gid1_f2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid2_f2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid2_f2, 2, dims2, "dset2", H5T_NATIVE_INT, data2); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid3_f2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid3_f2, 2, dims2, "dset2", H5T_NATIVE_INT, data2); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid3_f2, 2, dims2, "dset3", H5T_NATIVE_INT, data3); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid11_f2, 2, dims2, "dset4", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid11_f2, 2, dims2, "dset5", H5T_NATIVE_INT, data2); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } @@ -2600,28 +2600,28 @@ static int test_group_recurse(const char *fname1, const char *fname2) /* file 1 */ status = H5Lcreate_soft("/grp1", fid1, "slink_grp1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/grp1/grp2", fid1, "slink_grp2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/grp1/grp2/grp3", fid1, "slink_grp3", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_soft("/grp10", fid1, "slink_grp10", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname1); status = FAIL; goto out; } @@ -2629,28 +2629,28 @@ static int test_group_recurse(const char *fname1, const char *fname2) /* file 2 */ status = H5Lcreate_soft("/grp1", fid2, "slink_grp1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("/grp1/grp2", fid2, "slink_grp2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("/grp1/grp2/grp3", fid2, "slink_grp3", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_soft("/grp11", fid2, "slink_grp11", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", fname2); status = FAIL; goto out; } @@ -2661,21 +2661,21 @@ static int test_group_recurse(const char *fname1, const char *fname2) /* file1 */ status = H5Lcreate_external(fname2, "/grp1", fid1, "elink_grp1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/grp1/grp2", fid1, "elink_grp2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } status = H5Lcreate_external(fname2, "/grp1/grp2/grp3", fid1, "elink_grp3", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } @@ -2683,21 +2683,21 @@ static int test_group_recurse(const char *fname1, const char *fname2) /* file2 */ status = H5Lcreate_external(fname1, "/grp1", fid2, "elink_grp1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_external(fname1, "/grp1/grp2", fid2, "elink_grp2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } status = H5Lcreate_external(fname1, "/grp1/grp2/grp3", fid2, "elink_grp3", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } @@ -2709,14 +2709,14 @@ static int test_group_recurse(const char *fname1, const char *fname2) /* file1 */ status = H5Lcreate_external(fname2, "/grp11", gid10_f1, "elink_grp_circle", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname1); status = FAIL; goto out; } /* file2 */ status = H5Lcreate_external(fname1, "/grp10", gid11_f2, "elink_grp_circle", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", fname2); status = FAIL; goto out; } @@ -2790,28 +2790,28 @@ static int test_group_recurse2(void) *------------------------------------------------------------------------*/ grp1 = H5Gcreate2(fileid1, "/g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (grp1 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; } grp2 = H5Gcreate2(grp1, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (grp2 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; } grp3 = H5Gcreate2(grp2, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (grp3 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; } grp4 = H5Gcreate2(grp3, "g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (grp4 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; } @@ -2886,7 +2886,7 @@ static int test_group_recurse2(void) /* link to dset1 */ status = H5Lcreate_soft(GRP_R_DSETNAME1, fileid1, "soft_dset1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", GRP_RECURSE1_EXT); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; } @@ -2910,7 +2910,7 @@ static int test_group_recurse2(void) */ grp4 = H5Gcreate2(fileid4, "/g4", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (grp4 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT3); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT3); status = FAIL; goto out; } @@ -2944,14 +2944,14 @@ static int test_group_recurse2(void) */ grp2 = H5Gcreate2(fileid3, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (grp2 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT2); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT2); status = FAIL; goto out; } grp3 = H5Gcreate2(grp2, "g3", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (grp3 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT2); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE2_EXT2); status = FAIL; goto out; } @@ -2975,7 +2975,7 @@ static int test_group_recurse2(void) */ status = H5Lcreate_external(GRP_RECURSE2_EXT3, "/g4", fileid3, "/g2/g3/g4", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", GRP_RECURSE2_EXT2); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", GRP_RECURSE2_EXT2); status = FAIL; goto out; } @@ -2996,7 +2996,7 @@ static int test_group_recurse2(void) */ grp1 = H5Gcreate2(fileid2, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (grp1 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", GRP_RECURSE1_EXT); status = FAIL; goto out; } @@ -3020,7 +3020,7 @@ static int test_group_recurse2(void) /* link to dset1 */ status = H5Lcreate_soft(GRP_R_DSETNAME1, fileid2, "soft_dset1", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", GRP_RECURSE2_EXT1); + HDfprintf(stderr, "Error: %s> H5Lcreate_soft failed.\n", GRP_RECURSE2_EXT1); status = FAIL; goto out; } @@ -3030,7 +3030,7 @@ static int test_group_recurse2(void) */ status = H5Lcreate_external(GRP_RECURSE2_EXT2, "/g2", fileid2, "/g1/g2", H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", GRP_RECURSE2_EXT1); + HDfprintf(stderr, "Error: %s> H5Lcreate_external failed.\n", GRP_RECURSE2_EXT1); status = FAIL; goto out; } @@ -3083,14 +3083,14 @@ static int test_exclude_obj1(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid2 < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; } @@ -3101,7 +3101,7 @@ static int test_exclude_obj1(const char *fname1, const char *fname2) /* file1 */ gid1 = H5Gcreate2(fid1, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid1 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } @@ -3110,7 +3110,7 @@ static int test_exclude_obj1(const char *fname1, const char *fname2) gid2 = H5Gcreate2(fid2, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid2 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } @@ -3121,21 +3121,21 @@ static int test_exclude_obj1(const char *fname1, const char *fname2) /* file1 */ status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid1, 2, dims2, "dset2", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid1, 2, dims2, "dset3", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } @@ -3143,21 +3143,21 @@ static int test_exclude_obj1(const char *fname1, const char *fname2) /* file2 */ status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid2, 2, dims2, "dset2", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid2, 2, dims2, "dset3", H5T_NATIVE_INT, data2); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } @@ -3204,14 +3204,14 @@ static int test_exclude_obj2(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid2 < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; } @@ -3222,7 +3222,7 @@ static int test_exclude_obj2(const char *fname1, const char *fname2) /* file1 */ gid1 = H5Gcreate2(fid1, "group10", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid1 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } @@ -3230,7 +3230,7 @@ static int test_exclude_obj2(const char *fname1, const char *fname2) /* file2 */ gid2 = H5Gcreate2(fid2, "group10", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid2 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } @@ -3239,7 +3239,7 @@ static int test_exclude_obj2(const char *fname1, const char *fname2) gid3 = H5Gcreate2(fid2, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid3 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname2); status = FAIL; goto out; } @@ -3250,21 +3250,21 @@ static int test_exclude_obj2(const char *fname1, const char *fname2) /* file1 */ status = write_dset(fid1, 2, dims2, "dset10", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid1, 2, dims2, "dset2", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } @@ -3272,21 +3272,21 @@ static int test_exclude_obj2(const char *fname1, const char *fname2) /* file2 */ status = write_dset(fid2, 2, dims2, "dset10", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid2, 2, dims2, "dset2", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } status = write_dset(gid3, 2, dims2, "dset3", H5T_NATIVE_INT, data2); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } @@ -3332,14 +3332,14 @@ static int test_exclude_obj3(const char *fname1, const char *fname2) *------------------------------------------------------------------------*/ fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid2 < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); status = FAIL; goto out; } @@ -3350,7 +3350,7 @@ static int test_exclude_obj3(const char *fname1, const char *fname2) /* file1 */ gid1 = H5Gcreate2(fid1, "group1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid1 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } @@ -3361,14 +3361,14 @@ static int test_exclude_obj3(const char *fname1, const char *fname2) /* file1 */ status = write_dset(fid1, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } status = write_dset(gid1, 2, dims2, "dset", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname1); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname1); status = FAIL; goto out; } @@ -3376,7 +3376,7 @@ static int test_exclude_obj3(const char *fname1, const char *fname2) /* file2 */ status = write_dset(fid2, 2, dims2, "dset1", H5T_NATIVE_INT, data1); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname2); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname2); status = FAIL; goto out; } @@ -3698,7 +3698,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int if (is_file_new == 1) { fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); status = FAIL; goto out; } @@ -3706,7 +3706,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int else { fid1 = H5Fopen(fname1, H5F_ACC_RDWR, H5P_DEFAULT); if (fid1 < 0) { - fprintf(stderr, "Error: %s> H5Fopen failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Fopen failed.\n", fname1); status = FAIL; goto out; } @@ -3717,7 +3717,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int *------------------------------------------------------------------------*/ gid = H5Gcreate2(fid1, grp_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname1); status = FAIL; goto out; } @@ -3727,7 +3727,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int *------------------------------------------------------------------------*/ sid_vlen_str = H5Screate_simple(STR_RANK, dims_vlen_str, NULL); if (sid_vlen_str < 0) { - fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); status = FAIL; goto out; } @@ -3735,7 +3735,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int tid_vlen_str = H5Tcopy(H5T_C_S1); status = H5Tset_size(tid_vlen_str, H5T_VARIABLE); if (status < 0) { - fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); status = FAIL; goto out; } @@ -3745,7 +3745,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int *------------------------------------------------------------------------*/ sid_fixlen_str = H5Screate_simple(STR_RANK, dims_fixlen_str, NULL); if (sid_fixlen_str < 0) { - fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); status = FAIL; goto out; } @@ -3753,7 +3753,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int tid_fixlen_str = H5Tcopy(H5T_C_S1); status = H5Tset_size(tid_fixlen_str, FIXLEN_STR_SIZE); if (status < 0) { - fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); status = FAIL; goto out; } @@ -3763,7 +3763,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int *------------------------------------------------------------------------*/ sid_vlen_str_array = H5Screate_simple(STR_RANK, dims_vlen_str_array, NULL); if (sid_vlen_str_array < 0) { - fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); status = FAIL; goto out; } @@ -3771,7 +3771,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int tid_vlen_str_array_pre = H5Tcopy(H5T_C_S1); status = H5Tset_size(tid_vlen_str_array_pre, H5T_VARIABLE); if (status < 0) { - fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); status = FAIL; goto out; } @@ -3779,7 +3779,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int /* Create the array data type for the string array */ tid_vlen_str_array = H5Tarray_create2(tid_vlen_str_array_pre, COMP_RANK, dims_vlen_str_array); if (tid_vlen_str_array < 0) { - fprintf(stderr, "Error: %s> H5Tarray_create2 failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Tarray_create2 failed.\n", fname1); status = FAIL; goto out; } @@ -3789,7 +3789,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int *------------------------------------------------------------------------*/ sid_fixlen_str_array = H5Screate_simple(STR_RANK, dims_fixlen_str_array, NULL); if (sid_fixlen_str_array < 0) { - fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); status = FAIL; goto out; } @@ -3797,14 +3797,14 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int tid_fixlen_str_array_pre = H5Tcopy(H5T_C_S1); status = H5Tset_size(tid_fixlen_str_array_pre, FIXLEN_STR_ARRY_SIZE); if (status < 0) { - fprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Tset_size failed.\n", fname1); status = FAIL; goto out; } /* Create the array data type for the string array */ tid_fixlen_str_array = H5Tarray_create2(tid_fixlen_str_array_pre, COMP_RANK, dims_fixlen_str_array); if (tid_fixlen_str_array < 0) { - fprintf(stderr, "Error: %s> H5Tarray_create2 failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Tarray_create2 failed.\n", fname1); status = FAIL; goto out; } @@ -3814,7 +3814,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int *------------------------------------------------------------------------*/ sid_comp = H5Screate_simple(COMP_RANK, dims_comp, NULL); if (sid_comp < 0) { - fprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Screate_simple failed.\n", fname1); status = FAIL; goto out; } @@ -3928,7 +3928,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int did_comp = H5Dcreate2(gid, "Compound_dset1", tid1_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid1_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp1_buf); if (status < 0) { - fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } @@ -3938,7 +3938,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int did_comp = H5Dcreate2(gid, "Compound_dset2", tid2_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid2_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp2_buf); if (status < 0) { - fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } @@ -3948,7 +3948,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int did_comp = H5Dcreate2(gid, "Compound_dset3", tid3_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid3_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp3_buf); if (status < 0) { - fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } @@ -3958,7 +3958,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int did_comp = H5Dcreate2(gid, "Compound_dset4", tid4_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid4_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp4_buf); if (status < 0) { - fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } @@ -3968,7 +3968,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int did_comp = H5Dcreate2(gid, "Compound_dset5", tid5_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid5_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp5_buf); if (status < 0) { - fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } @@ -3978,7 +3978,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int did_comp = H5Dcreate2(gid, "Compound_dset6", tid6_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid6_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp6_buf); if (status < 0) { - fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } @@ -3988,7 +3988,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int did_comp = H5Dcreate2(gid, "Compound_dset7", tid7_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid7_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp7_buf); if (status < 0) { - fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } @@ -3998,7 +3998,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int did_comp = H5Dcreate2(gid, "Compound_dset8", tid8_comp, sid_comp, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); status = H5Dwrite(did_comp, tid8_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp8_buf); if (status < 0) { - fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } @@ -4014,7 +4014,7 @@ static int test_comp_vlen_strings(const char *fname1, const char *grp_name, int status = H5Dwrite(did_comp, tid9_comp, H5S_ALL, H5S_ALL, H5P_DEFAULT, &comp9_buf); if (status < 0) { - fprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", fname1); status = FAIL; goto out; } @@ -4136,14 +4136,14 @@ static int test_enums(const char *fname) enum_val = 0; status = H5Tenum_insert(tid, "YIN", &enum_val); if (status < 0) { - fprintf(stderr, "Error: %s> H5Tenum_insert failed.\n", fname); + HDfprintf(stderr, "Error: %s> H5Tenum_insert failed.\n", fname); status = FAIL; goto out; } enum_val = 1; status = H5Tenum_insert(tid, "YANG", &enum_val); if (status < 0) { - fprintf(stderr, "Error: %s> H5Tenum_insert failed.\n", fname); + HDfprintf(stderr, "Error: %s> H5Tenum_insert failed.\n", fname); status = FAIL; goto out; } @@ -4154,13 +4154,13 @@ static int test_enums(const char *fname) status = write_dset(fid, 1, &dims, "dset1", tid, data1); if (status < 0) { - fprintf(stderr, "Error: %s> write_dset failed.\n", fname); + HDfprintf(stderr, "Error: %s> write_dset failed.\n", fname); status = FAIL; goto out; } status = write_dset(fid, 1, &dims, "dset2", tid, data2); if (status < 0) { - fprintf(stderr, "Error: %s> write_dset failed.\n", fname); + HDfprintf(stderr, "Error: %s> write_dset failed.\n", fname); status = FAIL; goto out; } @@ -4794,7 +4794,7 @@ static void test_data_nocomparables(const char * fname, int make_diffs) *------------------------------------------------------------------------*/ fid = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname); status = FAIL; goto out; } @@ -4804,14 +4804,14 @@ static void test_data_nocomparables(const char * fname, int make_diffs) *------------------------------------------------------------------------*/ gid1 = H5Gcreate2(fid, "g1", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid1 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname); status = FAIL; goto out; } gid2 = H5Gcreate2(fid, "g2", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid2 < 0) { - fprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname); + HDfprintf(stderr, "Error: %s> H5Gcreate2 failed.\n", fname); status = FAIL; goto out; } @@ -4824,13 +4824,13 @@ static void test_data_nocomparables(const char * fname, int make_diffs) /* dset1 */ if ((did1 = H5Dcreate2(gid1, "dset1", tid_dset1, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", "dset1"); + HDfprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", "dset1"); status = FAIL; goto out; } if (H5Dwrite(did1, tid_dset1, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data_ptr1) < 0) { - fprintf(stderr, "Error: %s> H5Dwrite failed.\n", "dset1"); + HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", "dset1"); status = FAIL; goto out; } @@ -4839,7 +4839,7 @@ static void test_data_nocomparables(const char * fname, int make_diffs) /* dset2 */ status = write_dset(gid1, 1, dims1_1, "dset2", H5T_NATIVE_INT, dset_data_ptr2); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname); goto out; } @@ -4849,13 +4849,13 @@ static void test_data_nocomparables(const char * fname, int make_diffs) /* --------- * dset1 */ if ((did2 = H5Dcreate2(gid2, "dset1", H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) { - fprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", "dset1"); + HDfprintf(stderr, "Error: %s> H5Dcreate2 failed.\n", "dset1"); status = FAIL; goto out; } if (H5Dwrite(did2, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, dset_data_ptr3) < 0) { - fprintf(stderr, "Error: %s> H5Dwrite failed.\n", "dset1"); + HDfprintf(stderr, "Error: %s> H5Dwrite failed.\n", "dset1"); status = FAIL; goto out; } @@ -4875,7 +4875,7 @@ static void test_data_nocomparables(const char * fname, int make_diffs) * dset2 */ status = write_dset(gid2, 1, dims1_1, "dset2", H5T_NATIVE_INT, dset_data_ptr3); if (status == FAIL) { - fprintf(stderr, "Error: %s> write_dset failed\n", fname); + HDfprintf(stderr, "Error: %s> write_dset failed\n", fname); goto out; } @@ -5085,14 +5085,14 @@ static void test_objs_strings(const char *fname1, const char *fname2) /* file1 */ fid1 = H5Fcreate(fname1, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid1 < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname1); goto out; } /* file2 */ fid2 = H5Fcreate(fname2, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fid2 < 0) { - fprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); + HDfprintf(stderr, "Error: %s> H5Fcreate failed.\n", fname2); goto out; } diff --git a/tools/test/h5dump/CMakeLists.txt b/tools/test/h5dump/CMakeLists.txt index 1672774..38f4118 100644 --- a/tools/test/h5dump/CMakeLists.txt +++ b/tools/test/h5dump/CMakeLists.txt @@ -40,7 +40,7 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) target_link_libraries (h5dumpgentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5dumpgentest PROPERTIES FOLDER generator/tools) - #add_test (NAME h5dumpgentest COMMAND $<TARGET_FILE:h5dumpgentest>) + #add_test (NAME h5dumpgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dumpgentest>) endif () include (CMakeTests.cmake) diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake index 070e98e..6299821 100644 --- a/tools/test/h5dump/CMakeTests.cmake +++ b/tools/test/h5dump/CMakeTests.cmake @@ -362,12 +362,7 @@ endforeach () foreach (tst_exp_file ${HDF5_REFERENCE_EXP_FILES}) - if (WIN32) - file (READ ${HDF5_TOOLS_DIR}/testfiles/${tst_exp_file} TEST_STREAM) - file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file} "${TEST_STREAM}") - else () - HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${tst_exp_file}" "${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file}" "h5dump_std_files") - endif () + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${tst_exp_file}" "${PROJECT_BINARY_DIR}/testfiles/std/${tst_exp_file}" "h5dump_std_files") endforeach () foreach (tst_other_file ${HDF5_REFERENCE_FILES}) @@ -388,9 +383,10 @@ # -------------------------------------------------------------------- HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tbin1.ddl" "${PROJECT_BINARY_DIR}/testfiles/std/tbin1LE.ddl" "h5dump_std_files") - if (WIN32) - file (READ ${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp TEST_STREAM) - file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}") + if (WIN32 OR MINGW) + configure_file(${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp NEWLINE_STYLE CRLF) + #file (READ ${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp TEST_STREAM) + #file (WRITE ${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp "${TEST_STREAM}") else () HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/tbinregR.exp" "${PROJECT_BINARY_DIR}/testfiles/std/tbinregR.exp" "h5dump_std_files") endif () @@ -411,27 +407,17 @@ macro (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-${testname} COMMAND $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) + add_test (NAME H5DUMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) set_tests_properties (H5DUMP-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (last_test) set_tests_properties (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test}) endif () set (last_test "H5DUMP-${testname}") else () - # Remove any output file left over from previous test run - add_test ( - NAME H5DUMP-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/std/h5dump-${testname}.out - testfiles/std/h5dump-${testname}.out.err - ) - if (last_test) - set_tests_properties (H5DUMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () add_test ( NAME H5DUMP-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" @@ -440,7 +426,9 @@ -D "TEST_REFERENCE=h5dump-${testname}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5DUMP-${testname} PROPERTIES DEPENDS H5DUMP-${testname}-clear-objects) + if (last_test) + set_tests_properties (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test}) + endif () endif () endmacro () @@ -461,7 +449,7 @@ macro (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) + add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (${resultcode}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") @@ -472,16 +460,13 @@ else () add_test ( NAME H5DUMP-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.bin - ${resultfile}.out - ${resultfile}.out.err + COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.bin ) set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" @@ -497,7 +482,7 @@ macro (ADD_H5_TEST_N resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-N-${resultfile} COMMAND $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) + add_test (NAME H5DUMP-N-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (${resultcode}) set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES WILL_FAIL "true") @@ -508,16 +493,13 @@ else () add_test ( NAME H5DUMP-N-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}-N.bin - ${resultfile}-N.out - ${resultfile}-N.out.err + COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}-N.bin ) set_tests_properties (H5DUMP-N-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( NAME H5DUMP-N-${resultfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" @@ -533,7 +515,7 @@ macro (ADD_H5_TEST_EXPORT resultfile targetfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN} ${resultfile}.txt ${targetfile}) + add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN} ${resultfile}.txt ${targetfile}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (${resultcode}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") @@ -544,16 +526,13 @@ else () add_test ( NAME H5DUMP-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.txt - ${resultfile}.out - ${resultfile}.out.err + COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.txt ) set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=${ARGN};${resultfile}.txt;${targetfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" @@ -563,20 +542,21 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - add_test ( - NAME H5DUMP-${resultfile}-output-cmp - COMMAND ${CMAKE_COMMAND} - -E compare_files ${resultfile}.txt ${resultfile}.exp - ) - set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile}) + if(NOT CMAKE_VERSION VERSION_LESS "3.14.0") + add_test ( + NAME H5DUMP-${resultfile}-output-cmp + COMMAND ${CMAKE_COMMAND} -E compare_files --ignore-eol ${resultfile}.txt ${resultfile}.exp + ) + set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile}) + endif () endif () endmacro () macro (ADD_H5_TEST_EXPORT_DDL resultfile targetfile resultcode ddlfile) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump${tgt_ext}> --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile}) + add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> --ddl=${ddlfile}.txt ${ARGN} ${resultfile}.txt ${targetfile}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") if (${resultcode}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") @@ -587,17 +567,15 @@ else () add_test ( NAME H5DUMP-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove + COMMAND ${CMAKE_COMMAND} -E remove ${ddlfile}.txt ${resultfile}.txt - ${resultfile}.out - ${resultfile}.out.err ) set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=--ddl=${ddlfile}.txt;${ARGN};${resultfile}.txt;${targetfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" @@ -607,20 +585,20 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") - add_test ( - NAME H5DUMP-${resultfile}-output-cmp - COMMAND ${CMAKE_COMMAND} - -E compare_files ${resultfile}.txt ${resultfile}.exp - ) - set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile}) - add_test ( - NAME H5DUMP-${resultfile}-output-cmp-ddl - COMMAND ${CMAKE_COMMAND} - -E compare_files ${ddlfile}.txt ${ddlfile}.exp - ) - set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES DEPENDS H5DUMP-${resultfile}-output-cmp) + if(NOT CMAKE_VERSION VERSION_LESS "3.14.0") + add_test ( + NAME H5DUMP-${resultfile}-output-cmp + COMMAND ${CMAKE_COMMAND} -E compare_files --ignore-eol ${resultfile}.txt ${resultfile}.exp + ) + set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile}) + add_test ( + NAME H5DUMP-${resultfile}-output-cmp-ddl + COMMAND ${CMAKE_COMMAND} -E compare_files --ignore-eol ${ddlfile}.txt ${ddlfile}.exp + ) + set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES DEPENDS H5DUMP-${resultfile}-output-cmp) + endif () endif () endmacro () @@ -628,40 +606,32 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-output-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.txt + COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.txt ) set_tests_properties (H5DUMP-output-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( NAME H5DUMP-output-${resultfile} - COMMAND $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN} ${resultfile}.txt ${targetfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN} ${resultfile}.txt ${targetfile} ) set_tests_properties (H5DUMP-output-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-output-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}-clear-objects) - add_test ( - NAME H5DUMP-output-cmp-${resultfile} - COMMAND ${CMAKE_COMMAND} - -E compare_files ${resultfile}.txt ${resultfile}.exp - ) - set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}) + if(NOT CMAKE_VERSION VERSION_LESS "3.14.0") + add_test ( + NAME H5DUMP-output-cmp-${resultfile} + COMMAND ${CMAKE_COMMAND} -E compare_files --ignore-eol ${resultfile}.txt ${resultfile}.exp + ) + set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES DEPENDS H5DUMP-output-${resultfile}) + endif () endif () endmacro () macro (ADD_H5_MASK_TEST resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - add_test ( - NAME H5DUMP-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.out - ${resultfile}.out.err - ) - set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" @@ -671,24 +641,15 @@ -D "TEST_MASK_ERROR=true" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") endif () endmacro () macro (ADD_H5_GREP_TEST resultfile resultcode result_check) if (NOT HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - add_test ( - NAME H5DUMP-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.out - ${resultfile}.out.err - ) - set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" @@ -697,24 +658,15 @@ -D "TEST_REFERENCE=${result_check}" -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) - set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") endif () endmacro () macro (ADD_H5ERR_MASK_TEST resultfile resultcode result_errcheck) if (NOT HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - add_test ( - NAME H5DUMP-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.out - ${resultfile}.out.err - ) - set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" @@ -724,24 +676,15 @@ -D "TEST_ERRREF=${result_errcheck}" -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) - set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") endif () endmacro () macro (ADD_H5ERR_MASK_ENV_TEST resultfile resultcode result_errcheck envvar envval) if (NOT HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - add_test ( - NAME H5DUMP-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.out - ${resultfile}.out.err - ) - set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" @@ -753,7 +696,6 @@ -D "TEST_ENV_VALUE:STRING=${envval}" -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) - set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") endif () endmacro () @@ -762,16 +704,15 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5DUMP-IMPORT-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove + COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.bin ${resultfile}.h5 - ${conffile}.out ) set_tests_properties (H5DUMP-IMPORT-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( NAME H5DUMP-IMPORT-${resultfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=${ARGN};-o;${resultfile}.bin;${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" @@ -781,10 +722,10 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5DUMP-IMPORT-${resultfile} PROPERTIES DEPENDS "H5DUMP-IMPORT-${resultfile}-clear-objects") - add_test (NAME H5DUMP-IMPORT-h5import-${resultfile} COMMAND $<TARGET_FILE:h5import> ${resultfile}.bin -c ${conffile}.out -o ${resultfile}.h5) + add_test (NAME H5DUMP-IMPORT-h5import-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import> ${resultfile}.bin -c ${conffile}.out -o ${resultfile}.h5) set_tests_properties (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-${resultfile}) - add_test (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND $<TARGET_FILE:h5diff> ${testfile} ${resultfile}.h5 /integer /integer) + add_test (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff> ${testfile} ${resultfile}.h5 /integer /integer) set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES DEPENDS H5DUMP-IMPORT-h5import-${resultfile}) endif () @@ -792,18 +733,10 @@ macro (ADD_H5_UD_TEST testname resultcode resultfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - add_test ( - NAME H5DUMP_UD-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.out - ${resultfile}.out.err - ) - set_tests_properties (H5DUMP_UD-${testname}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( NAME H5DUMP_UD-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" @@ -815,7 +748,6 @@ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5DUMP_UD-${testname} PROPERTIES DEPENDS H5DUMP_UD-${testname}-clear-objects) endif () endmacro () @@ -825,368 +757,6 @@ ############################################################################## ############################################################################## - if (HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - add_test ( - NAME H5DUMP-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - h5dump-help.out - charsets.out - charsets.out.err - file_space.out - file_space.out.err - filter_fail.out - filter_fail.out.err - non_existing.out - non_existing.out.err - packedbits.out - packedbits.out.err - tall-1.out - tall-1.out.err - tall-2.out - tall-2.out.err - tall-2A.out - tall-2A.out.err - tall-2A0.out - tall-2A0.out.err - tall-2B.out - tall-2B.out.err - tall-3.out - tall-3.out.err - tall-4s.out - tall-4s.out.err - tall-5s.out - tall-5s.out.err - tall-6.txt - tall-6.out - tall-6.out.err - tall-7.out - tall-7.out.err - tall-7N.out - tall-7N.out.err - tallfilters.out - tallfilters.out.err - tarray1.out - tarray1.out.err - tarray1_big.out - tarray1_big.out.err - tarray2.out - tarray2.out.err - tarray3.out - tarray3.out.err - tarray4.out - tarray4.out.err - tarray5.out - tarray5.out.err - tarray6.out - tarray6.out.err - tarray7.out - tarray7.out.err - tarray8.out - tarray8.out.err - tattr-1.out - tattr-1.out.err - tattr-2.out - tattr-2.out.err - tattr-3.out - tattr-3.out.err - tattr-4_be.out - tattr-4_be.out.err - tattrcontents1.out - tattrcontents1.out.err - tattrcontents2.out - tattrcontents2.out.err - tattrintsize.out - tattrintsize.out.err - tattrreg.out - tattrreg.out.err - tattrregR.out - tattrregR.out.err - tbin1LE.bin - tbinregR.txt - tbinregR.out - tbinregR.out.err - tbigdims.out - tbigdims.out.err - tbitnopaque_be.out - tbitnopaque_be.out.err - tbitnopaque_le.out - tbitnopaque_le.out.err - tboot1.out - tboot1.out.err - tboot2.out - tboot2.out.err - tboot2A.out - tboot2A.out.err - tboot2B.out - tboot2B.out.err - tchar1.out - tchar1.out.err - tchunked.out - tchunked.out.err - tcmpdattrintsize.out - tcmpdattrintsize.out.err - tcmpdintarray.out - tcmpdintarray.out.err - tcmpdints.out - tcmpdints.out.err - tcmpdintsize.out - tcmpdintsize.out.err - tcomp-1.out - tcomp-1.out.err - tcomp-2.out - tcomp-2.out.err - tcomp-3.out - tcomp-3.out.err - tcomp-4.out - tcomp-4.out.err - tcompact.out - tcompact.out.err - tcompound_complex.out - tcompound_complex.out.err - tcontents.out - tcontents.out.err - tcontiguos.out - tcontiguos.out.err - tdatareg.out - tdatareg.out.err - tdataregR.out - tdataregR.out.err - tdeflate.out - tdeflate.out.err - tdset-1.out - tdset-1.out.err - tdset-2.out - tdset-2.out.err - tdset-3s.out - tdset-3s.out.err - tempty.out - tempty.out.err - texternal.out - texternal.out.err - textlinksrc.out - textlinksrc.out.err - textlinkfar.out - textlinkfar.out.err - textlink.out - textlink.out.err - tfamily.out - tfamily.out.err - tfill.out - tfill.out.err - tfletcher32.out - tfletcher32.out.err - tfpformat.out - tfpformat.out.err - tgroup-1.out - tgroup-1.out.err - tgroup-2.out - tgroup-2.out.err - tgrp_comments.out - tgrp_comments.out.err - tgrpnullspace.out - tgrpnullspace.out.err - thlink-1.out - thlink-1.out.err - thlink-2.out - thlink-2.out.err - thlink-3.out - thlink-3.out.err - thlink-4.out - thlink-4.out.err - thlink-5.out - thlink-5.out.err - thyperslab.out - thyperslab.out.err - tindicesno.out - tindicesno.out.err - tindicessub1.out - tindicessub1.out.err - tindicessub2.out - tindicessub2.out.err - tindicessub3.out - tindicessub3.out.err - tindicessub4.out - tindicessub4.out.err - texceedsubstart.out - texceedsubstart.out.err - texceedsubcount.out - texceedsubcount.out.err - texceedsubstride.out - texceedsubstride.out.err - texceedsubblock.out - texceedsubblock.out.err - tindicesyes.out - tindicesyes.out.err - tints4dims.out - tints4dims.out.err - tints4dimsBlock2.out - tints4dimsBlock2.out.err - tints4dimsBlockEq.out - tints4dimsBlockEq.out.err - tints4dimsCount2.out - tints4dimsCount2.out.err - tints4dimsCountEq.out - tints4dimsCountEq.out.err - tints4dimsStride2.out - tints4dimsStride2.out.err - tintsattrs.out - tintsattrs.out.err - tintsnodata.out - tintsnodata.out.err - tlarge_objname.out - tlarge_objname.out.err - tldouble.out - tldouble.out.err - tlonglinks.out - tlonglinks.out.err - tloop-1.out - tloop-1.out.err - tmulti.out - tmulti.out.err - tmultifile.out - tmultifile.out.err -# tqmarkfile.out -# tqmarkfile.out.err -# tstarfile.out -# tstarfile.out.err - tnamed_dtype_attr.out - tnamed_dtype_attr.out.err - tnbit.out - tnbit.out.err - tnestcomp-1.out - tnestcomp-1.out.err - tnestedcmpddt.out - tnestedcmpddt.out.err - tnoattrdata.out - tnoattrdata.out.err - tnoattrddl.out - tnoattrddl.out.err - tnodata.out - tnodata.out.err - tnoddl.out - tnoddl.out.err - tnoddlfile.out - tnoddlfile.out.err - tno-subset.out - tno-subset.out.err - tnullspace.out - tnullspace.out.err - tordergr1.out - tordergr1.out.err - tordergr2.out - tordergr2.out.err - tordergr3.out - tordergr3.out.err - tordergr4.out - tordergr4.out.err - tordergr5.out - tordergr5.out.err - torderattr1.out - torderattr1.out.err - torderattr2.out - torderattr2.out.err - torderattr3.out - torderattr3.out.err - torderattr4.out - torderattr4.out.err - tordercontents1.out - tordercontents1.out.err - tordercontents2.out - tordercontents2.out.err - torderlinks1.out - torderlinks1.out.err - torderlinks2.out - torderlinks2.out.err - tperror.out - tperror.out.err - trawdatafile.out - trawdatafile.out.err - trawdatafile.txt - trawssetfile.out - trawssetfile.out.err - trawssetfile.txt - treadfilter.out - treadfilter.out.err - treadintfilter.out - treadintfilter.out.err - treference.out - treference.out.err - tsaf.out - tsaf.out.err - tscalarattrintsize.out - tscalarattrintsize.out.err - tscalarintattrsize.out - tscalarintattrsize.out.err - tscalarintsize.out - tscalarintsize.out.err - tscalarstring.out - tscalarstring.out.err - tscaleoffset.out - tscaleoffset.out.err - tshuffle.out - tshuffle.out.err - tslink-1.out - tslink-1.out.err - tslink-2.out - tslink-2.out.err - tslink-D.out - tslink-D.out.err - tsplit_file.out - tsplit_file.out.err - tstr-1.out - tstr-1.out.err - tstr-2.out - tstr-2.out.err - tstr2bin2.txt - tstr2bin6.txt - tstring.out - tstring.out.err - tstring2.out - tstring2.out.err - tstringe.out - tstringe.out.err - tszip.out - tszip.out.err - tudlink-1.out - tudlink-1.out.err - tudlink-2.out - tudlink-2.out.err - tuserfilter.out - tuserfilter.out.err - tvldtypes1.out - tvldtypes1.out.err - tvldtypes2.out - tvldtypes2.out.err - tvldtypes3.out - tvldtypes3.out.err - tvldtypes4.out - tvldtypes4.out.err - tvldtypes5.out - tvldtypes5.out.err - tvlenstr_array.out - tvlenstr_array.out.err - tvlstr.out - tvlstr.out.err - tvms.out - tvms.out.err - twidedisplay.out - twidedisplay.out.err - twithddl.txt - twithddlfile.out - twithddlfile.out.err - twithddlfile.txt - zerodim.out - zerodim.out.err - ) - set_tests_properties (H5DUMP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") - if (last_test) - set_tests_properties (H5DUMP-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "H5DUMP-clearall-objects") - endif () - ADD_HELP_TEST(help 0 -h) # test data output redirection @@ -1587,3 +1157,13 @@ if (BUILD_SHARED_LIBS) ADD_H5_UD_TEST (h5dump_plugin_test 0 tudfilter --enable-error-stack tudfilter.h5) endif () + +############################################################################## +############################################################################## +### V F D T E S T S ### +############################################################################## +############################################################################## + +if (HDF5_TEST_VFD) + include (CMakeVFDTests.cmake) +endif () diff --git a/tools/test/h5dump/CMakeTestsPBITS.cmake b/tools/test/h5dump/CMakeTestsPBITS.cmake index feb5c68..a6be9ae 100644 --- a/tools/test/h5dump/CMakeTestsPBITS.cmake +++ b/tools/test/h5dump/CMakeTestsPBITS.cmake @@ -128,7 +128,7 @@ macro (ADD_H5_PBITS_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) + add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") if (${resultcode}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") @@ -137,18 +137,10 @@ set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_pbits_test}) endif () else () - # Remove any output file left over from previous test run - add_test ( - NAME H5DUMP-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.out - ${resultfile}.out.err - ) - set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/pbits" @@ -157,7 +149,6 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS H5DUMP-${resultfile}-clear-objects) endif () endmacro () @@ -167,126 +158,6 @@ ############################################################################## ############################################################################## - if (HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - add_test ( - NAME H5DUMP_PACKED_BITS-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - tnofilename-with-packed-bits.out - tnofilename-with-packed-bits.out.err - tpbitsArray.out - tpbitsArray.out.err - tpbitsCompound.out - tpbitsCompound.out.err - tpbitsIncomplete.out - tpbitsIncomplete.out.err - tpbitsLengthExceeded.out - tpbitsLengthExceeded.out.err - tpbitsCharLengthExceeded.out - tpbitsCharLengthExceeded.out.err - tpbitsIntLengthExceeded.out - tpbitsIntLengthExceeded.out.err - tpbitsLongLengthExceeded.out - tpbitsLongLengthExceeded.out.err - tpbitsLengthPositive.out - tpbitsLengthPositive.out.err - tpbitsMax.out - tpbitsMax.out.err - tpbitsMaxExceeded.out - tpbitsMaxExceeded.out.err - tpbitsOffsetExceeded.out - tpbitsOffsetExceeded.out.err - tpbitsCharOffsetExceeded.out - tpbitsCharOffsetExceeded.out.err - tpbitsIntOffsetExceeded.out - tpbitsIntOffsetExceeded.out.err - tpbitsLongOffsetExceeded.out - tpbitsLongOffsetExceeded.out.err - tpbitsOffsetNegative.out - tpbitsOffsetNegative.out.err - tpbitsOverlapped.out - tpbitsOverlapped.out.err - tpbitsSigned.out - tpbitsSigned.out.err - tpbitsUnsigned.out - tpbitsUnsigned.out.err - tpbitsSignedInt.out - tpbitsSignedInt.out.err - tpbitsUnsignedInt.out - tpbitsUnsignedInt.out.err - tpbitsSignedLong.out - tpbitsSignedLong.out.err - tpbitsUnsignedLong.out - tpbitsUnsignedLong.out.err - tpbitsSignedLongLong.out - tpbitsSignedLongLong.out.err - tpbitsUnsignedLongLong.out - tpbitsUnsignedLongLong.out.err - tpbitsSignedWhole.out - tpbitsSignedWhole.out.err - tpbitsUnsignedWhole.out - tpbitsUnsignedWhole.out.err - tpbitsSignedIntWhole.out - tpbitsSignedIntWhole.out.err - tpbitsUnsignedIntWhole.out - tpbitsUnsignedIntWhole.out.err - tpbitsSignedLongWhole.out - tpbitsSignedLongWhole.out.err - tpbitsUnsignedLongWhole.out - tpbitsUnsignedLongWhole.out.err - tpbitsSignedLongLongWhole.out - tpbitsSignedLongLongWhole.out.err - tpbitsUnsignedLongLongWhole.out - tpbitsUnsignedLongLongWhole.out.err - tpbitsSignedLongLongWhole1.out - tpbitsSignedLongLongWhole1.out.err - tpbitsUnsignedLongLongWhole1.out - tpbitsUnsignedLongLongWhole1.out.err - tpbitsSignedLongLongWhole63.out - tpbitsSignedLongLongWhole63.out.err - tpbitsUnsignedLongLongWhole63.out - tpbitsUnsignedLongLongWhole63.out.err - tpbitsSigned4.out - tpbitsSigned4.out.err - tpbitsUnsigned4.out - tpbitsUnsigned4.out.err - tpbitsSignedInt8.out - tpbitsSignedInt8.out.err - tpbitsUnsignedInt8.out - tpbitsUnsignedInt8.out.err - tpbitsSignedLong16.out - tpbitsSignedLong16.out.err - tpbitsUnsignedLong16.out - tpbitsUnsignedLong16.out.err - tpbitsSignedLongLong32.out - tpbitsSignedLongLong32.out.err - tpbitsUnsignedLongLong32.out - tpbitsUnsignedLongLong32.out.err - tpbitsSigned2.out - tpbitsSigned2.out.err - tpbitsUnsigned2.out - tpbitsUnsigned2.out.err - tpbitsSignedInt4.out - tpbitsSignedInt4.out.err - tpbitsUnsignedInt4.out - tpbitsUnsignedInt4.out.err - tpbitsSignedLong8.out - tpbitsSignedLong8.out.err - tpbitsUnsignedLong8.out - tpbitsUnsignedLong8.out.err - tpbitsSignedLongLong16.out - tpbitsSignedLongLong16.out.err - tpbitsUnsignedLongLong16.out - tpbitsUnsignedLongLong16.out.err - ) - set_tests_properties (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits") - if (last_pbits_test) - set_tests_properties (H5DUMP_PACKED_BITS-clearall-objects PROPERTIES DEPENDS ${last_pbits_test}) - endif () - set (last_pbits_test "H5DUMP_PACKED_BITS-clearall-objects") - endif () - # test failure handling # Missing file name ADD_H5_PBITS_TEST (tnofilename-with-packed-bits 1 --enable-error-stack) diff --git a/tools/test/h5dump/CMakeTestsVDS.cmake b/tools/test/h5dump/CMakeTestsVDS.cmake index c557ba4..036609c 100644 --- a/tools/test/h5dump/CMakeTestsVDS.cmake +++ b/tools/test/h5dump/CMakeTestsVDS.cmake @@ -124,7 +124,7 @@ macro (ADD_H5_VDS_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) + add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") if (${resultcode}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") @@ -133,18 +133,10 @@ set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_VDS_test}) endif () else () - # Remove any output file left over from previous test run - add_test ( - NAME H5DUMP-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.out - ${resultfile}.out.err - ) - set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds" @@ -153,14 +145,13 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS H5DUMP-${resultfile}-clear-objects) endif () endmacro () macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP_PREFIX-${resultfile} COMMAND $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) + add_test (NAME H5DUMP_PREFIX-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> ${ARGN}) set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES ENVIRONMENT "HDF5_VDS_PREFIX=${PROJECT_BINARY_DIR}/testfiles/vds/" WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix" @@ -172,18 +163,10 @@ set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_VDS_test}) endif () else () - # Remove any output file left over from previous test run - add_test ( - NAME H5DUMP_PREFIX-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.out - ${resultfile}.out.err - ) - set_tests_properties (H5DUMP_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") add_test ( NAME H5DUMP_PREFIX-${resultfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds/prefix" @@ -194,14 +177,13 @@ -D "TEST_ENV_VALUE=${PROJECT_BINARY_DIR}/testfiles/vds/" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5DUMP_PREFIX-${resultfile} PROPERTIES DEPENDS H5DUMP_PREFIX-${resultfile}-clear-objects) endif () endmacro () macro (ADD_H5_VDS_LAYOUT resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP-${resultfile} COMMAND $<TARGET_FILE:h5dump${tgt_ext}> -p ${ARGN}) + add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> -p ${ARGN}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") if (${resultcode}) set_tests_properties (H5DUMP-${resultfile} PROPERTIES WILL_FAIL "true") @@ -210,18 +192,10 @@ set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_VDS_test}) endif () else () - # Remove any output file left over from previous test run - add_test ( - NAME H5DUMP-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.out - ${resultfile}.out.err - ) - set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=-p;${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds" @@ -230,7 +204,6 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") endif () endmacro () @@ -240,54 +213,6 @@ ############################################################################## ############################################################################## - if (HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - add_test ( - NAME H5DUMP_VDS-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - tvds-1.out - tvds-1.out.err - tvds-2.out - tvds-2.out.err - tvds-3_1.out - tvds-3_1.out.err - tvds-3_2.out - tvds-3_2.out.err - tvds-4.out - tvds-4.out.err - tvds-5.out - tvds-5.out.err - vds-first.out - vds-first.out.err - vds-gap1.out - vds-gap1.out.err - vds-gap2.out - vds-gap2.out.err - tvds_layout-1.out - tvds_layout-1.out.err - tvds_layout-2.out - tvds_layout-2.out.err - tvds_layout-3_1.out - tvds_layout-3_1.out.err - tvds_layout-3_2.out - tvds_layout-3_2.out.err - tvds_layout-4.out - tvds_layout-4.out.err - tvds_layout-5.out - tvds_layout-5.out.err - vds_layout-eiger.out - vds_layout-eiger.out.err - vds_layout-maxmin.out - vds_layout-maxmin.out.err - ) - set_tests_properties (H5DUMP_VDS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") - if (last_vds_test) - set_tests_properties (H5DUMP_VDS-clearall-objects PROPERTIES DEPENDS ${last_vds_test}) - endif () - set (last_VDS_test "H5DUMP_VDS-clearall-objects") - endif () - # See which filters are usable (and skip tests for filters we # don't have). Do this by searching H5pubconf.h to see which # filters are defined. diff --git a/tools/test/h5dump/CMakeTestsXML.cmake b/tools/test/h5dump/CMakeTestsXML.cmake index a883b86..6d73cb1 100644 --- a/tools/test/h5dump/CMakeTestsXML.cmake +++ b/tools/test/h5dump/CMakeTestsXML.cmake @@ -182,7 +182,7 @@ macro (ADD_XML_H5_TEST resultfile resultcode) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5DUMP_XML-${resultfile} COMMAND $<TARGET_FILE:h5dump${tgt_ext}> --xml ${ARGN}) + add_test (NAME H5DUMP_XML-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_ext}> --xml ${ARGN}) set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") if (${resultcode}) set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES WILL_FAIL "true") @@ -191,18 +191,10 @@ set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test}) endif () else () - # Remove any output file left over from previous test run - add_test ( - NAME H5DUMP_XML-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.out - ${resultfile}.out.err - ) - set_tests_properties (H5DUMP_XML-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") add_test ( NAME H5DUMP_XML-${resultfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=--xml;${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/xml" @@ -211,7 +203,6 @@ -D "TEST_REFERENCE=${resultfile}.xml" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES DEPENDS H5DUMP_XML-${resultfile}-clear-objects) endif () endmacro () @@ -221,154 +212,6 @@ ############################################################################## ############################################################################## - if (HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - add_test ( - NAME H5DUMP-XML-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - tall.h5.out - tall.h5.out.err - tall-2A.h5.out - tall-2A.h5.out.err - tarray1.h5.out - tarray1.h5.out.err - tarray2.h5.out - tarray2.h5.out.err - tarray3.h5.out - tarray3.h5.out.err - tarray6.h5.out - tarray6.h5.out.err - tarray7.h5.out - tarray7.h5.out.err - tattr.h5.out - tattr.h5.out.err - tbitfields_be.h5.out - tbitfields_be.h5.out.err - tbitfields_le.h5.out - tbitfields_le.h5.out.err - tcompound.h5.out - tcompound.h5.out.err - tcompound2.h5.out - tcompound2.h5.out.err - tcompound_complex.h5.out - tcompound_complex.h5.out.err - tdatareg.h5.out - tdatareg.h5.out.err - tdset.h5.out - tdset.h5.out.err - tdset2.h5.out - tdset2.h5.out.err - tempty-dtd-2.h5.out - tempty-dtd-2.h5.out.err - tempty-dtd-uri.h5.out - tempty-dtd-uri.h5.out.err - tempty-dtd.h5.out - tempty-dtd.h5.out.err - tempty-nons-2.h5.out - tempty-nons-2.h5.out.err - tempty-nons-uri.h5.out - tempty-nons-uri.h5.out.err - tempty-nons.h5.out - tempty-nons.h5.out.err - tempty-ns-2.h5.out - tempty-ns-2.h5.out.err - tempty-ns.h5.out - tempty-ns.h5.out.err - tempty.h5.out - tempty.h5.out.err - tenum.h5.out - tenum.h5.out.err - test35.nc.out - test35.nc.out.err - textlink.h5.out - textlink.h5.out.err - tfpformat.h5.out - tfpformat.h5.out.err - tgroup.h5.out - tgroup.h5.out.err - thlink.h5.out - thlink.h5.out.err - tloop.h5.out - tloop.h5.out.err - tloop2.h5.out - tloop2.h5.out.err - tmany.h5.out - tmany.h5.out.err - tname-amp.h5.out - tname-amp.h5.out.err - tname-apos.h5.out - tname-apos.h5.out.err - tname-gt.h5.out - tname-gt.h5.out.err - tname-lt.h5.out - tname-lt.h5.out.err - tname-quot.h5.out - tname-quot.h5.out.err - tname-sp.h5.out - tname-sp.h5.out.err - tnamed_dtype_attr.h5.out - tnamed_dtype_attr.h5.out.err - tnestedcomp.h5.out - tnestedcomp.h5.out.err - tnodata.h5.out - tnodata.h5.out.err - tnoname.h5.out - tnoname.h5.out.err - tnullspace.h5.out - tnullspace.h5.out.err - tobjref.h5.out - tobjref.h5.out.err - topaque.h5.out - topaque.h5.out.err - torderattr1.h5.out - torderattr1.h5.out.err - torderattr2.h5.out - torderattr2.h5.out.err - torderattr3.h5.out - torderattr3.h5.out.err - torderattr4.h5.out - torderattr4.h5.out.err - tref-escapes-at.h5.out - tref-escapes-at.h5.out.err - tref-escapes.h5.out - tref-escapes.h5.out.err - tref.h5.out - tref.h5.out.err - tsaf.h5.out - tsaf.h5.out.err - tslink.h5.out - tslink.h5.out.err - tstr.h5.out - tstr.h5.out.err - tstr2.h5.out - tstr2.h5.out.err - tstring.h5.out - tstring.h5.out.err - tstring-at.h5.out - tstring-at.h5.out.err - tudlink.h5.out - tudlink.h5.out.err - tvldtypes1.h5.out - tvldtypes1.h5.out.err - tvldtypes2.h5.out - tvldtypes2.h5.out.err - tvldtypes3.h5.out - tvldtypes3.h5.out.err - tvldtypes4.h5.out - tvldtypes4.h5.out.err - tvldtypes5.h5.out - tvldtypes5.h5.out.err - tvlstr.h5.out - tvlstr.h5.out.err - ) - set_tests_properties (H5DUMP-XML-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml") - if (last_xml_test) - set_tests_properties (H5DUMP-XML-clearall-objects PROPERTIES DEPENDS ${last_xml_test}) - endif () - set (last_test "H5DUMP-XML-clearall-objects") - endif () - ########## test XML ADD_XML_H5_TEST (tall.h5 0 tall.h5) ADD_XML_H5_TEST (tattr.h5 0 tattr.h5) diff --git a/tools/test/h5dump/CMakeVFDTests.cmake b/tools/test/h5dump/CMakeVFDTests.cmake new file mode 100644 index 0000000..0a345ef --- /dev/null +++ b/tools/test/h5dump/CMakeVFDTests.cmake @@ -0,0 +1,91 @@ +# +# Copyright by The HDF Group. +# All rights reserved. +# +# This file is part of HDF5. The full HDF5 copyright notice, including +# terms governing use, modification, and redistribution, is contained in +# the COPYING file, which can be found at the root of the source code +# distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +# + +############################################################################## +############################################################################## +### T E S T I N G ### +############################################################################## +############################################################################## + +set (VFD_H5DUMP_LIST + sec2 + stdio + core + core_paged + split + multi + family +) + +if (DIRECT_VFD) + set (VFD_H5DUMP_LIST ${VFD_H5DUMP_LIST} direct) +endif () + +# -------------------------------------------------------------------- +# Copy all the HDF5 files from the source directory into the test directory +# -------------------------------------------------------------------- +set (HDF5_VFD_H5DUMP_FILES + packedbits +) + +foreach (vfdtest ${VFD_H5DUMP_LIST}) + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdname}") + foreach (h5_tfile ${HDF5_VFD_H5DUMP_FILES}) + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}.h5" "${PROJECT_BINARY_DIR}/${vfdtest}/${h5_tfile}.h5" "HDF5_VFD_H5DUMP_files") + HDFTEST_COPY_FILE("${HDF5_TOOLS_DIR}/testfiles/${h5_tfile}.ddl" "${PROJECT_BINARY_DIR}/${vfdtest}/${h5_tfile}.ddl" "HDF5_VFD_H5DUMP_files") + endforeach () +endforeach () + +add_custom_target(HDF5_VFD_H5DUMP_files ALL COMMENT "Copying files needed by HDF5_VFD_H5DUMP tests" DEPENDS ${HDF5_VFD_H5DUMP_files_list}) + +############################################################################## +############################################################################## +### T H E T E S T S M A C R O S ### +############################################################################## +############################################################################## + +if (NOT BUILD_SHARED_LIBS) + set (tgt_ext "") +else () + set (tgt_ext "-shared") +endif () + +macro (ADD_VFD_H5DUMP_TEST vfdname resultfile resultcode) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5DUMP_VFD-${vfdname}-${resultfile}-h5dump + COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" + -D "TEST_ARGS:STRING=${ARGN}" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${resultfile}.out" + -D "TEST_REFERENCE=${resultfile}.ddl" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + ) + set_tests_properties (H5DUMP_VFD-${vfdname}-${resultfile}-h5dump PROPERTIES TIMEOUT ${CTEST_SHORT_TIMEOUT}) + endif () +endmacro () + +############################################################################## +############################################################################## +### T H E T E S T S ### +############################################################################## +############################################################################## + +# Run test with different Virtual File Driver +foreach (vfd ${VFD_H5DUMP_LIST}) + # test for signed/unsigned datasets + ADD_VFD_H5DUMP_TEST (${vfd} packedbits 0 --enable-error-stack packedbits.h5) +endforeach () diff --git a/tools/test/h5dump/h5dumpgentest.c b/tools/test/h5dump/h5dumpgentest.c index 3a414d1..35c3e3c 100644 --- a/tools/test/h5dump/h5dumpgentest.c +++ b/tools/test/h5dump/h5dumpgentest.c @@ -563,7 +563,7 @@ gent_attribute(void) dims[0] = 24; space = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(root, "/attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT); - sprintf(buf, "attribute of root group"); + HDsprintf(buf, "attribute of root group"); H5Awrite(attr, H5T_NATIVE_SCHAR, buf); H5Sclose(space); H5Aclose(attr); @@ -1373,7 +1373,7 @@ static void gent_all(void) dims[0] = 10; space = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(group, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT); - sprintf(buf, "abcdefghi"); + HDsprintf(buf, "abcdefghi"); H5Awrite(attr, H5T_NATIVE_SCHAR, buf); H5Sclose(space); H5Aclose(attr); @@ -1404,7 +1404,7 @@ static void gent_all(void) dims[0] = 27; space = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(dataset, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT); - sprintf(buf, "1st attribute of dset1.1.1"); + HDsprintf(buf, "1st attribute of dset1.1.1"); H5Awrite(attr, H5T_NATIVE_SCHAR, buf); H5Sclose(space); H5Aclose(attr); @@ -1412,7 +1412,7 @@ static void gent_all(void) dims[0] = 27; space = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(dataset, "attr2", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT); - sprintf(buf, "2nd attribute of dset1.1.1"); + HDsprintf(buf, "2nd attribute of dset1.1.1"); H5Awrite(attr, H5T_NATIVE_SCHAR, buf); H5Sclose(space); H5Aclose(attr); @@ -1608,7 +1608,7 @@ gent_many(void) dims[0] = 10; space2 = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(dataset, "attr1", H5T_STD_I8BE, space2, H5P_DEFAULT, H5P_DEFAULT); - sprintf(buf, "abcdefghi"); + HDsprintf(buf, "abcdefghi"); H5Awrite(attr, H5T_NATIVE_CHAR, buf); H5Sclose(space2); H5Aclose(attr); @@ -1927,9 +1927,9 @@ static void gent_str2(void) dims[0] = 3; space2 = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(dataset, "attr1", fxdlenstr2, space2, H5P_DEFAULT, H5P_DEFAULT); - sprintf(&(buf2[0*LENSTR2]), "0123456789"); - sprintf(&(buf2[1*LENSTR2]), "abcdefghij"); - sprintf(&(buf2[2*LENSTR2]), "ABCDEFGHIJ"); + HDsprintf(&(buf2[0*LENSTR2]), "0123456789"); + HDsprintf(&(buf2[1*LENSTR2]), "abcdefghij"); + HDsprintf(&(buf2[2*LENSTR2]), "ABCDEFGHIJ"); H5Awrite(attr, fxdlenstr2, buf2); H5Sclose(space2); H5Tclose(fxdlenstr2); @@ -1941,7 +1941,7 @@ static void gent_str2(void) for(i = 0; (hsize_t)i < sdim; i++) { start[0] = (hsize_t)i; - sprintf(buf, "This is row %d of type H5T_STR_NULLTERM of", i); + HDsprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of", i); H5Tset_size(memtype, HDstrlen(buf)+1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); @@ -1954,7 +1954,7 @@ static void gent_str2(void) for(i = 0; (hsize_t)i < sdim; i++) { start[0] = (hsize_t)i; - sprintf(buf, "This is row %d of type H5T_STR_NULLTERM of string array", i); + HDsprintf(buf, "This is row %1d of type H5T_STR_NULLTERM of string array", i); H5Tset_size(memtype, HDstrlen(buf)+1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); @@ -1974,7 +1974,7 @@ static void gent_str2(void) for(i = 0;(hsize_t) i < sdim; i++) { start[0] = (hsize_t)i; - sprintf(buf, "This is row %d of type H5T_STR_NULLPAD of", i); + HDsprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of", i); H5Tset_size(memtype, HDstrlen(buf)+1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); @@ -1988,7 +1988,7 @@ static void gent_str2(void) for(i = 0; (hsize_t)i < sdim; i++) { start[0] = (hsize_t)i; - sprintf(buf, "This is row %d of type H5T_STR_NULLPAD of string array", i); + HDsprintf(buf, "This is row %1d of type H5T_STR_NULLPAD of string array", i); H5Tset_size(memtype, HDstrlen(buf)+1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); @@ -2007,7 +2007,7 @@ static void gent_str2(void) for(i = 0; (hsize_t)i < sdim; i++) { start[0] = (hsize_t)i; - sprintf(buf, "This is row %d of type H5T_STR_SPACEPAD of", i); + HDsprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of", i); H5Tset_size(memtype, HDstrlen(buf) + 1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); @@ -2021,7 +2021,7 @@ static void gent_str2(void) for(i = 0; (hsize_t)i < sdim; i++) { start[0] = (hsize_t)i; - sprintf(buf, "This is row %d of type H5T_STR_SPACEPAD of string array", i); + HDsprintf(buf, "This is row %1d of type H5T_STR_SPACEPAD of string array", i); H5Tset_size(memtype, HDstrlen(buf) + 1); H5Sselect_hyperslab(hyper_space, H5S_SELECT_SET, start, stride, count, block); H5Dwrite(dataset, memtype, mem_space, hyper_space, H5P_DEFAULT, buf); @@ -2704,14 +2704,14 @@ gent_vldatatypes2(void) for(i = 0; i < SPACE1_DIM1; i++) { wdata[i].p = (hvl_t *)HDmalloc((i + 1) * sizeof(hvl_t)); if(wdata[i].p == NULL) { - printf("Cannot allocate memory for VL data! i=%u\n", i); + HDprintf("Cannot allocate memory for VL data! i=%u\n", i); return; } /* end if */ wdata[i].len = i + 1; for(t1 = (hvl_t *)wdata[i].p, j = 0; j < (i + 1); j++, t1++) { t1->p = (unsigned *)HDmalloc((j + 1) * sizeof(unsigned)); if(t1->p == NULL) { - printf("Cannot allocate memory for VL data! i=%u, j=%u\n",i,j); + HDprintf("Cannot allocate memory for VL data! i=%u, j=%u\n",i,j); return; } /* end if */ t1->len=j+1; @@ -3763,9 +3763,9 @@ void gent_multi(void) for(mt = H5FD_MEM_DEFAULT; mt < H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { memb_fapl[mt] = H5P_DEFAULT; memb_map[mt] = mt; - sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]); + HDsprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]); memb_name[mt] = sv[mt]; - /*printf("memb_name[%d]=%s, memb_map[%d]=%d; ", mt, memb_name[mt], mt, memb_map[mt]);*/ + /*HDprintf("memb_name[%d]=%s, memb_map[%d]=%d; ", mt, memb_name[mt], mt, memb_map[mt]);*/ memb_addr[mt] = (haddr_t)MAX(mt - 1, 0) * (HADDR_MAX / 10); } memb_map[H5FD_MEM_DEFAULT] = H5FD_MEM_SUPER; @@ -3804,7 +3804,7 @@ static void gent_large_objname(void) group = H5Gcreate2(fid, "this_is_a_large_group_name", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); for(i = 0; i < 50; ++i) { - sprintf(grp_name, "this_is_a_large_group_name%d", i); + HDsprintf(grp_name, "this_is_a_large_group_name%d", i); group2 = H5Gcreate2(group, grp_name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); H5Gclose(group2); } @@ -6275,7 +6275,7 @@ static int gent_ldouble(void) return 0; error: - printf("error !\n"); + HDprintf("error !\n"); return -1; } @@ -6438,7 +6438,7 @@ gent_bigdims(void) return; out: - printf("Error.....\n"); + HDprintf("Error.....\n"); H5E_BEGIN_TRY { H5Pclose(dcpl); H5Sclose(f_sid); @@ -6630,7 +6630,7 @@ gent_group_creation_order(void) return; out: - printf("Error.....\n"); + HDprintf("Error.....\n"); H5E_BEGIN_TRY { H5Gclose(gid); H5Pclose(gcpl_id); @@ -6899,7 +6899,7 @@ gent_attr_creation_order(void) return; out: - printf("Error.....\n"); + HDprintf("Error.....\n"); H5E_BEGIN_TRY { H5Gclose(gid); H5Dclose(did); diff --git a/tools/test/h5format_convert/CMakeLists.txt b/tools/test/h5format_convert/CMakeLists.txt index 019252f..55d5623 100644 --- a/tools/test/h5format_convert/CMakeLists.txt +++ b/tools/test/h5format_convert/CMakeLists.txt @@ -22,7 +22,7 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) target_link_libraries (h5fc_gentest PRIVATE ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET}) set_target_properties (h5fc_gentest PROPERTIES FOLDER generator/tools) - #add_test (NAME h5fc_gentest COMMAND $<TARGET_FILE:h5fc_gentest>) + #add_test (NAME h5fc_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5fc_gentest>) endif () include (CMakeTests.cmake) diff --git a/tools/test/h5format_convert/CMakeTests.cmake b/tools/test/h5format_convert/CMakeTests.cmake index e1abc48..398866c 100644 --- a/tools/test/h5format_convert/CMakeTests.cmake +++ b/tools/test/h5format_convert/CMakeTests.cmake @@ -108,11 +108,7 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5FC-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/outtmp.h5 - ./testfiles/${testname}.out - ./testfiles/${testname}.out.err + COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/outtmp.h5 ) if (last_test) set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) @@ -120,13 +116,13 @@ if (${testfile}) add_test ( NAME H5FC-${testname}-${testfile}-tmpfile - COMMAND ${CMAKE_COMMAND} - -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} ./testfiles/outtmp.h5 + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} ./testfiles/outtmp.h5 ) set_tests_properties (H5FC-${testname}-${testfile}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects") add_test ( NAME H5FC-${testname}-${testfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>" -D "TEST_ARGS=${ARGN};outtmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -142,6 +138,7 @@ add_test ( NAME H5FC-${testname}-NA COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -161,24 +158,20 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5FC-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/outtmp.h5 - ./testfiles/${testname}.out - ./testfiles/${testname}.out.err + COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/outtmp.h5 ) if (last_test) set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) endif () add_test ( NAME H5FC-${testname}-${testfile}-tmpfile - COMMAND ${CMAKE_COMMAND} - -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} ./testfiles/outtmp.h5 + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} ./testfiles/outtmp.h5 ) set_tests_properties (H5FC-${testname}-${testfile}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects") add_test ( NAME H5FC-${testname}-${testfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>" -D "TEST_ARGS=${ARGN};outtmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -197,24 +190,20 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5FC-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/outtmp.h5 - ./testfiles/${testname}.out - ./testfiles/${testname}.out.err + COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/outtmp.h5 ) if (last_test) set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) endif () add_test ( NAME H5FC-${testname}-${testfile}-tmpfile - COMMAND ${CMAKE_COMMAND} - -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} ./testfiles/outtmp.h5 + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} ./testfiles/outtmp.h5 ) set_tests_properties (H5FC-${testname}-${testfile}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects") add_test ( NAME H5FC-${testname}-${testfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>" -D "TEST_ARGS=${ARGN};outtmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -234,24 +223,20 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5FC-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/tmp.h5 - ./testfiles/${testname}.out - ./testfiles/${testname}.out.err + COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/tmp.h5 ) if (last_test) set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) endif () add_test ( NAME H5FC-${testname}-tmpfile - COMMAND ${CMAKE_COMMAND} - -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} testfiles/tmp.h5 + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} testfiles/tmp.h5 ) set_tests_properties (H5FC-${testname}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects") add_test ( NAME H5FC-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>" -D "TEST_ARGS=${ARGN};./testfiles/tmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -270,7 +255,7 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5FC_CHECK_IDX-${testname} - COMMAND "$<TARGET_FILE:h5fc_chk_idx>" "./testfiles/tmp.h5" "${ARGN}" + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5fc_chk_idx> ./testfiles/tmp.h5 ${ARGN} ) set_tests_properties (H5FC_CHECK_IDX-${testname} PROPERTIES DEPENDS "H5FC-${dependtest}") endif () @@ -281,24 +266,20 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5FC-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/chktmp.h5 - ./testfiles/${testname}.out - ./testfiles/${testname}.out.err + COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/chktmp.h5 ) if (last_test) set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) endif () add_test ( NAME H5FC-${testname}-tmpfile - COMMAND ${CMAKE_COMMAND} - -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} testfiles/chktmp.h5 + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} testfiles/chktmp.h5 ) set_tests_properties (H5FC-${testname}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects") add_test ( NAME H5FC-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>" -D "TEST_ARGS=-d;${ARGN};./testfiles/chktmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -310,7 +291,7 @@ set_tests_properties (H5FC-${testname} PROPERTIES DEPENDS "H5FC-${testname}-tmpfile") add_test ( NAME H5FC_CHECK_IDX-${testname} - COMMAND "$<TARGET_FILE:h5fc_chk_idx>" "./testfiles/chktmp.h5" "${ARGN}" + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5fc_chk_idx> ./testfiles/chktmp.h5 ${ARGN} ) set_tests_properties (H5FC_CHECK_IDX-${testname} PROPERTIES DEPENDS "H5FC-${testname}") set (last_test "H5FC_CHECK_IDX-${testname}") @@ -318,30 +299,24 @@ endmacro () macro (ADD_H5_H5DUMP_CHECK testname) - # If using memchecker add tests without using scripts + # If using memchecker skip tests if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5FC-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ./testfiles/dmptmp.h5 - ./testfiles/${testname}.out - ./testfiles/${testname}.out.err - ./testfiles/${testname}_chk.out - ./testfiles/${testname}_chk.out.err + COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/dmptmp.h5 ) if (last_test) set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) endif () add_test ( NAME H5FC-${testname}-tmpfile - COMMAND ${CMAKE_COMMAND} - -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testname}.h5 testfiles/dmptmp.h5 + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testname}.h5 testfiles/dmptmp.h5 ) set_tests_properties (H5FC-${testname}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects") add_test ( NAME H5FC-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_ext}>" -D "TEST_ARGS=${ARGN};./testfiles/dmptmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -354,6 +329,7 @@ add_test ( NAME H5FC_CHECK_DUMP-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=-BH;./testfiles/dmptmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -377,60 +353,7 @@ # Remove any output file left over from previous test run add_test ( NAME H5FC-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - h5fc_help.out - h5fc_help.out.err - h5fc_nooption.out - h5fc_nooption.out.err - h5fc_nonexistfile.out - h5fc_nonexistfile.out.err - h5fc_d_file.out - h5fc_d_file.out.err - h5fc_d_file-d.out - h5fc_d_file-d.out.err - h5fc_dname.out - h5fc_dname.out.err - h5fc_nonexistdset_file.out - h5fc_nonexistdset_file.out.err - h5fc_v_non_chunked.out - h5fc_v_non_chunked.out.err - h5fc_v_bt1.out - h5fc_v_bt1.out.err - h5fc_v_ndata_bt1.out - h5fc_v_ndata_bt1.out.err - h5fc_v_all.out - h5fc_v_all.out.err - h5fc_v_n_1d.out - h5fc_v_n_1d.out.err - h5fc_v_n_all.out - h5fc_v_n_all.out.err - h5fc_ext1_i.out - h5fc_ext1_i.out.err - h5fc_ext1_s.out - h5fc_ext1_s.out.err - h5fc_ext1_f.out - h5fc_ext1_f.out.err - h5fc_ext2_if.out - h5fc_ext2_if.out.err - h5fc_ext2_is.out - h5fc_ext2_is.out.err - h5fc_ext2_sf.out - h5fc_ext2_sf.out.err - h5fc_ext3_isf.out - h5fc_ext3_isf.out.err - old_h5fc_ext1_i.out - old_h5fc_ext1_i.out.err - old_h5fc_ext1_s.out - old_h5fc_ext1_s.out.err - old_h5fc_ext1_f.out - old_h5fc_ext1_f.out.err - old_h5fc_ext2_if.out - old_h5fc_ext2_is.out.err - old_h5fc_ext2_is.out - old_h5fc_ext2_sf.out.err - old_h5fc_ext3_isf.out - old_h5fc_ext3_isf.out.err + COMMAND ${CMAKE_COMMAND} -E remove outtmp.h5 tmp.h5 chktmp.h5 diff --git a/tools/test/h5import/CMakeTests.cmake b/tools/test/h5import/CMakeTests.cmake index 9d36276..22ab848 100644 --- a/tools/test/h5import/CMakeTests.cmake +++ b/tools/test/h5import/CMakeTests.cmake @@ -105,30 +105,28 @@ macro (ADD_H5_TEST testname importfile conffile testfile) # If using memchecker skip macro based tests if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import${tgt_ext}> ${importfile} -c ${conffile} -o ${testfile}) - if (last_test) - set_tests_properties (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-h5importtest) - endif () + add_test (NAME H5IMPORT-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_ext}> ${importfile} -c ${conffile} -o ${testfile}) + set_tests_properties (H5IMPORT-${testname} PROPERTIES + FIXTURES_REQUIRED set_h5importtest + ) else () add_test ( NAME H5IMPORT-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${testfile} - ${testfile}.new - ${testfile}.new.err - ${testfile}.out - ${testfile}.out.err - ${testfile} + COMMAND ${CMAKE_COMMAND} -E remove ${testfile} + ) + set_tests_properties (H5IMPORT-${testname}-clear-objects PROPERTIES + FIXTURES_REQUIRED set_h5importtest ) - set_tests_properties (H5IMPORT-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) - add_test (NAME H5IMPORT-${testname} COMMAND $<TARGET_FILE:h5import${tgt_ext}> ${importfile} -c ${conffile} -o ${testfile}) - set_tests_properties (H5IMPORT-${testname} PROPERTIES DEPENDS H5IMPORT-${testname}-clear-objects) + add_test (NAME H5IMPORT-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_ext}> ${importfile} -c ${conffile} -o ${testfile}) + set_tests_properties (H5IMPORT-${testname} PROPERTIES + DEPENDS H5IMPORT-${testname}-clear-objects + ) add_test ( NAME H5IMPORT-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -138,10 +136,13 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5IMPORT-${testname}-H5DMP PROPERTIES DEPENDS H5IMPORT-${testname}) + set_tests_properties (H5IMPORT-${testname}-H5DMP PROPERTIES + DEPENDS H5IMPORT-${testname} + ) add_test ( NAME H5IMPORT-${testname}-H5DMP_CMP COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=testfiles/${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -151,7 +152,9 @@ -D "TEST_REFERENCE=${testfile}.new" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5IMPORT-${testname}-H5DMP_CMP PROPERTIES DEPENDS H5IMPORT-${testname}-H5DMP) + set_tests_properties (H5IMPORT-${testname}-H5DMP_CMP PROPERTIES + DEPENDS H5IMPORT-${testname}-H5DMP + ) endif () endmacro () @@ -160,23 +163,19 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5IMPORT-DUMP-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove + COMMAND ${CMAKE_COMMAND} -E remove d${testfile} d${testfile}.bin - d${testfile}.dmp - d${testfile}.dmp.err - d${testfile}.imp - d${testfile}.imp.err - d${testfile}.dff - d${testfile}.dff.err ) - set_tests_properties (H5IMPORT-DUMP-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) + set_tests_properties (H5IMPORT-DUMP-${testname}-clear-objects PROPERTIES + DEPENDS H5IMPORT-${testname}-H5DMP_CMP + ) if ("${ARGN}" STREQUAL "BINARY") add_test ( NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-b;NATIVE;testfiles/${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -189,6 +188,7 @@ add_test ( NAME H5IMPORT-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-y;--width=1;testfiles/${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -198,11 +198,14 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () - set_tests_properties (H5IMPORT-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects") + set_tests_properties (H5IMPORT-DUMP-${testname}-H5DMP PROPERTIES + DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects" + ) add_test ( NAME H5IMPORT-DUMP-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5import${tgt_ext}>" -D "TEST_ARGS:STRING=d${testfile}.bin;-c;d${testfile}.dmp;-o;d${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -211,11 +214,14 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5IMPORT-DUMP-${testname} PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-H5DMP") + set_tests_properties (H5IMPORT-DUMP-${testname} PROPERTIES + DEPENDS "H5IMPORT-DUMP-${testname}-H5DMP" + ) add_test ( NAME H5IMPORT-DUMP-${testname}-H5DFF COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5diff${tgt_ext}>" -D "TEST_ARGS:STRING=-r;d${testfile};testfiles/${testfile};${datasetname};${datasetname}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -225,7 +231,9 @@ -D "TEST_REFERENCE=testfiles/d${testfile}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5IMPORT-DUMP-${testname}-H5DFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}") + set_tests_properties (H5IMPORT-DUMP-${testname}-H5DFF PROPERTIES + DEPENDS "H5IMPORT-DUMP-${testname}" + ) endif () endmacro () @@ -234,22 +242,18 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5IMPORT_SUB-DUMP-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - d-${testname}.dmp - d-${testname}.dmp.err + COMMAND ${CMAKE_COMMAND} -E remove d-${testname}.h5 - ${testname}.dmp - ${testname}.dmp.err - ${testname}.imp - ${testname}.imp.err ${testname}.bin ) - set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-h5importtest) + set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-clear-objects PROPERTIES + FIXTURES_REQUIRED set_h5importtest + ) add_test ( NAME H5IMPORT_SUB-DUMP-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=-p;-d;${datasetname};${ARGN};-o;${testname}.bin;-b;NATIVE;testfiles/${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -258,11 +262,14 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT_SUB-DUMP-${testname}-clear-objects") + set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-H5DMP PROPERTIES + DEPENDS "H5IMPORT_SUB-DUMP-${testname}-clear-objects" + ) add_test ( NAME H5IMPORT_SUB-DUMP-${testname}-H5IMP COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5import${tgt_ext}>" -D "TEST_ARGS:STRING=${testname}.bin;-c;${testname}.dmp;-o;d-${testname}.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -271,10 +278,13 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-H5IMP PROPERTIES DEPENDS "H5IMPORT_SUB-DUMP-${testname}-H5DMP") + set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-H5IMP PROPERTIES + DEPENDS "H5IMPORT_SUB-DUMP-${testname}-H5DMP" + ) add_test ( NAME H5IMPORT_SUB-DUMP-${testname}-CMP COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=-p;d-${testname}.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -283,7 +293,9 @@ -D "TEST_REFERENCE=testfiles/${testname}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-CMP PROPERTIES DEPENDS "H5IMPORT_SUB-DUMP-${testname}-H5IMP") + set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-CMP PROPERTIES + DEPENDS "H5IMPORT_SUB-DUMP-${testname}-H5IMP" + ) endif () endmacro () @@ -314,8 +326,7 @@ # Remove any output file left over from previous test run add_test ( NAME H5IMPORT-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove + COMMAND ${CMAKE_COMMAND} -E remove binfp64.bin binin8.bin binin8w.bin @@ -324,164 +335,40 @@ binuin16.bin binuin32.bin txtin32.h5 - txtin32.h5.new - txtin32.h5.new.err - txtin32.h5.out - txtin32.h5.out.err txtin16.h5 - txtin16.h5.new - txtin16.h5.new.err - txtin16.h5.out - txtin16.h5.out.err txtin8.h5 - txtin8.h5.new - txtin8.h5.new.err - txtin8.h5.out - txtin8.h5.out.err txtuin16.h5 - txtuin16.h5.new - txtuin16.h5.new.err - txtuin16.h5.out - txtuin16.h5.out.err txtuin32.h5 - txtuin32.h5.new - txtuin32.h5.new.err - txtuin32.h5.out - txtuin32.h5.out.err txtfp32.h5 - txtfp32.h5.new - txtfp32.h5.new.err - txtfp32.h5.out - txtfp32.h5.out.err txtfp64.h5 - txtfp64.h5.new - txtfp64.h5.new.err - txtfp64.h5.out - txtfp64.h5.out.err binfp64.h5 - binfp64.h5.new - binfp64.h5.new.err - binfp64.h5.out - binfp64.h5.out.err binin8.h5 - binin8.h5.new - binin8.h5.new.err - binin8.h5.out - binin8.h5.out.err binin8w.h5 - binin8w.h5.new - binin8w.h5.new.err - binin8w.h5.out - binin8w.h5.out.err binin16.h5 - binin16.h5.new - binin16.h5.new.err - binin16.h5.out - binin16.h5.out.err binin32.h5 - binin32.h5.new - binin32.h5.new.err - binin32.h5.out - binin32.h5.out.err binuin16.h5 - binuin16.h5.new - binuin16.h5.new.err - binuin16.h5.out - binuin16.h5.out.err binuin32.h5 - binuin32.h5.new - binuin32.h5.new.err - binuin32.h5.out - binuin32.h5.out.err txtstr.h5 - txtstr.h5.new - txtstr.h5.new.err - txtstr.h5.out - txtstr.h5.out.err textpfe.h5 - textpfe.h5.new - textpfe.h5.new.err - textpfe.h5.out - textpfe.h5.out.err dbinfp64.h5 dbinfp64.h5.bin - dbinfp64.h5.imp - dbinfp64.h5.imp.err - dbinfp64.h5.dmp - dbinfp64.h5.dmp.err - dbinfp64.h5.dff - dbinfp64.h5.dff.err dbinin8.h5 dbinin8.h5.bin - dbinin8.h5.imp - dbinin8.h5.imp.err - dbinin8.h5.dmp - dbinin8.h5.dmp.err - dbinin8.h5.dff - dbinin8.h5.dff.err dbinin8w.h5 dbinin8w.h5.bin - dbinin8w.h5.imp - dbinin8w.h5.imp.err - dbinin8w.h5.dmp - dbinin8w.h5.dmp.err - dbinin8w.h5.dff - dbinin8w.h5.dff.err dbinin16.h5 dbinin16.h5.bin - dbinin16.h5.imp - dbinin16.h5.imp.err - dbinin16.h5.dmp - dbinin16.h5.dmp.err - dbinin16.h5.dff - dbinin16.h5.dff.err dbinin32.h5 dbinin32.h5.bin - dbinin32.h5.imp - dbinin32.h5.imp.err - dbinin32.h5.dmp - dbinin32.h5.dmp.err - dbinin32.h5.dff - dbinin32.h5.dff.err dbinuin16.h5 dbinuin16.h5.bin - dbinuin16.h5.imp - dbinuin16.h5.imp.err - dbinuin16.h5.dmp - dbinuin16.h5.dmp.err - dbinuin16.h5.dff - dbinuin16.h5.dff.err dbinuin32.h5 dbinuin32.h5.bin - dbinuin32.h5.imp - dbinuin32.h5.imp.err - dbinuin32.h5.dmp - dbinuin32.h5.dmp.err - dbinuin32.h5.dff - dbinuin32.h5.dff.err dtxtstr.h5 dtxtstr.h5.bin - dtxtstr.h5.imp - dtxtstr.h5.imp.err - dtxtstr.h5.dmp - dtxtstr.h5.dmp.err - dtxtstr.h5.dff - dtxtstr.h5.dff.err - tall_fp32.dmp - tall_fp32.dmp.err tall_fp32.bin - tall_fp32.imp - tall_fp32.imp.err - d-tall_fp32.dmp - d-tall_fp32.dmp.err d-tall_fp32.h5 - tall_i32.dmp - tall_i32.dmp.err tall_i32.bin - tall_i32.imp - tall_i32.imp.err - d-tall_i32.dmp - d-tall_i32.dmp.err d-tall_i32.h5 ) set (last_test "H5IMPORT-clear-objects") @@ -489,8 +376,7 @@ add_test ( NAME H5IMPORT-h5importtest-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove + COMMAND ${CMAKE_COMMAND} -E remove binfp64.bin binfp64.conf binin8.bin @@ -506,13 +392,12 @@ binuin32.bin binuin32.conf ) - if (last_test) - set_tests_properties (H5IMPORT-h5importtest-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "H5IMPORT-clear-objects") - add_test (NAME H5IMPORT-h5importtest COMMAND $<TARGET_FILE:h5importtest>) - set_tests_properties (H5IMPORT-h5importtest PROPERTIES DEPENDS H5IMPORT-h5importtest-clear-objects) + add_test (NAME H5IMPORT-h5importtest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5importtest>) + set_tests_properties (H5IMPORT-h5importtest PROPERTIES + FIXTURES_SETUP set_h5importtest + DEPENDS H5IMPORT-h5importtest-clear-objects + ) # ----- TESTING "ASCII I32 rank 3 - Output BE " ; ADD_H5_TEST (ASCII_I32 testfiles/txtin32.txt testfiles/txtin32.conf txtin32.h5) diff --git a/tools/test/h5import/h5importtest.c b/tools/test/h5import/h5importtest.c index bbb67b6..560f1b3 100644 --- a/tools/test/h5import/h5importtest.c +++ b/tools/test/h5import/h5importtest.c @@ -183,8 +183,8 @@ main(void) for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) - (void) fprintf(sp, "%10u", b8i3[k][i][j]); - (void) fprintf(sp, "\n"); + (void) HDfprintf(sp, "%10u", b8i3[k][i][j]); + (void) HDfprintf(sp, "\n"); } } (void) HDfclose(sp); @@ -200,8 +200,8 @@ main(void) for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) - (void) fprintf(sp, "%10u", b16i3[k][i][j]); - (void) fprintf(sp, "\n"); + (void) HDfprintf(sp, "%10u", b16i3[k][i][j]); + (void) HDfprintf(sp, "\n"); } } (void) HDfclose(sp); @@ -217,8 +217,8 @@ main(void) for (i = 0; i < nrow; i++) { for (j = 0; j < ncol; j++) - (void) fprintf(sp, "%10d", b32i3[k][i][j]); - (void) fprintf(sp, "\n"); + (void) HDfprintf(sp, "%10d", b32i3[k][i][j]); + (void) HDfprintf(sp, "\n"); } } (void) HDfclose(sp); @@ -243,16 +243,16 @@ main(void) (void) HDfclose(sp); sp = HDfopen("binin32.conf", "w"); - (void) fprintf(sp, "PATH /int/bin/32-bit\n"); - (void) fprintf(sp, "INPUT-CLASS IN\n"); - (void) fprintf(sp, "INPUT-SIZE 32\n"); - (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); - (void) fprintf(sp, "RANK 3\n"); - (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); - (void) fprintf(sp, "OUTPUT-BYTE-ORDER BE\n"); - (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n"); - (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 1 2 1\n"); - (void) fprintf(sp, "\n"); + (void) HDfprintf(sp, "PATH /int/bin/32-bit\n"); + (void) HDfprintf(sp, "INPUT-CLASS IN\n"); + (void) HDfprintf(sp, "INPUT-SIZE 32\n"); + (void) HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void) HDfprintf(sp, "RANK 3\n"); + (void) HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void) HDfprintf(sp, "OUTPUT-BYTE-ORDER BE\n"); + (void) HDfprintf(sp, "DIMENSION-SIZES 5 3 4\n"); + (void) HDfprintf(sp, "CHUNKED-DIMENSION-SIZES 1 2 1\n"); + (void) HDfprintf(sp, "\n"); (void) HDfclose(sp); /*------------------------------------------------------------------------- @@ -274,15 +274,15 @@ main(void) (void) HDfclose(sp); sp = HDfopen("binuin32.conf", "w"); - (void) fprintf(sp, "PATH /int/buin/32-bit\n"); - (void) fprintf(sp, "INPUT-CLASS UIN\n"); - (void) fprintf(sp, "INPUT-SIZE 32\n"); - (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); - (void) fprintf(sp, "RANK 3\n"); - (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); - (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); - (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n"); - (void) fprintf(sp, "\n"); + (void) HDfprintf(sp, "PATH /int/buin/32-bit\n"); + (void) HDfprintf(sp, "INPUT-CLASS UIN\n"); + (void) HDfprintf(sp, "INPUT-SIZE 32\n"); + (void) HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void) HDfprintf(sp, "RANK 3\n"); + (void) HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void) HDfprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); + (void) HDfprintf(sp, "DIMENSION-SIZES 5 3 4\n"); + (void) HDfprintf(sp, "\n"); (void) HDfclose(sp); /*------------------------------------------------------------------------- @@ -304,17 +304,17 @@ main(void) (void) HDfclose(sp); sp = HDfopen("binin16.conf", "w"); - (void) fprintf(sp, "PATH /int/bin/16-bit\n"); - (void) fprintf(sp, "INPUT-CLASS IN\n"); - (void) fprintf(sp, "INPUT-SIZE 16\n"); - (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); - (void) fprintf(sp, "RANK 3\n"); - (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); - (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); - (void) fprintf(sp, "DIMENSION-SIZES 2 3 4\n"); - (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); - (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n"); - (void) fprintf(sp, "\n"); + (void) HDfprintf(sp, "PATH /int/bin/16-bit\n"); + (void) HDfprintf(sp, "INPUT-CLASS IN\n"); + (void) HDfprintf(sp, "INPUT-SIZE 16\n"); + (void) HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void) HDfprintf(sp, "RANK 3\n"); + (void) HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void) HDfprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); + (void) HDfprintf(sp, "DIMENSION-SIZES 2 3 4\n"); + (void) HDfprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); + (void) HDfprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n"); + (void) HDfprintf(sp, "\n"); (void) HDfclose(sp); /*------------------------------------------------------------------------- @@ -335,17 +335,17 @@ main(void) (void) HDfclose(sp); sp = HDfopen("binuin16.conf", "w"); - (void) fprintf(sp, "PATH /int/buin/16-bit\n"); - (void) fprintf(sp, "INPUT-CLASS UIN\n"); - (void) fprintf(sp, "INPUT-SIZE 16\n"); - (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); - (void) fprintf(sp, "RANK 3\n"); - (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); - (void) fprintf(sp, "OUTPUT-BYTE-ORDER BE\n"); - (void) fprintf(sp, "DIMENSION-SIZES 2 3 4\n"); - (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); - (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n"); - (void) fprintf(sp, "\n"); + (void) HDfprintf(sp, "PATH /int/buin/16-bit\n"); + (void) HDfprintf(sp, "INPUT-CLASS UIN\n"); + (void) HDfprintf(sp, "INPUT-SIZE 16\n"); + (void) HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void) HDfprintf(sp, "RANK 3\n"); + (void) HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void) HDfprintf(sp, "OUTPUT-BYTE-ORDER BE\n"); + (void) HDfprintf(sp, "DIMENSION-SIZES 2 3 4\n"); + (void) HDfprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); + (void) HDfprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 8\n"); + (void) HDfprintf(sp, "\n"); (void) HDfclose(sp); /*------------------------------------------------------------------------- @@ -367,20 +367,20 @@ main(void) (void) HDfclose(sp); sp = HDfopen("binin8.conf", "w"); - (void) fprintf(sp, "PATH /int/bin/8-bit\n"); - (void) fprintf(sp, "INPUT-CLASS IN\n"); - (void) fprintf(sp, "INPUT-SIZE 8\n"); - (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); - (void) fprintf(sp, "RANK 3\n"); - (void) fprintf(sp, "OUTPUT-CLASS IN\n"); - (void) fprintf(sp, "OUTPUT-SIZE 16\n"); - (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); - (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); - (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n"); - (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); - (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 -1\n"); - (void) fprintf(sp, "COMPRESSION-PARAM 3\n"); - (void) fprintf(sp, "\n"); + (void) HDfprintf(sp, "PATH /int/bin/8-bit\n"); + (void) HDfprintf(sp, "INPUT-CLASS IN\n"); + (void) HDfprintf(sp, "INPUT-SIZE 8\n"); + (void) HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void) HDfprintf(sp, "RANK 3\n"); + (void) HDfprintf(sp, "OUTPUT-CLASS IN\n"); + (void) HDfprintf(sp, "OUTPUT-SIZE 16\n"); + (void) HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void) HDfprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); + (void) HDfprintf(sp, "DIMENSION-SIZES 5 3 4\n"); + (void) HDfprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); + (void) HDfprintf(sp, "MAXIMUM-DIMENSIONS -1 -1 -1\n"); + (void) HDfprintf(sp, "COMPRESSION-PARAM 3\n"); + (void) HDfprintf(sp, "\n"); (void) HDfclose(sp); #endif /* UNICOS */ @@ -408,18 +408,18 @@ main(void) (void) HDfclose(sp); sp = HDfopen("binfp64.conf", "w"); - (void) fprintf(sp, "PATH /fp/bin/64-bit\n"); - (void) fprintf(sp, "INPUT-CLASS FP\n"); - (void) fprintf(sp, "INPUT-SIZE 64\n"); - (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); - (void) fprintf(sp, "RANK 3\n"); - (void) fprintf(sp, "OUTPUT-ARCHITECTURE IEEE\n"); - (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); - (void) fprintf(sp, "DIMENSION-SIZES 5 3 4\n"); - (void) fprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); - (void) fprintf(sp, "MAXIMUM-DIMENSIONS -1 6 7\n"); - (void) fprintf(sp, "COMPRESSION-PARAM 8\n"); - (void) fprintf(sp, "\n"); + (void) HDfprintf(sp, "PATH /fp/bin/64-bit\n"); + (void) HDfprintf(sp, "INPUT-CLASS FP\n"); + (void) HDfprintf(sp, "INPUT-SIZE 64\n"); + (void) HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void) HDfprintf(sp, "RANK 3\n"); + (void) HDfprintf(sp, "OUTPUT-ARCHITECTURE IEEE\n"); + (void) HDfprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); + (void) HDfprintf(sp, "DIMENSION-SIZES 5 3 4\n"); + (void) HDfprintf(sp, "CHUNKED-DIMENSION-SIZES 2 2 2\n"); + (void) HDfprintf(sp, "MAXIMUM-DIMENSIONS -1 6 7\n"); + (void) HDfprintf(sp, "COMPRESSION-PARAM 8\n"); + (void) HDfprintf(sp, "\n"); (void) HDfclose(sp); /*------------------------------------------------------------------------- @@ -436,21 +436,21 @@ main(void) { char c = bin8w[i]; if ( HDfwrite( &c, sizeof(char), 1, sp) != 1 ) - printf("error writing file\n"); + HDprintf("error writing file\n"); } HDfclose(sp); sp = HDfopen("binin8w.conf", "w"); - (void) fprintf(sp, "INPUT-CLASS IN\n"); - (void) fprintf(sp, "INPUT-SIZE 8\n"); - (void) fprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); - (void) fprintf(sp, "RANK 1\n"); - (void) fprintf(sp, "OUTPUT-CLASS IN\n"); - (void) fprintf(sp, "OUTPUT-SIZE 8\n"); - (void) fprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); - (void) fprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); - (void) fprintf(sp, "DIMENSION-SIZES 4\n"); - (void) fprintf(sp, "\n"); + (void) HDfprintf(sp, "INPUT-CLASS IN\n"); + (void) HDfprintf(sp, "INPUT-SIZE 8\n"); + (void) HDfprintf(sp, "INPUT-BYTE-ORDER %s\n", machine_order); + (void) HDfprintf(sp, "RANK 1\n"); + (void) HDfprintf(sp, "OUTPUT-CLASS IN\n"); + (void) HDfprintf(sp, "OUTPUT-SIZE 8\n"); + (void) HDfprintf(sp, "OUTPUT-ARCHITECTURE STD\n"); + (void) HDfprintf(sp, "OUTPUT-BYTE-ORDER LE\n"); + (void) HDfprintf(sp, "DIMENSION-SIZES 4\n"); + (void) HDfprintf(sp, "\n"); (void) HDfclose(sp); } diff --git a/tools/test/h5jam/CMakeLists.txt b/tools/test/h5jam/CMakeLists.txt index 585a8a1..6fdf7b0 100644 --- a/tools/test/h5jam/CMakeLists.txt +++ b/tools/test/h5jam/CMakeLists.txt @@ -11,7 +11,7 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) target_link_libraries (h5jamgentest PRIVATE ${HDF5_LIB_TARGET}) set_target_properties (h5jamgentest PROPERTIES FOLDER generator/tools) - #add_test (NAME h5jamgentest COMMAND $<TARGET_FILE:h5jamgentest>) + #add_test (NAME h5jamgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jamgentest>) endif () add_executable (getub ${HDF5_TOOLS_TEST_H5JAM_SOURCE_DIR}/getub.c) diff --git a/tools/test/h5jam/CMakeTests.cmake b/tools/test/h5jam/CMakeTests.cmake index 84af48b..f108afc 100644 --- a/tools/test/h5jam/CMakeTests.cmake +++ b/tools/test/h5jam/CMakeTests.cmake @@ -60,21 +60,15 @@ macro (TEST_H5JAM_OUTPUT expectfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5JAM-${expectfile} COMMAND $<TARGET_FILE:h5jam${tgt_ext}> ${ARGN}) + add_test (NAME H5JAM-${expectfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_ext}> ${ARGN}) if (${resultcode}) set_tests_properties (H5JAM-${expectfile} PROPERTIES WILL_FAIL "true") endif () else () add_test ( - NAME H5JAM-${expectfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${expectfile}.out - ${expectfile}.out.err - ) - add_test ( NAME H5JAM-${expectfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5jam${tgt_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -85,7 +79,6 @@ -D "TEST_REFERENCE=testfiles/${expectfile}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5JAM-${expectfile} PROPERTIES DEPENDS "H5JAM-${expectfile}-clear-objects") endif () endmacro () @@ -96,21 +89,15 @@ macro (TEST_H5UNJAM_OUTPUT expectfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5JAM-UNJAM-${expectfile} COMMAND $<TARGET_FILE:h5unjam${tgt_ext}> ${ARGN}) + add_test (NAME H5JAM-UNJAM-${expectfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_ext}> ${ARGN}) if (${resultcode}) set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES WILL_FAIL "true") endif () else () add_test ( - NAME H5JAM-UNJAM-${expectfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${expectfile}.out - ${expectfile}.out.err - ) - add_test ( NAME H5JAM-UNJAM-${expectfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam${tgt_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -119,7 +106,6 @@ -D "TEST_REFERENCE=testfiles/${expectfile}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5JAM-UNJAM-${expectfile} PROPERTIES DEPENDS "H5JAM-UNJAM-${expectfile}-clear-objects") endif () endmacro () @@ -127,18 +113,9 @@ # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5JAM-${testname}-CHECKFILE-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${actual}.new - ${actual}.new.err - ${actual}.out - ${actual}.out.err - ) - set_tests_properties (H5JAM-${testname}-CHECKFILE-clear-objects PROPERTIES DEPENDS ${testdepends}) - add_test ( NAME H5JAM-${testname}-CHECKFILE-H5DMP COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=testfiles/${expected}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -148,10 +125,11 @@ -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS H5JAM-${testname}-CHECKFILE-clear-objects) + set_tests_properties (H5JAM-${testname}-CHECKFILE-H5DMP PROPERTIES DEPENDS ${testdepends}) add_test ( NAME H5JAM-${testname}-CHECKFILE-H5DMP_CMP COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=${actual}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -187,7 +165,7 @@ COMMAND ${CMAKE_COMMAND} -E remove ${ufile} ) set_tests_properties (H5JAM-${testname}-UNJAM_D-clear-objects PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) - add_test (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam${tgt_ext}> -i ${infile} -u ${ufile} -o ${outfile}) + add_test (NAME H5JAM-${testname}-UNJAM COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_ext}> -i ${infile} -u ${ufile} -o ${outfile}) set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM_D-clear-objects) set (compare_test ${ufile}) else () @@ -195,6 +173,7 @@ add_test ( NAME H5JAM-${testname}-UNJAM COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5unjam${tgt_ext}>" -D "TEST_ARGS:STRING=-i;${infile};-o;${outfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -206,7 +185,7 @@ set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) set (compare_test "${outfile}.ufile.txt") else () - add_test (NAME H5JAM-${testname}-UNJAM COMMAND $<TARGET_FILE:h5unjam${tgt_ext}> -i ${infile} -o ${outfile}) + add_test (NAME H5JAM-${testname}-UNJAM COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5unjam${tgt_ext}> -i ${infile} -o ${outfile}) set_tests_properties (H5JAM-${testname}-UNJAM PROPERTIES DEPENDS H5JAM-${testname}-UNJAM-clear-objects) set (compare_test "") endif () @@ -214,8 +193,7 @@ if (${compare_test}) add_test ( NAME H5JAM-${testname}-UNJAM-CHECK_UB_1-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove + COMMAND ${CMAKE_COMMAND} -E remove ${infile}.len.txt ${infile}.cmp ${infile}-ub.cmp @@ -224,6 +202,7 @@ add_test ( NAME H5JAM-${testname}-UNJAM-CHECK_UB_1 COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:tellub>" -D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>" -D "TEST_CHECKUB=YES" @@ -240,6 +219,7 @@ add_test ( NAME H5JAM-${testname}-UNJAM-CHECK_NOUB COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:tellub>" -D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>" -D "TEST_CHECKUB=NO" @@ -267,7 +247,7 @@ COMMAND ${CMAKE_COMMAND} -E remove ${outfile} ${infile}.cpy.h5 ) endif () - add_test (NAME H5JAM-${testname} COMMAND $<TARGET_FILE:h5jam${tgt_ext}> -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN}) + add_test (NAME H5JAM-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_ext}> -u testfiles/${jamfile} -i testfiles/${infile} -o ${outfile} ${ARGN}) if (NOT HDF5_ENABLE_USING_MEMCHECKER) set_tests_properties (H5JAM-${testname} PROPERTIES DEPENDS H5JAM-${testname}-clear-objects) set (compare_test ${outfile}) @@ -278,8 +258,7 @@ add_test ( NAME H5JAM-${testname}-CHECK_UB_1-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove + COMMAND ${CMAKE_COMMAND} -E remove ${compare_test}.len.txt ${compare_test}.cmp ${compare_test}-ub.cmp @@ -288,6 +267,7 @@ add_test ( NAME H5JAM-${testname}-CHECK_UB_1 COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:tellub>" -D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>" -D "TEST_CHECKUB=YES" @@ -322,7 +302,7 @@ ) set_tests_properties (H5JAM-${testname}_NONE_COPY PROPERTIES DEPENDS H5JAM-${testname}_NONE-SETUP) - add_test (NAME H5JAM-${testname}_NONE COMMAND $<TARGET_FILE:h5jam${tgt_ext}> -u testfiles/${jamfile} -i ${chkfile} ${ARGN}) + add_test (NAME H5JAM-${testname}_NONE COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5jam${tgt_ext}> -u testfiles/${jamfile} -i ${chkfile} ${ARGN}) set_tests_properties (H5JAM-${testname}_NONE PROPERTIES DEPENDS H5JAM-${testname}_NONE_COPY) set (compare_test ${chkfile}) @@ -333,8 +313,7 @@ add_test ( NAME H5JAM-${testname}_NONE-CHECK_UB_1-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove + COMMAND ${CMAKE_COMMAND} -E remove ${compare_test}.len.txt ${compare_test}.cmp ${compare_test}-ub.cmp @@ -343,6 +322,7 @@ add_test ( NAME H5JAM-${testname}_NONE-CHECK_UB_1 COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:tellub>" -D "TEST_GET_PROGRAM=$<TARGET_FILE:getub>" -D "TEST_CHECKUB=YES" diff --git a/tools/test/h5jam/h5jamgentest.c b/tools/test/h5jam/h5jamgentest.c index 1644440..56b4ead 100644 --- a/tools/test/h5jam/h5jamgentest.c +++ b/tools/test/h5jam/h5jamgentest.c @@ -172,7 +172,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill) dims[0] = 10; space = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(group, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT); - sprintf(buf, "abcdefghi"); + HDsprintf(buf, "abcdefghi"); H5Awrite(attr, H5T_NATIVE_SCHAR, buf); H5Sclose(space); H5Aclose(attr); @@ -203,7 +203,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill) dims[0] = 27; space = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(dataset, "attr1", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT); - sprintf(buf, "1st attribute of dset1.1.1"); + HDsprintf(buf, "1st attribute of dset1.1.1"); H5Awrite(attr, H5T_NATIVE_SCHAR, buf); H5Sclose(space); H5Aclose(attr); @@ -211,7 +211,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill) dims[0] = 27; space = H5Screate_simple(1, dims, NULL); attr = H5Acreate2(dataset, "attr2", H5T_STD_I8BE, space, H5P_DEFAULT, H5P_DEFAULT); - sprintf(buf, "2nd attribute of dset1.1.1"); + HDsprintf(buf, "2nd attribute of dset1.1.1"); H5Awrite(attr, H5T_NATIVE_SCHAR, buf); H5Sclose(space); H5Aclose(attr); diff --git a/tools/test/h5ls/CMakeTests.cmake b/tools/test/h5ls/CMakeTests.cmake index cd62297..2f3f3ab 100644 --- a/tools/test/h5ls/CMakeTests.cmake +++ b/tools/test/h5ls/CMakeTests.cmake @@ -143,26 +143,17 @@ macro (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5LS-${resultfile} COMMAND $<TARGET_FILE:h5ls${tgt_ext}> ${ARGN}) + add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_ext}> ${ARGN}) set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (${resultcode} EQUAL 1) set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") endif () - if (last_test) - set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () else () # Remove any output file left over from previous test run add_test ( - NAME H5LS-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/${resultfile}.out - testfiles/${resultfile}.out.err - ) - add_test ( NAME H5LS-${resultfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -171,33 +162,22 @@ -D "TEST_REFERENCE=${resultfile}.ls" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS H5LS-${resultfile}-clear-objects) endif () endmacro () macro (ADD_H5_ERR_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5LS-${resultfile} COMMAND $<TARGET_FILE:h5ls> ${ARGN}) + add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls> ${ARGN}) set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") if (${resultcode} EQUAL 1) set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") endif () - if (last_test) - set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () else () - # Remove any output file left over from previous test run - add_test ( - NAME H5LS-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/${resultfile}.out - testfiles/${resultfile}.out.err - ) add_test ( NAME H5LS-${resultfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -207,23 +187,15 @@ -D "TEST_ERRREF=${resultfile}.err" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS H5LS-${resultfile}-clear-objects) endif () endmacro () macro (ADD_H5_UD_TEST testname resultcode resultfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - add_test ( - NAME H5LS_UD-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/${resultfile}.out - testfiles/${resultfile}.out.err - ) add_test ( NAME H5LS_UD-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -235,7 +207,6 @@ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5LS_UD-${testname} PROPERTIES DEPENDS H5LS_UD-${testname}-clear-objects) endif () endmacro () @@ -245,128 +216,6 @@ ############################################################################## ############################################################################## - if (HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - add_test ( - NAME H5LS-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - help-1.out - help-1.out.err - help-2.out - help-2.out.err - help-3.out - help-3.out.err - nosuchfile.out - nosuchfile.out.err - tall-1.out - tall-1.out.err - tall-2.out - tall-2.out.err - tarray1.out - tarray1.out.err - tattr2.out - tattr2.out.err - tcomp-1.out - tcomp-1.out.err - tdataregbe.out - tdataregbe.out.err - tdataregle.out - tdataregle.out.err - tdset-1.out - tdset-1.out.err - tempty.out - tempty.out.err - textlink-1.out - textlink-1.out.err - textlinksrc-1.out - textlinksrc-1.out.err - textlinksrc-2.out - textlinksrc-2.out.err - textlinksrc-3.out - textlinksrc-3.out.err - textlinksrc-4.out - textlinksrc-4.out.err - textlinksrc-5.out - textlinksrc-5.out.err - textlinksrc-6.out - textlinksrc-6.out.err - textlinksrc-7.out - textlinksrc-7.out.err - textlinksrc-1-old.out - textlinksrc-1-old.out.err - textlinksrc-2-old.out - textlinksrc-2-old.out.err - textlinksrc-3-old.out - textlinksrc-3-old.out.err - textlinksrc-6-old.out - textlinksrc-6-old.out.err - textlinksrc-7-old.out - textlinksrc-7-old.out.err - tgrp_comments.out - tgrp_comments.out.err - tgrpnullspace.out - tgrpnullspace.out.err - tsoftlinks-1.out - tsoftlinks-1.out.err - tsoftlinks-2.out - tsoftlinks-2.out.err - tsoftlinks-3.out - tsoftlinks-3.out.err - tsoftlinks-4.out - tsoftlinks-4.out.err - tsoftlinks-5.out - tsoftlinks-5.out.err - textlinksrc-nodangle-1.out - textlinksrc-nodangle-1.out.err - textlinksrc-nodangle-2.out - textlinksrc-nodangle-2.out.err - tsoftlinks-nodangle-1.out - tsoftlinks-nodangle-1.out.err - thlinks-nodangle-1.out - thlinks-nodangle-1.out.err - tgroup.out - tgroup.out.err - tgroup-1.out - tgroup-1.out.err - tgroup-2.out - tgroup-2.out.err - tgroup-3.out - tgroup-3.out.err - thlink-1.out - thlink-1.out.err - tloop-1.out - tloop-1.out.err - tnestcomp-1.out - tnestcomp-1.out.err - tnestcomp-2.out - tnestcomp-2.out.err - tnestcomp-3.out - tnestcomp-3.out.err - tnestcomp-4.out - tnestcomp-4.out.err - tsaf.out - tsaf.out.err - tslink-1.out - tslink-1.out.err - tstr-1.out - tstr-1.out.err - tudlink-1.out - tudlink-1.out.err - tvldtypes1.out - tvldtypes1.out.err - tvldtypes2le.out - tvldtypes2le.out.err - tvldtypes2be.out - tvldtypes2be.out.err - ) - set_tests_properties (H5LS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - if (last_test) - set_tests_properties (H5LS-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "H5LS-clearall-objects") - endif () - # See which filters are usable (and skip tests for filters we # don't have). Do this by searching H5pubconf.h to see which # filters are defined. diff --git a/tools/test/h5ls/CMakeTestsVDS.cmake b/tools/test/h5ls/CMakeTestsVDS.cmake index 04fb306..cf5b6d7 100644 --- a/tools/test/h5ls/CMakeTestsVDS.cmake +++ b/tools/test/h5ls/CMakeTestsVDS.cmake @@ -89,26 +89,16 @@ macro (ADD_H5_VDS_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5LS-${resultfile} COMMAND $<TARGET_FILE:h5ls${tgt_ext}> ${ARGN}) + add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_ext}> ${ARGN}) set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") if (${resultcode} EQUAL 1) set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") endif () - if (last_test) - set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () else () add_test ( - NAME H5LS-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.out - ${resultfile}.out.err - ) - set_tests_properties (H5LS-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") - add_test ( NAME H5LS-${resultfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/vds" @@ -117,14 +107,13 @@ -D "TEST_REFERENCE=${resultfile}.ls" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5LS-${resultfile} PROPERTIES DEPENDS H5LS-${resultfile}-clear-objects) endif () endmacro () macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5LS_PREFIX-${resultfile} COMMAND $<TARGET_FILE:h5ls${tgt_ext}> ${ARGN}) + add_test (NAME H5LS_PREFIX-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_ext}> ${ARGN}) set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES ENVIRONMENT "HDF5_VDS_PREFIX=\${ORIGIN}" WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" @@ -132,21 +121,11 @@ if (${resultcode} EQUAL 1) set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES WILL_FAIL "true") endif () - if (last_test) - set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () else () add_test ( - NAME H5LS_PREFIX-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.out - ${resultfile}.out.err - ) - set_tests_properties (H5LS_PREFIX-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds/prefix") - add_test ( NAME H5LS_PREFIX-${resultfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -157,7 +136,6 @@ -D "TEST_ENV_VALUE=\${ORIGIN}" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5LS_PREFIX-${resultfile} PROPERTIES DEPENDS H5LS_PREFIX-${resultfile}-clear-objects) endif () endmacro () @@ -167,44 +145,6 @@ ############################################################################## ############################################################################## - if (HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - add_test ( - NAME H5LS_VDS-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - tvds-1.out - tvds-1.out.err - tvds-2.out - tvds-2.out.err - tvds-3_1.out - tvds-3_1.out.err - tvds-3_2.out - tvds-3_2.out.err - tvds-4.out - tvds-4.out.err - tvds-5.out - tvds-5.out.err - tvds_layout-1.out - tvds_layout-1.out.err - tvds_layout-2.out - tvds_layout-2.out.err - tvds_layout-3_1.out - tvds_layout-3_1.out.err - tvds_layout-3_2.out - tvds_layout-3_2.out.err - tvds_layout-4.out - tvds_layout-4.out.err - tvds_layout-5.out - tvds_layout-5.out.err - ) - set_tests_properties (H5LS_VDS-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds") - if (last_test) - set_tests_properties (H5LS_VDS-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "H5LS_VDS-clearall-objects") - endif () - ADD_H5_VDS_TEST (tvds-1 0 -w80 -v -S 1_vds.h5) ADD_H5_VDS_TEST (tvds-2 0 -w80 -v -S 2_vds.h5) ADD_H5_VDS_TEST (tvds-3_1 0 -w80 -v -S 3_1_vds.h5) diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index d31028a..eae1a7f 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -179,26 +179,15 @@ macro (ADD_HELP_TEST testname resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5REPACK-h5repack-${testname} COMMAND $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN}) - set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - if (last_test) - set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "H5REPACK-h5repack-${testname}") - else () - add_test ( - NAME H5REPACK-h5repack-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/h5repack-${testname}.out - testfiles/h5repack-${testname}.out.err + add_test (NAME H5REPACK-h5repack-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN}) + set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" ) - if (last_test) - set_tests_properties (H5REPACK-h5repack-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () + else () add_test ( NAME H5REPACK-h5repack-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -207,39 +196,43 @@ -D "TEST_REFERENCE=h5repack-${testname}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES DEPENDS H5REPACK-h5repack-${testname}-clear-objects) endif () + set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES + FIXTURES_REQUIRED clear_h5repack + ) endmacro () macro (ADD_H5_TEST_OLD testname testtype testfile) - if ("${testtype}" STREQUAL "SKIP") - if (NOT HDF5_ENABLE_USING_MEMCHECKER) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + if ("${testtype}" STREQUAL "SKIP") add_test ( NAME H5REPACK_OLD-${testname} COMMAND ${CMAKE_COMMAND} -E echo "SKIP ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile}" ) set_property(TEST H5REPACK_OLD-${testname} PROPERTY DISABLED) + else () + add_test ( + NAME H5REPACK_OLD-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_OLD-${testname}-clear-objects PROPERTIES + FIXTURES_REQUIRED clear_h5repack + ) + add_test ( + NAME H5REPACK_OLD-${testname} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_OLD-${testname} PROPERTIES + DEPENDS H5REPACK_OLD-${testname}-clear-objects + ) + add_test ( + NAME H5REPACK_OLD-${testname}_DFF + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_OLD-${testname}_DFF PROPERTIES + DEPENDS H5REPACK_OLD-${testname} + ) endif () - else () - add_test ( - NAME H5REPACK_OLD-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/out-${testname}.${testfile} - ) - if (last_test) - set_tests_properties (H5REPACK_OLD-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () - add_test ( - NAME H5REPACK_OLD-${testname} - COMMAND $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} - ) - set_tests_properties (H5REPACK_OLD-${testname} PROPERTIES DEPENDS H5REPACK_OLD-${testname}-clear-objects) - add_test ( - NAME H5REPACK_OLD-${testname}_DFF - COMMAND $<TARGET_FILE:h5diff${tgt_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} - ) - set_tests_properties (H5REPACK_OLD-${testname}_DFF PROPERTIES DEPENDS H5REPACK_OLD-${testname}) endif () endmacro () @@ -255,23 +248,25 @@ else () add_test ( NAME H5REPACK-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK-${testname}-clear-objects PROPERTIES + FIXTURES_REQUIRED clear_h5repack ) - if (last_test) - set_tests_properties (H5REPACK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () add_test ( NAME H5REPACK-${testname} - COMMAND $<TARGET_FILE:h5repack${tgt_ext}> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK-${testname} PROPERTIES + DEPENDS H5REPACK-${testname}-clear-objects ) - set_tests_properties (H5REPACK-${testname} PROPERTIES DEPENDS H5REPACK-${testname}-clear-objects) add_test ( NAME H5REPACK-${testname}_DFF - COMMAND $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> --enable-error-stack ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK-${testname}_DFF PROPERTIES + DEPENDS H5REPACK-${testname} ) - set_tests_properties (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname}) endif () endmacro () @@ -289,26 +284,20 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_CMP-${testname} - COMMAND $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} ) - if (last_test) - set_tests_properties (H5REPACK_CMP-${testname} PROPERTIES DEPENDS ${last_test}) - endif () else () add_test ( NAME H5REPACK_CMP-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/out-${testname}.${resultfile} - testfiles/${resultfile}-${testname}.out - testfiles/${resultfile}-${testname}.out.err + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile} + ) + set_tests_properties (H5REPACK_CMP-${testname}-clear-objects PROPERTIES + FIXTURES_REQUIRED clear_h5repack ) - if (last_test) - set_tests_properties (H5REPACK_CMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () add_test ( NAME H5REPACK_CMP-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_ext}>" -D "TEST_ARGS:STRING=${ARGN};${resultfile};out-${testname}.${resultfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -318,7 +307,9 @@ -D "TEST_REFERENCE=${resultfile}-${testname}.tst" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5REPACK_CMP-${testname} PROPERTIES DEPENDS H5REPACK_CMP-${testname}-clear-objects) + set_tests_properties (H5REPACK_CMP-${testname} PROPERTIES + DEPENDS H5REPACK_CMP-${testname}-clear-objects + ) endif () endif () endmacro () @@ -337,26 +328,23 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_MASK-${testname} - COMMAND $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} + ) + set_tests_properties (H5REPACK_MASK-${testname} PROPERTIES + FIXTURES_REQUIRED clear_h5repack ) - if (last_test) - set_tests_properties (H5REPACK_MASK-${testname} PROPERTIES DEPENDS ${last_test}) - endif () else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_MASK-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/out-${testname}.${resultfile} - testfiles/${resultfile}-${testname}.out - testfiles/${resultfile}-${testname}.out.err + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile} + ) + set_tests_properties (H5REPACK_MASK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test} + FIXTURES_REQUIRED clear_h5repack ) - if (last_test) - set_tests_properties (H5REPACK_MASK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () add_test ( NAME H5REPACK_MASK-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5repack${tgt_ext}>" -D "TEST_ARGS:STRING=${ARGN};${resultfile};out-${testname}.${resultfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -384,24 +372,23 @@ else () add_test ( NAME H5REPACK_DMP-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/out-${testname}.${resultfile} - testfiles/${resultfile}-${testname}.out - testfiles/${resultfile}-${testname}.out.err + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile} + ) + set_tests_properties (H5REPACK_DMP-${testname}-clear-objects PROPERTIES + FIXTURES_REQUIRED clear_h5repack ) - if (last_test) - set_tests_properties (H5REPACK_DMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () add_test ( NAME H5REPACK_DMP-${testname} - COMMAND $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} + ) + set_tests_properties (H5REPACK_DMP-${testname} PROPERTIES + DEPENDS H5REPACK_DMP-${testname}-clear-objects ) - set_tests_properties (H5REPACK_DMP-${testname} PROPERTIES DEPENDS H5REPACK_DMP-${testname}-clear-objects) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_DMP-h5dump-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=-q;creation_order;-pH;out-${testname}.${resultfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -410,7 +397,9 @@ -D "TEST_REFERENCE=${testname}.${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5REPACK_DMP-h5dump-${testname} PROPERTIES DEPENDS "H5REPACK_DMP-${testname}") + set_tests_properties (H5REPACK_DMP-h5dump-${testname} PROPERTIES + DEPENDS "H5REPACK_DMP-${testname}" + ) endif () endif () endmacro () @@ -427,24 +416,23 @@ else () add_test ( NAME H5REPACK_STAT-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/out-${statarg}.${resultfile} - testfiles/${resultfile}-${testname}.out - testfiles/${resultfile}-${testname}.out.err + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${statarg}.${resultfile} + ) + set_tests_properties (H5REPACK_STAT-${testname}-clear-objects PROPERTIES + FIXTURES_REQUIRED clear_h5repack ) - if (last_test) - set_tests_properties (H5REPACK_STAT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () add_test ( NAME H5REPACK_STAT-${testname} - COMMAND $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${statarg}.${resultfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${statarg}.${resultfile} + ) + set_tests_properties (H5REPACK_STAT-${testname} PROPERTIES + DEPENDS H5REPACK_STAT-${testname}-clear-objects ) - set_tests_properties (H5REPACK_STAT-${testname} PROPERTIES DEPENDS H5REPACK_STAT-${testname}-clear-objects) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_STAT-h5stat-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_ext}>" -D "TEST_ARGS:STRING=-S;-s;out-${statarg}.${resultfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -453,7 +441,9 @@ -D "TEST_REFERENCE=${statarg}.${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5REPACK_STAT-h5stat-${testname} PROPERTIES DEPENDS "H5REPACK_STAT-${testname}") + set_tests_properties (H5REPACK_STAT-h5stat-${testname} PROPERTIES + DEPENDS "H5REPACK_STAT-${testname}" + ) endif () endif () endmacro () @@ -471,29 +461,30 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/out-${testname}.${testfile} - testfiles/${testfile}-${testname}-v.out - testfiles/${testfile}-${testname}-v.out.err + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects PROPERTIES + FIXTURES_REQUIRED clear_h5repack ) - if (last_test) - set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname} - COMMAND $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES + DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects ) - set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects) add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DFF - COMMAND $<TARGET_FILE:h5diff${tgt_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES + DEPENDS H5REPACK_VERIFY_LAYOUT-${testname} ) - set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DFF PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}) if (NOT ${resultcode}) add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=-d;${testdset};-pH;out-${testname}.${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -503,7 +494,9 @@ -D "TEST_REFERENCE=${testfilter}" -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) - set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES + DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF + ) else () if ("${testfilter}" STREQUAL "CHUNKED") set (nottestfilter "(CONTIGUOUS|COMPACT)") @@ -517,6 +510,7 @@ add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname}_DMP COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=-pH;out-${testname}.${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -526,7 +520,9 @@ -D "TEST_REFERENCE=${testfilter}" -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) - set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF) + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}_DMP PROPERTIES + DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF + ) endif () endif () endif () @@ -546,24 +542,23 @@ # Remove any output file left over from previous test run add_test ( NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/out-${testname}.${testfile} - testfiles/${testfile}-${testname}-v.out - testfiles/${testfile}-${testname}-v.out.err + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clear-objects PROPERTIES + FIXTURES_REQUIRED clear_h5repack ) - if (last_test) - set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () add_test ( NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname} - COMMAND $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname} PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + DEPENDS H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clear-objects ) - set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clear-objects) add_test ( NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname}_DMP COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=-d;${testdset};-p;out-${testname}.${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -572,8 +567,10 @@ -D "TEST_REFERENCE=${testfile}-${testname}-v.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname}_DMP PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_LAYOUT_VDS-${testname}) + set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname}_DMP PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + DEPENDS H5REPACK_VERIFY_LAYOUT_VDS-${testname} + ) endif () endif () endmacro () @@ -583,23 +580,22 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/out-${testname}.${testfile} - testfiles/${testfile}-${testname}-v.out - testfiles/${testfile}-${testname}-v.out.err + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects PROPERTIES + FIXTURES_REQUIRED clear_h5repack ) - if (last_test) - set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () add_test ( NAME H5REPACK_VERIFY_SUPERBLOCK-${testname} - COMMAND $<TARGET_FILE:h5repack${tgt_ext}> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname} PROPERTIES + DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects ) - set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname} PROPERTIES DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects) add_test ( NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_ext}>" -D "TEST_ARGS:STRING=-H;-B;out-${testname}.${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -609,28 +605,27 @@ -D "TEST_REFERENCE=SUPERBLOCK_VERSION ${superblock}" -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) - set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}) + set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP PROPERTIES + DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname} + ) endif () endmacro () macro (ADD_H5_VERIFY_INVALIDBOUNDS testname resultcode lowbound highbound) add_test ( NAME ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile} + ) + set_tests_properties (ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects PROPERTIES + FIXTURES_REQUIRED clear_h5repack ) - if (last_test) - set_tests_properties (ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () add_test ( NAME ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} - COMMAND $<TARGET_FILE:h5repack${tgt_ext}> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} ) - set_tests_properties ( - ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} PROPERTIES - DEPENDS ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects - WILL_FAIL "true" + set_tests_properties (ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} PROPERTIES + DEPENDS ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects + WILL_FAIL "true" ) endmacro () @@ -638,28 +633,33 @@ # Remove any output file left over from previous test run add_test ( NAME H5REPACK_META-${testname}_N-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}_N.${testname}.h5 testfiles/out-${testname}_M.${testname}.h5 ) - if (last_test) - set_tests_properties (H5REPACK_META-${testname}_N-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () + set_tests_properties (H5REPACK_META-${testname}_N-clear-objects PROPERTIES + FIXTURES_REQUIRED clear_h5repack + ) add_test ( NAME H5REPACK_META-${testname}_N - COMMAND $<TARGET_FILE:h5repack${tgt_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 + ) + set_tests_properties (H5REPACK_META-${testname}_N PROPERTIES + DEPENDS H5REPACK_META-${testname}_N-clear-objects ) - set_tests_properties (H5REPACK_META-${testname}_N PROPERTIES DEPENDS H5REPACK_META-${testname}_N-clear-objects) add_test ( NAME H5REPACK_META-${testname}_M - COMMAND $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5 + ) + set_tests_properties (H5REPACK_META-${testname}_M PROPERTIES + DEPENDS H5REPACK_META-${testname}_N ) - set_tests_properties (H5REPACK_META-${testname}_M PROPERTIES DEPENDS H5REPACK_META-${testname}_N) add_test (NAME H5REPACK_META-${testname} COMMAND ${CMAKE_COMMAND} -E compare_files ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_N.${testname}.h5 ${PROJECT_BINARY_DIR}/testfiles/out-${testname}_M.${testname}.h5) - set_tests_properties (H5REPACK_META-${testname} PROPERTIES WILL_FAIL "true") - set_tests_properties (H5REPACK_META-${testname} PROPERTIES DEPENDS H5REPACK_META-${testname}_M) + set_tests_properties (H5REPACK_META-${testname} PROPERTIES + WILL_FAIL "true" + DEPENDS H5REPACK_META-${testname}_M + ) endmacro () macro (ADD_H5_UD_TEST testname resultcode resultfile) @@ -667,20 +667,15 @@ # Remove any output file left over from previous test run add_test ( NAME H5REPACK_UD-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/out-${testname}.${resultfile} - testfiles/${testname}.${resultfile}.out - testfiles/${testname}.${resultfile}.out.err - testfiles/${resultfile}-${testname}.out - testfiles/${resultfile}-${testname}.out.err + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile} + ) + set_tests_properties (H5REPACK_UD-${testname}-clear-objects PROPERTIES + FIXTURES_REQUIRED clear_h5repack ) - if (last_test) - set_tests_properties (H5REPACK_UD-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () add_test ( NAME H5REPACK_UD-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5repack-shared>" -D "TEST_ARGS:STRING=${ARGN};${resultfile};out-${testname}.${resultfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -693,10 +688,13 @@ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5REPACK_UD-${testname} PROPERTIES DEPENDS H5REPACK_UD-${testname}-clear-objects) + set_tests_properties (H5REPACK_UD-${testname} PROPERTIES + DEPENDS H5REPACK_UD-${testname}-clear-objects + ) add_test ( NAME H5REPACK_UD-${testname}-h5dump COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump-shared>" -D "TEST_ARGS:STRING=-pH;out-${testname}.${resultfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -708,7 +706,9 @@ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5REPACK_UD-${testname}-h5dump PROPERTIES DEPENDS "H5REPACK_UD-${testname}") + set_tests_properties (H5REPACK_UD-${testname}-h5dump PROPERTIES + DEPENDS "H5REPACK_UD-${testname}" + ) endif () endmacro () @@ -740,6 +740,7 @@ set (FILE15 h5repack_named_dtypes.h5) set (FILE16 tfamily%05d.h5) # located in common testfiles folder set (FILE18 h5repack_layout2.h5) + set (FILE19 h5repack_layout3.h5) set (FILE_REF h5repack_refs.h5) set (FILE_ATTR_REF h5repack_attr_refs.h5) set (FILEV1 1_vds.h5) @@ -752,67 +753,6 @@ if (HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run set (LIST_TO_CLEAR - h5dump-help.out - h5repack_layout.h5-chunk_18x13-v.out - h5repack_layout.h5-chunk_18x13-v.out.err - h5repack_layout.h5-chunk_20x10-v.out - h5repack_layout.h5-chunk_20x10-v.out.err - h5repack_layout.h5-chunk_compa-v.out - h5repack_layout.h5-chunk_compa-v.out.err - h5repack_layout.h5-chunk_conti-v.out - h5repack_layout.h5-chunk_conti-v.out.err - h5repack_layout.h5-compa-v.out - h5repack_layout.h5-compa-v.out.err - h5repack_layout.h5-conti-v.out - h5repack_layout.h5-conti-v.out.err - h5repack_layout.h5-deflate_limit.out - h5repack_layout.h5-deflate_limit.out.err - h5repack_layout.h5-dset2_chunk_20x10-v.out - h5repack_layout.h5-dset2_chunk_20x10-v.out.err - h5repack_layout.h5-dset2_chunk_20x10-errstk.out - h5repack_layout.h5-dset2_chunk_20x10-errstk.out.err - h5repack_layout.h5-dset2_compa-v.out - h5repack_layout.h5-dset2_compa-v.out.err - h5repack_layout.h5-dset2_conti-v.out - h5repack_layout.h5-dset2_conti-v.out.err - h5repack_layout.h5-dset_compa_chunk-v.out - h5repack_layout.h5-dset_compa_chunk-v.out.err - h5repack_layout.h5-dset_compa_compa-v.out - h5repack_layout.h5-dset_compa_compa-v.out.err - h5repack_layout.h5-dset_compa_conti-v.out - h5repack_layout.h5-dset_compa_conti-v.out.err - h5repack_layout.h5-dset_conti_chunk-v.out - h5repack_layout.h5-dset_conti_chunk-v.out.err - h5repack_layout.h5-dset_conti_compa-v.out - h5repack_layout.h5-dset_conti_compa-v.out.err - h5repack_layout.h5-dset_conti_conti-v.out - h5repack_layout.h5-dset_conti_conti-v.out.err - h5repack_layout.h5-layout_long_switches-v.out - h5repack_layout.h5-layout_long_switches-v.out.err - h5repack_layout.h5-layout_short_switches-v.out - h5repack_layout.h5-layout_short_switches-v.out.err - h5repack_layout.h5-plugin_test.out - h5repack_layout.h5-plugin_test.out.err - h5repack_layout2.h5-contig_small_compa-v.out - h5repack_layout2.h5-contig_small_compa-v.out.err - h5repack_layout2.h5-contig_small_fixed_compa-v.out - h5repack_layout2.h5-contig_small_fixed_compa-v.out.err - h5repack_layout3.h5-ckdim_biger-v.out - h5repack_layout3.h5-ckdim_biger-v.out.err - h5repack_layout3.h5-ckdim_smaller-v.out - h5repack_layout3.h5-ckdim_smaller-v.out.err - h5repack_layout3.h5-chunk2chunk-v.out - h5repack_layout3.h5-chunk2chunk-v.out.err - h5repack_layout3.h5-chunk2compa-v.out - h5repack_layout3.h5-chunk2compa-v.out.err - h5repack_layout3.h5-chunk2conti-v.out - h5repack_layout3.h5-chunk2conti-v.out.err - h5repack_layout3.h5-error1-v.out - h5repack_layout3.h5-error1-v.out.err - h5repack_layout3.h5-error2-v.out - h5repack_layout3.h5-error2-v.out.err - h5repack_layout3.h5-error3-v.out - h5repack_layout3.h5-error3-v.out.err out-family.tfamily%05d.h5 out-HDFFV-7840.h5diff_attr1.h5 out-attr.h5repack_attr.h5 @@ -921,15 +861,15 @@ NAME H5REPACK-clearall-objects COMMAND ${CMAKE_COMMAND} -E remove ${LIST_TO_CLEAR} ) - set_tests_properties (H5REPACK-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - if (last_test) - set_tests_properties (H5REPACK-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () + set_tests_properties (H5REPACK-clearall-objects PROPERTIES + FIXTURES_SETUP clear_h5repack + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) endif () ADD_HELP_TEST(help 0 -h) - add_test (NAME H5REPACK-testh5repack_detect_szip COMMAND $<TARGET_FILE:testh5repack_detect_szip>) + add_test (NAME H5REPACK-testh5repack_detect_szip COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:testh5repack_detect_szip>) if (HDF5_ENABLE_SZIP_SUPPORT) if (HDF5_ENABLE_SZIP_ENCODING) set (passRegex "yes") @@ -943,11 +883,11 @@ set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES PASS_REGULAR_EXPRESSION "no") endif () set_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES DEPENDS H5REPACK-clearall-objects) + set (last_test "H5REPACK-testh5repack_detect_szip") - add_test (NAME H5REPACK-h5repacktest COMMAND $<TARGET_FILE:h5repacktest>) - set_tests_properties (H5REPACK-h5repacktest PROPERTIES DEPENDS H5REPACK-testh5repack_detect_szip) - set (last_test "H5REPACK-h5repacktest") - +# add_test (NAME H5REPACK-h5repacktest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repacktest>) +# set_tests_properties (H5REPACK-h5repacktest PROPERTIES DEPENDS H5REPACK-testh5repack_detect_szip) +# set (last_test "H5REPACK-h5repacktest") # # The tests # We use the files generated by h5repacktst @@ -1268,14 +1208,14 @@ # Use first dset to test. #--------------------------------------------------------------------------- # chunk to chunk - specify chunk dim bigger than any current dim - ADD_H5_VERIFY_TEST (chunk2chunk "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk_unlimit1:CHUNK=100x300) + ADD_H5_VERIFY_TEST (chunk2chunk "TEST" 0 ${FILE19} chunk_unlimit1 CHUNK -l chunk_unlimit1:CHUNK=100x300) # chunk to contiguous - ADD_H5_VERIFY_TEST (chunk2conti "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CONTI -l chunk_unlimit1:CONTI) + ADD_H5_VERIFY_TEST (chunk2conti "TEST" 0 ${FILE19} chunk_unlimit1 CONTI -l chunk_unlimit1:CONTI) # chunk to compact - convert big dataset (should be > 64k) for this purpose, # should remain as original layout (chunk) - ADD_H5_VERIFY_TEST (chunk2compa "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 CHUNK -l chunk_unlimit1:COMPA) + ADD_H5_VERIFY_TEST (chunk2compa "TEST" 0 ${FILE19} chunk_unlimit1 CHUNK -l chunk_unlimit1:COMPA) #-------------------------------------------------------------------------- # Test -f for some specific cases. Chunked dataset with unlimited max dims. @@ -1285,16 +1225,16 @@ # - should not change max dims from unlimit # chunk dim is bigger than dataset dim. ( dset size < 64k ) - ADD_H5_VERIFY_TEST (error1 "TEST" 0 h5repack_layout3.h5 chunk_unlimit1 H5S_UNLIMITED -f chunk_unlimit1:NONE) + ADD_H5_VERIFY_TEST (error1 "TEST" 0 ${FILE19} chunk_unlimit1 H5S_UNLIMITED -f chunk_unlimit1:NONE) # chunk dim is bigger than dataset dim. ( dset size > 64k ) - ADD_H5_VERIFY_TEST (error2 "TEST" 0 h5repack_layout3.h5 chunk_unlimit2 H5S_UNLIMITED -f chunk_unlimit2:NONE) + ADD_H5_VERIFY_TEST (error2 "TEST" 0 ${FILE19} chunk_unlimit2 H5S_UNLIMITED -f chunk_unlimit2:NONE) # chunk dims are smaller than dataset dims. ( dset size < 64k ) - ADD_H5_VERIFY_TEST (error3 "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 H5S_UNLIMITED -f chunk_unlimit3:NONE) + ADD_H5_VERIFY_TEST (error3 "TEST" 0 ${FILE19} chunk_unlimit3 H5S_UNLIMITED -f chunk_unlimit3:NONE) # file input - should not fail - ADD_H5_TEST (error4 "TEST" h5repack_layout3.h5 -f NONE) + ADD_H5_TEST (error4 "TEST" ${FILE19} -f NONE) #-------------------------------------------------------------------------- # Test base: Convert CHUNK to CONTI for a chunked dataset with small dataset @@ -1302,9 +1242,9 @@ # (HDFFV-8214) #-------------------------------------------------------------------------- # chunk dim is bigger than dataset dim. should succeed. - ADD_H5_VERIFY_TEST (ckdim_biger "TEST" 0 h5repack_layout3.h5 chunk_unlimit2 CONTI -l chunk_unlimit2:CONTI) + ADD_H5_VERIFY_TEST (ckdim_biger "TEST" 0 ${FILE19} chunk_unlimit2 CONTI -l chunk_unlimit2:CONTI) # chunk dim is smaller than dataset dim. should succeed. - ADD_H5_VERIFY_TEST (ckdim_smaller "TEST" 0 h5repack_layout3.h5 chunk_unlimit3 CONTI -l chunk_unlimit3:CONTI) + ADD_H5_VERIFY_TEST (ckdim_smaller "TEST" 0 ${FILE19} chunk_unlimit3 CONTI -l chunk_unlimit3:CONTI) diff --git a/tools/test/h5repack/CMakeVFDTests.cmake b/tools/test/h5repack/CMakeVFDTests.cmake index e100e3c..c1a280b 100644 --- a/tools/test/h5repack/CMakeVFDTests.cmake +++ b/tools/test/h5repack/CMakeVFDTests.cmake @@ -16,18 +16,19 @@ ############################################################################## ############################################################################## - set (VFD_LIST - sec2 - stdio - core - split - multi - family - ) +set (VFD_LIST + sec2 + stdio + core + core_paged + split + multi + family +) - if (DIRECT_VFD) - set (VFD_LIST ${VFD_LIST} direct) - endif () +if (DIRECT_VFD) + set (VFD_LIST ${VFD_LIST} direct) +endif () ############################################################################## ############################################################################## @@ -35,23 +36,61 @@ ############################################################################## ############################################################################## - macro (ADD_VFD_TEST vfdname resultcode) +macro (ADD_VFD_TEST vfdname resultcode) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + file (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdname}") + add_test ( + NAME H5REPACK-${vfdname}-h5repacktest-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove + bounds_latest_latest.h5 + h5repack_attr.h5 + h5repack_attr_refs.h5 + h5repack_deflate.h5 + h5repack_early.h5 + h5repack_ext.h5 + h5repack_fill.h5 + h5repack_filters.h5 + h5repack_fletcher.h5 + h5repack_hlink.h5 + h5repack_layout.h5 + h5repack_layouto.h5 + h5repack_layout2.h5 + h5repack_layout3.h5 + h5repack_layout.UD.h5 + h5repack_named_dtypes.h5 + h5repack_nested_8bit_enum.h5 + h5repack_nested_8bit_enum_deflated.h5 + h5repack_nbit.h5 + h5repack_objs.h5 + h5repack_refs.h5 + h5repack_shuffle.h5 + h5repack_soffset.h5 + h5repack_szip.h5 + # fsm + h5repack_aggr.h5 + h5repack_fsm_aggr_nopersist.h5 + h5repack_fsm_aggr_persist.h5 + h5repack_none.h5 + h5repack_paged_nopersist.h5 + h5repack_paged_persist.h5 + WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${vfdname} + ) add_test ( - NAME H5REPACK-VFD-${vfdname}-h5repacktest - COMMAND "${CMAKE_COMMAND}" - -D "TEST_PROGRAM=$<TARGET_FILE:h5repacktest>" - -D "TEST_ARGS:STRING=" - -D "TEST_VFD:STRING=${vfdname}" - -D "TEST_EXPECT=${resultcode}" - -D "TEST_OUTPUT=h5repacktest" - -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" + NAME H5REPACK_VFD-${vfdname}-h5repacktest + COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5repacktest>" + -D "TEST_ARGS:STRING=" + -D "TEST_VFD:STRING=${vfdname}" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_OUTPUT=${vfdname}-h5repacktest.out" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" + -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) - if (last_test) - set_tests_properties (H5REPACK-VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "H5REPACK-VFD-${vfdname}-h5repacktest") - endmacro () + set_tests_properties (H5REPACK_VFD-${vfdname}-h5repacktest PROPERTIES DEPENDS H5REPACK_VFD-${vfdname}-h5repacktest-clear-objects) + set_tests_properties (H5REPACK_VFD-${vfdname}-h5repacktest PROPERTIES TIMEOUT ${CTEST_SHORT_TIMEOUT}) + endif () +endmacro () ############################################################################## ############################################################################## @@ -59,7 +98,7 @@ ############################################################################## ############################################################################## - # Run test with different Virtual File Driver - foreach (vfd ${VFD_LIST}) - ADD_VFD_TEST (${vfd} 0) - endforeach () +# Run test with different Virtual File Driver +foreach (vfd ${VFD_LIST}) + ADD_VFD_TEST (${vfd} 0) +endforeach () diff --git a/tools/test/h5repack/h5repack.sh.in b/tools/test/h5repack/h5repack.sh.in index 1232b33..6e63136 100644 --- a/tools/test/h5repack/h5repack.sh.in +++ b/tools/test/h5repack/h5repack.sh.in @@ -1496,7 +1496,12 @@ TOOLTEST add_alignment $arg TOOLTEST upgrade_layout h5repack_layouto.h5 # test for datum size > H5TOOLS_MALLOCSIZE -TOOLTEST gt_mallocsize h5repack_objs.h5 -f GZIP=1 +arg="h5repack_objs.h5 -f GZIP=1" +if test $USE_FILTER_DEFLATE != "yes" ; then + SKIP $arg +else + TOOLTEST gt_mallocsize $arg +fi # Check repacking file with committed datatypes in odd configurations TOOLTEST committed_dt h5repack_named_dtypes.h5 @@ -1567,7 +1572,7 @@ VERIFY_SUPERBLOCK 1 2 2 h5repack_layout.h5 -j 1 -k 2 h5repack_layout.h5 # -j 2 -k 2, superblock will be 3 VERIFY_SUPERBLOCK 2 2 3 h5repack_layout.h5 -j 2 -k 2 h5repack_layout.h5 # -j 0 -k 1, file cannot be opened -VERIFY_INVALIDBOUNDS 0 1 bounds_latest_latest.h5 +VERIFY_INVALIDBOUNDS 0 1 bounds_latest_latest.h5 ######################################## # Testing external storage diff --git a/tools/test/h5repack/h5repacktst.c b/tools/test/h5repack/h5repacktst.c index a89bf10..ec8df3c 100644 --- a/tools/test/h5repack/h5repacktst.c +++ b/tools/test/h5repack/h5repacktst.c @@ -3108,7 +3108,7 @@ int make_early(void) goto out; if ((tid = H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) goto out; - sprintf(name, "%d", i); + HDsprintf(name, "%d", i); if ((H5Tcommit2(fid, name, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if (H5Tclose(tid) < 0) @@ -3133,7 +3133,7 @@ int make_early(void) { if ((tid = H5Tcopy(H5T_NATIVE_DOUBLE)) < 0) goto out; - sprintf(name, "%d", i); + HDsprintf(name, "%d", i); if ((H5Tcommit2(fid, name, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto out; if (H5Tclose(tid) < 0) @@ -3195,7 +3195,7 @@ int make_layout(hid_t loc_id) */ for (i=0; i<4; i++) { - sprintf(name,"dset%d",i+1); + HDsprintf(name,"dset%d",i+1); if (write_dset(loc_id,RANK,dims,name,H5T_NATIVE_INT,buf) < 0) return -1; } @@ -4120,7 +4120,7 @@ int write_dset_in(hid_t loc_id, dbuf = (double*)HDmalloc( size ); if (NULL == dbuf) { - printf ("\nError: Cannot allocate memory for \"arrayd\" data buffer size %dMB.\n", (int) size / 1000000 ); + HDprintf ("\nError: Cannot allocate memory for \"arrayd\" data buffer size %dMB.\n", (int) size / 1000000 ); goto out; } @@ -6182,7 +6182,7 @@ static herr_t add_attr_with_objref(hid_t file_id, hid_t obj_id) status = H5Rcreate(&data_attr_objref[0],file_id,NAME_OBJ_DS1,H5R_OBJECT,(hid_t)-1); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6191,7 +6191,7 @@ static herr_t add_attr_with_objref(hid_t file_id, hid_t obj_id) status = H5Rcreate(&data_attr_objref[1],file_id,NAME_OBJ_GRP,H5R_OBJECT,(hid_t)-1); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6200,7 +6200,7 @@ static herr_t add_attr_with_objref(hid_t file_id, hid_t obj_id) status = H5Rcreate(&data_attr_objref[2],file_id,NAME_OBJ_NDTYPE,H5R_OBJECT,(hid_t)-1); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6209,7 +6209,7 @@ static herr_t add_attr_with_objref(hid_t file_id, hid_t obj_id) status = make_attr(obj_id,1,dim_attr_objref,"Attr_OBJREF",H5T_STD_REF_OBJ,data_attr_objref); if (status < 0) { - fprintf(stderr, "Error: %s %d> make_attr failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> make_attr failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6251,7 +6251,7 @@ static herr_t add_attr_with_regref(hid_t file_id, hid_t obj_id) sid_regrefed_dset = H5Screate_simple (2, dim_regrefed_dset, NULL); if (sid_regrefed_dset < 0) { - fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6260,7 +6260,7 @@ static herr_t add_attr_with_regref(hid_t file_id, hid_t obj_id) status = H5Sselect_elements (sid_regrefed_dset, H5S_SELECT_SET, (size_t)3, coords_regrefed_dset[0]); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6269,7 +6269,7 @@ static herr_t add_attr_with_regref(hid_t file_id, hid_t obj_id) status = H5Rcreate (&data_attr_regref[0], file_id, NAME_OBJ_DS2, H5R_DATASET_REGION, sid_regrefed_dset); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6278,7 +6278,7 @@ static herr_t add_attr_with_regref(hid_t file_id, hid_t obj_id) status = make_attr(obj_id,1,dim_attr_regref,"Attr_REGREF",H5T_STD_REF_DSETREG,data_attr_regref); if (status < 0) { - fprintf(stderr, "Error: %s %d> make_attr failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> make_attr failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6324,7 +6324,7 @@ static herr_t gen_refered_objs(hid_t loc_id) sid = H5Screate_simple(1, dims1, NULL); if (sid < 0) { - fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6332,7 +6332,7 @@ static herr_t gen_refered_objs(hid_t loc_id) did1 = H5Dcreate2 (loc_id, NAME_OBJ_DS1, H5T_NATIVE_INT, sid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (did1 < 0) { - fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6340,7 +6340,7 @@ static herr_t gen_refered_objs(hid_t loc_id) status = H5Dwrite(did1, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, data); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6352,7 +6352,7 @@ static herr_t gen_refered_objs(hid_t loc_id) gid = H5Gcreate2 (loc_id, NAME_OBJ_GRP, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (gid < 0) { - fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6365,7 +6365,7 @@ static herr_t gen_refered_objs(hid_t loc_id) status = H5Tcommit2(loc_id, NAME_OBJ_NDTYPE, tid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6378,7 +6378,7 @@ static herr_t gen_refered_objs(hid_t loc_id) sid2 = H5Screate_simple (2, dims2, NULL); if (sid2 < 0) { - fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6387,7 +6387,7 @@ static herr_t gen_refered_objs(hid_t loc_id) did2 = H5Dcreate2 (loc_id, NAME_OBJ_DS2, H5T_STD_I8LE, sid2, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT); if (did2 < 0) { - fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6396,7 +6396,7 @@ static herr_t gen_refered_objs(hid_t loc_id) status = H5Dwrite (did2, H5T_NATIVE_CHAR, H5S_ALL, H5S_ALL, H5P_DEFAULT, data2); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6453,7 +6453,7 @@ static herr_t gen_obj_ref(hid_t loc_id) status = H5Rcreate (&objref_buf[0], loc_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6462,7 +6462,7 @@ static herr_t gen_obj_ref(hid_t loc_id) status = H5Rcreate (&objref_buf[1], loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6471,7 +6471,7 @@ static herr_t gen_obj_ref(hid_t loc_id) status = H5Rcreate (&objref_buf[2], loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6482,7 +6482,7 @@ static herr_t gen_obj_ref(hid_t loc_id) sid = H5Screate_simple (1, dims_dset_objref, NULL); if (sid < 0) { - fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6490,7 +6490,7 @@ static herr_t gen_obj_ref(hid_t loc_id) oid = H5Dcreate2 (loc_id, "Dset_OBJREF", H5T_STD_REF_OBJ, sid, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT); if (oid < 0) { - fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6498,7 +6498,7 @@ static herr_t gen_obj_ref(hid_t loc_id) status = H5Dwrite(oid, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, objref_buf); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6511,7 +6511,7 @@ static herr_t gen_obj_ref(hid_t loc_id) status = add_attr_with_objref(loc_id, oid); if (status < 0) { - fprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6520,7 +6520,7 @@ static herr_t gen_obj_ref(hid_t loc_id) status = add_attr_with_regref(loc_id, oid); if (status < 0) { - fprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6573,7 +6573,7 @@ static herr_t gen_region_ref(hid_t loc_id) sid_trg = H5Screate_simple (2, dims_trg, NULL); if (sid_trg < 0) { - fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6582,7 +6582,7 @@ static herr_t gen_region_ref(hid_t loc_id) status = H5Sselect_elements (sid_trg, H5S_SELECT_SET, (size_t)4, coords[0]); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6591,7 +6591,7 @@ static herr_t gen_region_ref(hid_t loc_id) status = H5Rcreate (&rr_data[0], loc_id, NAME_OBJ_DS2, H5R_DATASET_REGION, sid_trg); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6600,7 +6600,7 @@ static herr_t gen_region_ref(hid_t loc_id) status = H5Sselect_hyperslab (sid_trg, H5S_SELECT_SET, start, stride, count, block); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Sselect_hyperslab failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6609,7 +6609,7 @@ static herr_t gen_region_ref(hid_t loc_id) status = H5Rcreate (&rr_data[1], loc_id, NAME_OBJ_DS2, H5R_DATASET_REGION, sid_trg); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6618,7 +6618,7 @@ static herr_t gen_region_ref(hid_t loc_id) sid_ref = H5Screate_simple (1, dims1, NULL); if (sid_ref < 0) { - fprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Screate_simple failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6627,7 +6627,7 @@ static herr_t gen_region_ref(hid_t loc_id) oid_ref = H5Dcreate2 (loc_id, REG_REF_DS1, H5T_STD_REF_DSETREG, sid_ref, H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT); if (oid_ref < 0) { - fprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dcreate2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6636,7 +6636,7 @@ static herr_t gen_region_ref(hid_t loc_id) status = H5Dwrite (oid_ref, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, rr_data); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6649,7 +6649,7 @@ static herr_t gen_region_ref(hid_t loc_id) status = add_attr_with_objref(loc_id, oid_ref); if (status < 0) { - fprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> add_attr_with_objref failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6658,7 +6658,7 @@ static herr_t gen_region_ref(hid_t loc_id) status = add_attr_with_regref(loc_id, oid_ref); if (status < 0) { - fprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> add_attr_with_regref failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6691,7 +6691,7 @@ static herr_t make_references(hid_t loc_id) status = gen_refered_objs(loc_id); if (status == FAIL) { - fprintf(stderr, "Failed to generate referenced object.\n"); + HDfprintf(stderr, "Failed to generate referenced object.\n"); ret = FAIL; } @@ -6699,7 +6699,7 @@ static herr_t make_references(hid_t loc_id) status = gen_obj_ref(loc_id); if (status == FAIL) { - fprintf(stderr, "Failed to generate object reference.\n"); + HDfprintf(stderr, "Failed to generate object reference.\n"); ret = FAIL; } @@ -6707,7 +6707,7 @@ static herr_t make_references(hid_t loc_id) status = gen_region_ref(loc_id); if (status == FAIL) { - fprintf(stderr, "Failed to generate region reference.\n"); + HDfprintf(stderr, "Failed to generate region reference.\n"); ret = FAIL; } @@ -6831,7 +6831,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) status = H5Dwrite(objdid, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obj_data[0]); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6841,7 +6841,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) status = H5Tcommit2(loc_id, NAME_OBJ_NDTYPE, objtid, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Tcommit2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6854,7 +6854,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) main_gid = H5Gcreate2(loc_id, "group_main", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); if (main_gid < 0) { - fprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Gcreate2 failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6869,7 +6869,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) status = H5Dwrite(main_did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, obj_data[0]); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dwrite failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6893,7 +6893,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) status = H5Rcreate (&(comp_objref_data[0].val_objref), loc_id, NAME_OBJ_DS1, H5R_OBJECT,(hid_t)-1); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6903,7 +6903,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) status = H5Rcreate (&(comp_objref_data[1].val_objref), loc_id, NAME_OBJ_GRP, H5R_OBJECT,(hid_t)-1); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6913,7 +6913,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) status = H5Rcreate (&(comp_objref_data[2].val_objref), loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT,(hid_t)-1); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6927,7 +6927,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) status = H5Awrite (comp_objref_aid, comp_objref_tid, comp_objref_data); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6949,14 +6949,14 @@ static herr_t make_complex_attr_references(hid_t loc_id) status = H5Sselect_elements (objsid, H5S_SELECT_SET, (size_t)4, coords[0]); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } status = H5Rcreate (&(comp_regref_data[0].val_regref), loc_id, NAME_OBJ_DS1, H5R_DATASET_REGION, objsid); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6970,7 +6970,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) status = H5Awrite (comp_regref_aid, comp_regref_tid, comp_regref_data); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -6996,7 +6996,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[0].p)[0], loc_id, NAME_OBJ_DS1, H5R_OBJECT, (hid_t)-1); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -7004,7 +7004,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[1].p)[0], loc_id, NAME_OBJ_GRP, H5R_OBJECT, (hid_t)-1); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -7012,7 +7012,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) status = H5Rcreate (&((hobj_ref_t*)vlen_objref_data[2].p)[0], loc_id, NAME_OBJ_NDTYPE, H5R_OBJECT, (hid_t)-1); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -7030,7 +7030,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) status = H5Awrite (vlen_objref_attr_id, vlen_objref_attr_tid, vlen_objref_data); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -7039,7 +7039,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) status = H5Dvlen_reclaim (vlen_objref_attr_tid, vlen_objref_attr_sid, H5P_DEFAULT, vlen_objref_data); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Dvlen_reclaim failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dvlen_reclaim failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -7060,14 +7060,14 @@ static herr_t make_complex_attr_references(hid_t loc_id) status = H5Sselect_elements(objsid, H5S_SELECT_SET, (size_t)4, coords[0]); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Sselect_elements failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } status = H5Rcreate (&((hdset_reg_ref_t*)vlen_regref_data[0].p)[0], loc_id, NAME_OBJ_DS1, H5R_DATASET_REGION, objsid); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Rcreate failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -7085,7 +7085,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) status = H5Awrite(vlen_regref_attr_id, vlen_regref_attr_tid, vlen_regref_data); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Awrite failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } @@ -7094,7 +7094,7 @@ static herr_t make_complex_attr_references(hid_t loc_id) status = H5Dvlen_reclaim (vlen_regref_attr_tid, vlen_regref_attr_sid, H5P_DEFAULT, vlen_regref_data); if (status < 0) { - fprintf(stderr, "Error: %s %d> H5Dvlen_reclaim failed.\n", FUNC, __LINE__); + HDfprintf(stderr, "Error: %s %d> H5Dvlen_reclaim failed.\n", FUNC, __LINE__); ret = FAIL; goto out; } diff --git a/tools/test/h5repack/testfiles/h5repack-help.txt b/tools/test/h5repack/testfiles/h5repack-help.txt index 03553dd..e55eed9 100644 --- a/tools/test/h5repack/testfiles/h5repack-help.txt +++ b/tools/test/h5repack/testfiles/h5repack-help.txt @@ -60,7 +60,8 @@ usage: h5repack [OPTIONS] file1 file2 0: This is H5F_LIBVER_EARLIEST in H5F_libver_t struct 1: This is H5F_LIBVER_V18 in H5F_libver_t struct 2: This is H5F_LIBVER_V110 in H5F_libver_t struct - (H5F_LIBVER_LATEST is aliased to H5F_LIBVER_V110 for this release + 3: This is H5F_LIBVER_V112 in H5F_libver_t struct + (H5F_LIBVER_LATEST is aliased to H5F_LIBVER_V112 for this release FS_STRATEGY is a string indicating the file space strategy used: FSM_AGGR: diff --git a/tools/test/h5repack/testh5repack_detect_szip.c b/tools/test/h5repack/testh5repack_detect_szip.c index 6e7a24e..6b86dd5 100644 --- a/tools/test/h5repack/testh5repack_detect_szip.c +++ b/tools/test/h5repack/testh5repack_detect_szip.c @@ -50,10 +50,10 @@ int main(void) #ifdef H5_HAVE_FILTER_SZIP if (h5tools_can_encode(H5Z_FILTER_SZIP) == 1) { - printf("yes\n"); + HDprintf("yes\n"); return(1); } #endif /* H5_HAVE_FILTER_SZIP */ - printf("no\n"); + HDprintf("no\n"); return(0); } diff --git a/tools/test/h5stat/CMakeLists.txt b/tools/test/h5stat/CMakeLists.txt index f3bd20b..5c17fd5 100644 --- a/tools/test/h5stat/CMakeLists.txt +++ b/tools/test/h5stat/CMakeLists.txt @@ -11,7 +11,7 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) target_link_libraries (h5stat_gentest PRIVATE ${HDF5_LIB_TARGET}) set_target_properties (h5stat_gentest PROPERTIES FOLDER generator/tools) - #add_test (NAME h5stat_gentest COMMAND $<TARGET_FILE:h5stat_gentest>) + #add_test (NAME h5stat_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat_gentest>) endif () include (CMakeTests.cmake) diff --git a/tools/test/h5stat/CMakeTests.cmake b/tools/test/h5stat/CMakeTests.cmake index 63886d0..9674a77 100644 --- a/tools/test/h5stat/CMakeTests.cmake +++ b/tools/test/h5stat/CMakeTests.cmake @@ -102,27 +102,15 @@ macro (ADD_H5_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5STAT-${resultfile} COMMAND $<TARGET_FILE:h5stat${tgt_ext}> ${ARGN}) + add_test (NAME H5STAT-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat${tgt_ext}> ${ARGN}) if (${resultcode}) set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true") endif () - if (last_test) - set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5STAT-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.out - ${resultfile}.out.err - ) - if (last_test) - set_tests_properties (H5STAT-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () - add_test ( NAME H5STAT-${resultfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -131,34 +119,21 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS H5STAT-${resultfile}-clear-objects) endif () endmacro () macro (ADD_H5_ERR_TEST resultfile resultcode) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5STAT-${resultfile} COMMAND $<TARGET_FILE:h5stat${tgt_ext}> ${ARGN}) + add_test (NAME H5STAT-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5stat${tgt_ext}> ${ARGN}) if (${resultcode}) set_tests_properties (H5STAT-${resultfile} PROPERTIES WILL_FAIL "true") endif () - if (last_test) - set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5STAT-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.out - ${resultfile}.out.err - ) - if (last_test) - set_tests_properties (H5STAT-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () - add_test ( NAME H5STAT-${resultfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5stat${tgt_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" @@ -168,7 +143,6 @@ -D "TEST_ERRREF=${resultfile}.err" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5STAT-${resultfile} PROPERTIES DEPENDS H5STAT-${resultfile}-clear-objects) endif () endmacro () @@ -185,13 +159,8 @@ endforeach () add_test ( NAME H5STAT-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove ${CLEAR_LIST} + COMMAND ${CMAKE_COMMAND} -E remove ${CLEAR_LIST} ) - if (last_test) - set_tests_properties (H5STAT-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "H5STAT-clearall-objects") endif () # Test for help flag diff --git a/tools/test/h5stat/h5stat_gentest.c b/tools/test/h5stat/h5stat_gentest.c index ae11032..2edfcf6 100644 --- a/tools/test/h5stat/h5stat_gentest.c +++ b/tools/test/h5stat/h5stat_gentest.c @@ -88,7 +88,7 @@ gen_newgrat_file(const char *fname) /* Create NUM_GRPS groups in the root group */ for(i = 1; i <= NUM_GRPS; i++) { - sprintf(name, "%s%d", GROUP_NAME,i); + HDsprintf(name, "%s%d", GROUP_NAME,i); if((gid = H5Gcreate2(fid, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; if(H5Gclose(gid) < 0) @@ -109,7 +109,7 @@ gen_newgrat_file(const char *fname) /* Create NUM_ATTRS for the dataset */ for(i = 1; i <= NUM_ATTRS; i++) { - sprintf(attrname, "%s%d", ATTR_NAME,i); + HDsprintf(attrname, "%s%d", ATTR_NAME,i); if((attr_id = H5Acreate2(did, attrname, tid, sid, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; if(H5Aclose(attr_id) < 0) @@ -190,7 +190,7 @@ gen_threshold_file(const char *fname) /* Create 11 attributes for the dataset */ for(i = 1; i <= (THRES_NUM+1); i++) { - sprintf(name, "%s%d", THRES_ATTR_NAME,i); + HDsprintf(name, "%s%d", THRES_ATTR_NAME,i); if((attr_id = H5Acreate2(did, name, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; if(H5Aclose(attr_id) < 0) @@ -217,7 +217,7 @@ gen_threshold_file(const char *fname) /* Create 10 attributes for the 2-D dataset */ for(i = 1; i <= THRES_NUM; i++) { - sprintf(name, "%s%d", THRES_ATTR_NAME,i); + HDsprintf(name, "%s%d", THRES_ATTR_NAME,i); if((attr_id = H5Acreate2(did, name, H5T_NATIVE_INT, sid1, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; if(H5Aclose(attr_id) < 0) @@ -241,7 +241,7 @@ gen_threshold_file(const char *fname) /* Create 10 1-D datasets with non-zero dimension size for the group */ for(i = 1; i <= THRES_NUM; i++) { /* set up dataset name */ - sprintf(name, "%s%d", THRES_DSET_NAME,i); + HDsprintf(name, "%s%d", THRES_DSET_NAME,i); /* Create the dataset */ if((did = H5Dcreate2(gid, name, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -264,7 +264,7 @@ gen_threshold_file(const char *fname) /* Create 25 attributes for the group */ for(i = 1; i <= THRES_NUM_25; i++) { /* Set up attribute name */ - sprintf(name, "%s%d", THRES_ATTR_GRP_NAME,i); + HDsprintf(name, "%s%d", THRES_ATTR_GRP_NAME,i); /* Create the attribute */ if((attr_id = H5Acreate2(gid, name, H5T_NATIVE_INT, sid2, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -286,7 +286,7 @@ gen_threshold_file(const char *fname) /* Create 9 1-D datasets with non-zero dimension size for the group */ for(i = 1; i < THRES_NUM; i++) { /* set up dataset name */ - sprintf(name, "%s%d", THRES_DSET_NAME,i); + HDsprintf(name, "%s%d", THRES_DSET_NAME,i); /* Create the dataset */ if((did = H5Dcreate2(gid, name, H5T_NATIVE_UCHAR, sid1, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) diff --git a/tools/test/h5stat/testfiles/h5stat_help1.ddl b/tools/test/h5stat/testfiles/h5stat_help1.ddl index 01e39af..2ba7772 100644 --- a/tools/test/h5stat/testfiles/h5stat_help1.ddl +++ b/tools/test/h5stat/testfiles/h5stat_help1.ddl @@ -23,3 +23,13 @@ Usage: h5stat [OPTIONS] file -s, --freespace Print free space information -S, --summary Print summary of file space information --enable-error-stack Prints messages from the HDF5 error stack as they occur + --s3-cred=<cred> Access file on S3, using provided credential + <cred> :: (region,id,key) + If <cred> == "(,,)", no authentication is used. + --hdfs-attrs=<attrs> Access a file on HDFS with given configuration + attributes. + <attrs> :: (<namenode name>,<namenode port>, + <kerberos cache path>,<username>, + <buffer size>) + If an attribute is empty, a default value will be + used. diff --git a/tools/test/h5stat/testfiles/h5stat_help2.ddl b/tools/test/h5stat/testfiles/h5stat_help2.ddl index 01e39af..2ba7772 100644 --- a/tools/test/h5stat/testfiles/h5stat_help2.ddl +++ b/tools/test/h5stat/testfiles/h5stat_help2.ddl @@ -23,3 +23,13 @@ Usage: h5stat [OPTIONS] file -s, --freespace Print free space information -S, --summary Print summary of file space information --enable-error-stack Prints messages from the HDF5 error stack as they occur + --s3-cred=<cred> Access file on S3, using provided credential + <cred> :: (region,id,key) + If <cred> == "(,,)", no authentication is used. + --hdfs-attrs=<attrs> Access a file on HDFS with given configuration + attributes. + <attrs> :: (<namenode name>,<namenode port>, + <kerberos cache path>,<username>, + <buffer size>) + If an attribute is empty, a default value will be + used. diff --git a/tools/test/h5stat/testfiles/h5stat_nofile.ddl b/tools/test/h5stat/testfiles/h5stat_nofile.ddl index 01e39af..2ba7772 100644 --- a/tools/test/h5stat/testfiles/h5stat_nofile.ddl +++ b/tools/test/h5stat/testfiles/h5stat_nofile.ddl @@ -23,3 +23,13 @@ Usage: h5stat [OPTIONS] file -s, --freespace Print free space information -S, --summary Print summary of file space information --enable-error-stack Prints messages from the HDF5 error stack as they occur + --s3-cred=<cred> Access file on S3, using provided credential + <cred> :: (region,id,key) + If <cred> == "(,,)", no authentication is used. + --hdfs-attrs=<attrs> Access a file on HDFS with given configuration + attributes. + <attrs> :: (<namenode name>,<namenode port>, + <kerberos cache path>,<username>, + <buffer size>) + If an attribute is empty, a default value will be + used. diff --git a/tools/test/misc/CMakeLists.txt b/tools/test/misc/CMakeLists.txt index f5e3ea3..a250222 100644 --- a/tools/test/misc/CMakeLists.txt +++ b/tools/test/misc/CMakeLists.txt @@ -15,7 +15,7 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) target_link_libraries (h5repart_gentest PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET}) endif () set_target_properties (h5repart_gentest PROPERTIES FOLDER generator/tools) - #add_test (NAME h5repart_gentest COMMAND $<TARGET_FILE:h5repart_gentest>) + #add_test (NAME h5repart_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart_gentest>) add_executable (h5clear_gentest ${HDF5_TOOLS_TEST_MISC_SOURCE_DIR}/h5clear_gentest.c) target_include_directories (h5clear_gentest PRIVATE "${HDF5_SRC_DIR};${HDF5_BINARY_DIR};$<$<BOOL:${HDF5_ENABLE_PARALLEL}>:${MPI_C_INCLUDE_DIRS}>") @@ -27,7 +27,7 @@ if (HDF5_BUILD_GENERATORS AND NOT ONLY_SHARED_LIBS) target_link_libraries (h5clear_gentest PRIVATE ${HDF5_TOOLS_LIBSH_TARGET} ${HDF5_TEST_LIBSH_TARGET}) endif () set_target_properties (h5clear_gentest PROPERTIES FOLDER tools) - #add_test (NAME H5CLEAR-h5clear_gentest COMMAND $<TARGET_FILE:h5clear_gentest>) + #add_test (NAME H5CLEAR-h5clear_gentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear_gentest>) add_subdirectory (vds) diff --git a/tools/test/misc/CMakeTestsClear.cmake b/tools/test/misc/CMakeTestsClear.cmake index c7b2fe9..a2c494d 100644 --- a/tools/test/misc/CMakeTestsClear.cmake +++ b/tools/test/misc/CMakeTestsClear.cmake @@ -94,18 +94,9 @@ macro (ADD_H5_CMP testname resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5CLEAR_CMP-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/${testname}.out - testfiles/${testname}.out.err - ) - if (last_test) - set_tests_properties (H5CLEAR_CMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () - add_test ( NAME H5CLEAR_CMP-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -114,26 +105,15 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5CLEAR_CMP-${testname} PROPERTIES DEPENDS H5CLEAR_CMP-${testname}-clear-objects) - set (last_test "H5CLEAR_CMP-${testname}") endif () endmacro () macro (ADD_H5_ERR_CMP testname resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5CLEAR_CMP-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/${testname}.out - testfiles/${testname}.out.err - ) - if (last_test) - set_tests_properties (H5CLEAR_CMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () - add_test ( NAME H5CLEAR_CMP-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -143,8 +123,6 @@ -D "TEST_ERRREF=${resultfile}.err" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5CLEAR_CMP-${testname} PROPERTIES DEPENDS H5CLEAR_CMP-${testname}-clear-objects) - set (last_test "H5CLEAR_CMP-${testname}") endif () endmacro () @@ -152,25 +130,20 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5CLEAR_CMP-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/${testname}.out - testfiles/${testname}.out.err - testfiles/${testfile} - ) - if (last_test) - set_tests_properties (H5CLEAR_CMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () + COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testfile} + ) add_test ( NAME H5CLEAR_CMP-copy_${testname} - COMMAND ${CMAKE_COMMAND} - -E copy_if_different + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${PROJECT_SOURCE_DIR}/testfiles/${testfile}" "${PROJECT_BINARY_DIR}/testfiles/${testfile}" ) - set_tests_properties (H5CLEAR_CMP-copy_${testname} PROPERTIES DEPENDS H5CLEAR_CMP-${testname}-clear-objects) + set_tests_properties (H5CLEAR_CMP-copy_${testname} PROPERTIES + DEPENDS H5CLEAR_CMP-${testname}-clear-objects + ) add_test ( NAME H5CLEAR_CMP-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" -D "TEST_ARGS:STRING=${ARGN};${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -179,8 +152,9 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5CLEAR_CMP-${testname} PROPERTIES DEPENDS H5CLEAR_CMP-copy_${testname}) - set (last_test "H5CLEAR_CMP-${testname}") + set_tests_properties (H5CLEAR_CMP-${testname} PROPERTIES + DEPENDS H5CLEAR_CMP-copy_${testname} + ) endif () endmacro () @@ -188,25 +162,20 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5CLEAR_CMP-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/${testname}.out - testfiles/${testname}.out.err - testfiles/${testfile} - ) - if (last_test) - set_tests_properties (H5CLEAR_CMP-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () + COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testfile} + ) add_test ( NAME H5CLEAR_CMP-copy_${testname} - COMMAND ${CMAKE_COMMAND} - -E copy_if_different + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${PROJECT_SOURCE_DIR}/testfiles/${testfile}" "${PROJECT_BINARY_DIR}/testfiles/${testfile}" ) - set_tests_properties (H5CLEAR_CMP-copy_${testname} PROPERTIES DEPENDS H5CLEAR_CMP-${testname}-clear-objects) + set_tests_properties (H5CLEAR_CMP-copy_${testname} PROPERTIES + DEPENDS H5CLEAR_CMP-${testname}-clear-objects + ) add_test ( NAME H5CLEAR_CMP-${testname} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" -D "TEST_ARGS:STRING=${ARGN};${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -216,8 +185,9 @@ -D "TEST_ERRREF=${resultfile}.err" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5CLEAR_CMP-${testname} PROPERTIES DEPENDS H5CLEAR_CMP-copy_${testname}) - set (last_test "H5CLEAR_CMP-${testname}") + set_tests_properties (H5CLEAR_CMP-${testname} PROPERTIES + DEPENDS H5CLEAR_CMP-copy_${testname} + ) endif () endmacro () @@ -225,14 +195,12 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5CLEAR_RET-${testname} - COMMAND $<TARGET_FILE:h5clear${tgt_ext}> ${ARGN} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> ${ARGN} + ) + set_tests_properties (H5CLEAR_RET-${testname} PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + WILL_FAIL "${resultcode}" ) - set_tests_properties (H5CLEAR_RET-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - set_tests_properties (H5CLEAR_RET-${testname} PROPERTIES WILL_FAIL "${resultcode}") - if (last_test) - set_tests_properties (H5CLEAR_RET-${testname} PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "H5CLEAR_RET-${testname}") endif () endmacro () @@ -240,27 +208,20 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5CLEAR_FILESIZE_TEST-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - testfiles/${testname}_before_size.out - testfiles/${testname}_before_size.out.err - testfiles/${testname}_after_size.out - testfiles/${testname}_after_size.out.err - testfiles/${testname}.h5 - ) - if (last_test) - set_tests_properties (H5CLEAR_FILESIZE_TEST-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () + COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testname}.h5 + ) add_test ( NAME H5CLEAR_FILESIZE_TEST-copy_${testname} - COMMAND ${CMAKE_COMMAND} - -E copy_if_different + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${PROJECT_SOURCE_DIR}/testfiles/${testname}.h5" "${PROJECT_BINARY_DIR}/testfiles/${testname}.h5" ) - set_tests_properties (H5CLEAR_FILESIZE_TEST-copy_${testname} PROPERTIES DEPENDS H5CLEAR_FILESIZE_TEST-${testname}-clear-objects) + set_tests_properties (H5CLEAR_FILESIZE_TEST-copy_${testname} PROPERTIES + DEPENDS H5CLEAR_FILESIZE_TEST-${testname}-clear-objects + ) add_test ( NAME H5CLEAR_FILESIZE_CMP-${testname}_before_size COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" -D "TEST_ARGS:STRING=--filesize;${testname}.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -269,34 +230,102 @@ -D "TEST_REFERENCE=${resultfile}_before_size.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5CLEAR_FILESIZE_CMP-${testname}_before_size PROPERTIES DEPENDS H5CLEAR_FILESIZE_TEST-copy_${testname}) + set_tests_properties (H5CLEAR_FILESIZE_CMP-${testname}_before_size PROPERTIES + DEPENDS H5CLEAR_FILESIZE_TEST-copy_${testname} + ) if (NOT ${incr_size} MATCHES "NONE") add_test ( NAME H5CLEAR_FILESIZE_INCR-${testname} - COMMAND $<TARGET_FILE:h5clear${tgt_ext}> --increment=${incr_size} ${testname}.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> --increment=${incr_size} ${testname}.h5 ) else () add_test ( NAME H5CLEAR_FILESIZE_INCR-${testname} - COMMAND $<TARGET_FILE:h5clear${tgt_ext}> --increment ${testname}.h5 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> --increment ${testname}.h5 ) endif () - set_tests_properties (H5CLEAR_FILESIZE_INCR-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - set_tests_properties (H5CLEAR_FILESIZE_INCR-${testname} PROPERTIES WILL_FAIL "${resultcode}") - set_tests_properties (H5CLEAR_FILESIZE_INCR-${testname} PROPERTIES DEPENDS H5CLEAR_FILESIZE_CMP-${testname}_before_size) + set_tests_properties (H5CLEAR_FILESIZE_INCR-${testname} PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + WILL_FAIL "${resultcode}" + DEPENDS H5CLEAR_FILESIZE_CMP-${testname}_before_size + ) add_test ( NAME H5CLEAR_FILESIZE_CMP-${testname}_after_size COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" -D "TEST_ARGS:STRING=--filesize;${testname}.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" -D "TEST_OUTPUT=${testname}_after_size.out" + -D "TEST_EXPECT=0" + -D "TEST_REFERENCE=${resultfile}_after_size.ddl" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5CLEAR_FILESIZE_CMP-${testname}_after_size PROPERTIES + DEPENDS H5CLEAR_FILESIZE_INCR-${testname} + ) + endif () + endmacro () + + macro (ADD_H5_FILESIZE_FAIL_TEST testname resultcode resultfile incr_size) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5CLEAR_FILESIZE_FAIL_TEST-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testname}.h5 + ) + add_test ( + NAME H5CLEAR_FILESIZE_FAIL_TEST-copy_${testname} + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${PROJECT_SOURCE_DIR}/testfiles/${testname}.h5" "${PROJECT_BINARY_DIR}/testfiles/${testname}.h5" + ) + set_tests_properties (H5CLEAR_FILESIZE_FAIL_TEST-copy_${testname} PROPERTIES + DEPENDS H5CLEAR_FILESIZE_FAIL_TEST-${testname}-clear-objects + ) + add_test ( + NAME H5CLEAR_FILESIZE_FAIL_CMP-${testname}_before_size + COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" + -D "TEST_ARGS:STRING=--filesize;${testname}.h5" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testname}_before_size.out" -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${resultfile}.mty" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5CLEAR_FILESIZE_FAIL_CMP-${testname}_before_size PROPERTIES + DEPENDS H5CLEAR_FILESIZE_FAIL_TEST-copy_${testname} + ) + if (NOT ${incr_size} MATCHES "NONE") + add_test ( + NAME H5CLEAR_FILESIZE_FAIL_INCR-${testname} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> -s --increment=${incr_size} ${testname}.h5 + ) + else () + add_test ( + NAME H5CLEAR_FILESIZE_FAIL_INCR-${testname} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> -s --increment ${testname}.h5 + ) + endif () + set_tests_properties (H5CLEAR_FILESIZE_FAIL_INCR-${testname} PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + DEPENDS H5CLEAR_FILESIZE_FAIL_CMP-${testname}_before_size + ) + add_test ( + NAME H5CLEAR_FILESIZE_FAIL_CMP-${testname}_after_size + COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5clear${tgt_ext}>" + -D "TEST_ARGS:STRING=--filesize;${testname}.h5" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" + -D "TEST_OUTPUT=${testname}_after_size.out" + -D "TEST_EXPECT=0" -D "TEST_REFERENCE=${resultfile}_after_size.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5CLEAR_FILESIZE_CMP-${testname}_after_size PROPERTIES DEPENDS H5CLEAR_FILESIZE_INCR-${testname}) - set (last_test "H5CLEAR_FILESIZE_CMP-${testname}_after_size") + set_tests_properties (H5CLEAR_FILESIZE_FAIL_CMP-${testname}_after_size PROPERTIES + DEPENDS H5CLEAR_FILESIZE_FAIL_INCR-${testname} + ) endif () endmacro () @@ -304,32 +333,39 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5CLEAR-clr_open_chk-copy_${testname}.h5 - COMMAND ${CMAKE_COMMAND} - -E copy_if_different + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${PROJECT_SOURCE_DIR}/testfiles/${testfile}.h5" "${PROJECT_BINARY_DIR}/testfiles/${testfile}.h5" ) - if (last_test) - set_tests_properties (H5CLEAR-clr_open_chk-copy_${testname}.h5 PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "H5CLEAR-clr_open_chk-copy_${testname}.h5") # Initial file open fails OR # File open succeeds because the library does not check status_flags for file with < v3 superblock - add_test (NAME H5CLEAR-clr_open_chk-${testname}_${resultcode} COMMAND $<TARGET_FILE:clear_open_chk> ${testfile}.h5) - set_tests_properties (H5CLEAR-clr_open_chk-${testname}_${resultcode} PROPERTIES WILL_FAIL "${resultcode}") - set_tests_properties (H5CLEAR-clr_open_chk-${testname}_${resultcode} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - if (last_test) - set_tests_properties (H5CLEAR-clr_open_chk-${testname}_${resultcode} PROPERTIES DEPENDS ${last_test}) - endif () + add_test ( + NAME H5CLEAR-clr_open_chk-${testname}_${resultcode} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:clear_open_chk> ${testfile}.h5 + ) + set_tests_properties (H5CLEAR-clr_open_chk-${testname}_${resultcode} PROPERTIES + WILL_FAIL "${resultcode}" + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + DEPENDS H5CLEAR-clr_open_chk-copy_${testname}.h5 + ) # After "h5clear" the file, the subsequent file open succeeds - add_test (NAME H5CLEAR-h5clr-${testname} COMMAND $<TARGET_FILE:h5clear${tgt_ext}> -s ${testfile}.h5) - set_tests_properties (H5CLEAR-h5clr-${testname} PROPERTIES DEPENDS H5CLEAR-clr_open_chk-${testname}_${resultcode}) - set_tests_properties (H5CLEAR-h5clr-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - add_test (NAME H5CLEAR-clr_open_chk-${testname} COMMAND $<TARGET_FILE:clear_open_chk> ${testfile}.h5) - set_tests_properties (H5CLEAR-clr_open_chk-${testname} PROPERTIES DEPENDS H5CLEAR-h5clr-${testname}) - set_tests_properties (H5CLEAR-clr_open_chk-${testname} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - set (last_test "H5CLEAR-clr_open_chk-${testname}") + add_test ( + NAME H5CLEAR-h5clr-${testname} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5clear${tgt_ext}> -s ${testfile}.h5 + ) + set_tests_properties (H5CLEAR-h5clr-${testname} PROPERTIES + DEPENDS H5CLEAR-clr_open_chk-${testname}_${resultcode} + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) + add_test ( + NAME H5CLEAR-clr_open_chk-${testname} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:clear_open_chk> ${testfile}.h5 + ) + set_tests_properties (H5CLEAR-clr_open_chk-${testname} PROPERTIES + DEPENDS H5CLEAR-h5clr-${testname} + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) endif () endmacro () @@ -341,73 +377,6 @@ # # # -# The following are tests to verify the status_flags field is cleared properly: -if (HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - add_test ( - NAME H5CLEAR-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - h5clear_log_v3.h5 - h5clear_mdc_image.h5 - h5clear_sec2_v0.h5 - h5clear_sec2_v2.h5 - h5clear_sec2_v3.h5 - orig_h5clear_sec2_v0.h5 - orig_h5clear_sec2_v2.h5 - orig_h5clear_sec2_v3.h5 - latest_h5clear_log_v3.h5 - latest_h5clear_sec2_v3.h5 - mod_h5clear_mdc_image.h5 - mod_h5clear_mdc_image2.h5 - ${HDF5_TEST_FILES} - ) - if (last_test) - set_tests_properties (H5CLEAR-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "H5CLEAR-clearall-objects") - - foreach (h5_file ${HDF5_TEST_FILES} ${HDF5_SEC2_TEST_FILES}) - add_test ( - NAME H5CLEAR-copy_${h5_file} - COMMAND ${CMAKE_COMMAND} - -E copy_if_different - "${PROJECT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/${h5_file}" - ) - if (last_test) - set_tests_properties (H5CLEAR-copy_${h5_file} PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "H5CLEAR-copy_${h5_file}") - endforeach () - # make second copy of h5clear_sec2.h5 - foreach (h5_file ${HDF5_SEC2_TEST_FILES}) - add_test ( - NAME H5CLEAR-copy_orig_${h5_file} - COMMAND ${CMAKE_COMMAND} - -E copy_if_different - "${PROJECT_SOURCE_DIR}/testfiles/${h5_file}" "${PROJECT_BINARY_DIR}/testfiles/orig_${h5_file}" - ) - if (last_test) - set_tests_properties (H5CLEAR-copy_orig_${h5_file} PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "H5CLEAR-copy_orig_${h5_file}") - endforeach () - # make second copy of mod_h5clear_mdc_image.h5 - add_test ( - NAME H5CLEAR-copy_mod_h5clr_mdc_image2.h5 - COMMAND ${CMAKE_COMMAND} - -E copy_if_different - "${PROJECT_SOURCE_DIR}/testfiles/mod_h5clear_mdc_image.h5" "${PROJECT_BINARY_DIR}/testfiles/mod_h5clear_mdc_image2.h5" - ) - if (last_test) - set_tests_properties (H5CLEAR-copy_mod_h5clr_mdc_image2.h5 PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "H5CLEAR-copy_mod_h5clr_mdc_image2.h5") -endif() - -# -# -# # The following are tests to verify the expected output from h5clear # "h5clear -h" # "h5clear" (no options, no file) @@ -481,9 +450,7 @@ endif() # "h5clear -s --increment=0 h5clear_status_noclose.h5" (clear status_flag, EOA = MAX(EOA, EOF) + 0) # (no output, check exit code) # "h5clear --filesize h5clear_status_noclose.h5" (print EOA/EOF after the last action) - ADD_H5_ERR_CMP_WITH_COPY (h5clr_open_fail_nc_s 1 h5clear_open_fail h5clear_status_noclose.h5 "--filesize") - ADD_H5_RETTEST (h5clr_mdc_image_nc "false" "-s" "--increment=0" h5clear_status_noclose.h5) - ADD_H5_CMP (h5clr_no_mdc_image_nc_m h5clear_status_noclose_after_size 0 "--filesize" h5clear_status_noclose.h5) + ADD_H5_FILESIZE_FAIL_TEST (h5clear_status_noclose 1 h5clear_status_noclose 0) # # (2) h5clear_fsm_persist_noclose.h5 # "h5clear --filesize h5clear_fsm_persist_noclose.h5" (print EOA/EOF before the next action) diff --git a/tools/test/misc/CMakeTestsMkgrp.cmake b/tools/test/misc/CMakeTestsMkgrp.cmake index db1f805..11fa3f2 100644 --- a/tools/test/misc/CMakeTestsMkgrp.cmake +++ b/tools/test/misc/CMakeTestsMkgrp.cmake @@ -61,32 +61,26 @@ endif () macro (ADD_H5_TEST resultfile resultcode resultoption) - if (NOT HDF5_ENABLE_USING_MEMCHECKER) - add_test ( - NAME H5MKGRP-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.h5 - ${resultfile}.out - ${resultfile}.out.err - ) - set_tests_properties (H5MKGRP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - endif () - + add_test ( + NAME H5MKGRP-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.h5 + ) + set_tests_properties (H5MKGRP-${resultfile}-clear-objects PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) add_test ( NAME H5MKGRP-${resultfile} - COMMAND $<TARGET_FILE:h5mkgrp${tgt_ext}> ${resultoption} ${resultfile}.h5 ${ARGN} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp${tgt_ext}> ${resultoption} ${resultfile}.h5 ${ARGN} ) - set_tests_properties (H5MKGRP-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - if (HDF5_ENABLE_USING_MEMCHECKER) - if (last_test) - set_tests_properties (H5MKGRP-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () - else () - set_tests_properties (H5MKGRP-${resultfile} PROPERTIES DEPENDS H5MKGRP-${resultfile}-clear-objects) + set_tests_properties (H5MKGRP-${resultfile} PROPERTIES + DEPENDS H5MKGRP-${resultfile}-clear-objects + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5MKGRP-${resultfile}-h5ls COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_ext}>" -D "TEST_ARGS:STRING=-v;-r;${resultfile}.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -102,20 +96,19 @@ macro (ADD_H5_CMP resultfile resultcode) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME H5MKGRP_CMP-${resultfile} COMMAND $<TARGET_FILE:h5mkgrp> ${ARGN}) + add_test (NAME H5MKGRP_CMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5mkgrp> ${ARGN}) else () add_test ( NAME H5MKGRP_CMP-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - ${resultfile}.h5 - ${resultfile}.out - ${resultfile}.out.err + COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.h5 + ) + set_tests_properties (H5MKGRP_CMP-${resultfile}-clear-objects PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" ) - set_tests_properties (H5MKGRP_CMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") add_test ( NAME H5MKGRP_CMP-${resultfile} COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5mkgrp${tgt_ext}>" -D "TEST_ARGS:STRING=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" @@ -124,7 +117,9 @@ -D "TEST_REFERENCE=${resultfile}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5MKGRP_CMP-${resultfile} PROPERTIES DEPENDS H5MKGRP_CMP-${resultfile}-clear-objects) + set_tests_properties (H5MKGRP_CMP-${resultfile} PROPERTIES + DEPENDS H5MKGRP_CMP-${resultfile}-clear-objects + ) endif () endmacro () @@ -136,54 +131,23 @@ if (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5MKGRP-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - h5mkgrp_help.out - h5mkgrp_help.out.err - h5mkgrp_version.out - h5mkgrp_version.out.err - h5mkgrp_single.h5 - h5mkgrp_single.out - h5mkgrp_single.out.err - h5mkgrp_single_v.h5 - h5mkgrp_single_v.out - h5mkgrp_single_v.out.err - h5mkgrp_single_p.h5 - h5mkgrp_single_p.out - h5mkgrp_single_p.out.err - h5mkgrp_single_l.h5 - h5mkgrp_single_l.out - h5mkgrp_single_l.out.err - h5mkgrp_several.h5 - h5mkgrp_several.out - h5mkgrp_several.out.err - h5mkgrp_several_v.h5 - h5mkgrp_several_v.out - h5mkgrp_several_v.out.err - h5mkgrp_several_p.h5 - h5mkgrp_several_p.out - h5mkgrp_several_p.out.err - h5mkgrp_several_l.h5 - h5mkgrp_several_l.out - h5mkgrp_several_l.out.err - h5mkgrp_nested_p.h5 - h5mkgrp_nested_p.out - h5mkgrp_nested_p.out.err - h5mkgrp_nested_lp.h5 - h5mkgrp_nested_lp.out - h5mkgrp_nested_lp.out.err - h5mkgrp_nested_mult_p.h5 - h5mkgrp_nested_mult_p.out - h5mkgrp_nested_mult_p.out.err - h5mkgrp_nested_mult_lp.h5 - h5mkgrp_nested_mult_lp.out - h5mkgrp_nested_mult_lp.out.err + COMMAND ${CMAKE_COMMAND} -E remove + h5mkgrp_single.h5 + h5mkgrp_single_v.h5 + h5mkgrp_single_p.h5 + h5mkgrp_single_l.h5 + h5mkgrp_several.h5 + h5mkgrp_several_v.h5 + h5mkgrp_several_p.h5 + h5mkgrp_several_l.h5 + h5mkgrp_nested_p.h5 + h5mkgrp_nested_lp.h5 + h5mkgrp_nested_mult_p.h5 + h5mkgrp_nested_mult_lp.h5 + ) + set_tests_properties (H5MKGRP-clearall-objects PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" ) - set_tests_properties (H5MKGRP-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - if (last_test) - set_tests_properties (H5MKGRP-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "H5MKGRP-clearall-objects") endif () # Check that help & version is displayed properly diff --git a/tools/test/misc/CMakeTestsRepart.cmake b/tools/test/misc/CMakeTestsRepart.cmake index 53949a2..fa49c53 100644 --- a/tools/test/misc/CMakeTestsRepart.cmake +++ b/tools/test/misc/CMakeTestsRepart.cmake @@ -80,31 +80,46 @@ set_tests_properties (H5REPART-clearall-objects PROPERTIES FIXTURES_SETUP clear_testrepart) # repartition family member size to 20,000 bytes. - add_test (NAME H5REPART-h5repart_20K COMMAND $<TARGET_FILE:h5repart${tgt_ext}> -m 20000 family_file%05d.h5 fst_family%05d.h5) + add_test ( + NAME H5REPART-h5repart_20K + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 20000 family_file%05d.h5 fst_family%05d.h5 + ) set_tests_properties (H5REPART-h5repart_20K PROPERTIES FIXTURES_REQUIRED clear_testrepart ) # repartition family member size to 5 KB. - add_test (NAME H5REPART-h5repart_5K COMMAND $<TARGET_FILE:h5repart${tgt_ext}> -m 5k family_file%05d.h5 scd_family%05d.h5) + add_test ( + NAME H5REPART-h5repart_5K + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 5k family_file%05d.h5 scd_family%05d.h5 + ) set_tests_properties (H5REPART-h5repart_5K PROPERTIES FIXTURES_REQUIRED clear_testrepart ) # convert family file to sec2 file of 20,000 bytes - add_test (NAME H5REPART-h5repart_single COMMAND $<TARGET_FILE:h5repart${tgt_ext}> -m 20000 -family_to_single family_file%05d.h5 family_to_single.h5) + add_test ( + NAME H5REPART-h5repart_single + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 20000 -family_to_single family_file%05d.h5 family_to_single.h5 + ) set_tests_properties (H5REPART-h5repart_single PROPERTIES FIXTURES_REQUIRED clear_testrepart ) # convert family file to sec2 file of 20,000 bytes (old argument) - add_test (NAME H5REPART-h5repart_sec2 COMMAND $<TARGET_FILE:h5repart${tgt_ext}> -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5) + add_test ( + NAME H5REPART-h5repart_sec2 + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart${tgt_ext}> -m 20000 -family_to_sec2 family_file%05d.h5 family_to_sec2.h5 + ) set_tests_properties (H5REPART-h5repart_sec2 PROPERTIES FIXTURES_REQUIRED clear_testrepart ) # test the output files repartitioned above. - add_test (NAME H5REPART-h5repart_test COMMAND $<TARGET_FILE:h5repart_test>) + add_test ( + NAME H5REPART-h5repart_test + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repart_test> + ) set_tests_properties (H5REPART-h5repart_test PROPERTIES DEPENDS "H5REPART-h5repart_20K;H5REPART-h5repart_5K;H5REPART-h5repart_single;H5REPART-h5repart_sec2" ) diff --git a/tools/test/misc/h5clear_gentest.c b/tools/test/misc/h5clear_gentest.c index 7f80c23..96d7e75e7 100644 --- a/tools/test/misc/h5clear_gentest.c +++ b/tools/test/misc/h5clear_gentest.c @@ -15,10 +15,10 @@ /* The HDF5 test files */ const char *FILENAME[] = { - "h5clear_sec2_v3.h5", /* 0 -- sec2 file with superblock version 3 */ - "h5clear_log_v3.h5", /* 1 -- log file with superblock veresion 3 */ - "h5clear_sec2_v0.h5", /* 2 -- sec2 file with superblock version 0 */ - "h5clear_sec2_v2.h5" /* 3 -- sec2 file with superblock version 2 */ + "h5clear_sec2_v3.h5", /* 0 -- sec2 file with superblock version 3 */ + "h5clear_log_v3.h5", /* 1 -- log file with superblock veresion 3 */ + "h5clear_sec2_v0.h5", /* 2 -- sec2 file with superblock version 0 */ + "h5clear_sec2_v2.h5" /* 3 -- sec2 file with superblock version 2 */ }; const char *FILENAME_ENHANCE[] = { @@ -28,12 +28,12 @@ const char *FILENAME_ENHANCE[] = { "h5clear_fsm_persist_user_equal.h5", /* 3: user block, persisting free-space, stored EOA = actual EOF */ "h5clear_fsm_persist_user_greater.h5", /* 4: user block, persisting free-space, stored EOA > actual EOF */ "h5clear_fsm_persist_user_less.h5", /* 5: user block, persisting free-space, stored EOA < actual EOF */ - "h5clear_status_noclose.h5", /* 6 -- v3 superblock, nonzero status_flags, no flush, exit, + "h5clear_status_noclose.h5", /* 6 -- v3 superblock, nonzero status_flags, no flush, exit, stored EOA < actual EOF */ "h5clear_fsm_persist_noclose.h5" /* 7 -- persisting free-space, no flush, exit, stored EOA < actual EOF */ }; -#define KB 1024U +#define KB 1024U #define CACHE_IMAGE_FILE "h5clear_mdc_image.h5" #define DSET "DSET" @@ -42,14 +42,14 @@ const char *FILENAME_ENHANCE[] = { #define USERBLOCK 512 /*------------------------------------------------------------------------- - * Function: gen_cache_image_file + * Function: gen_cache_image_file * - * Purpose: To create a file with cache image feature enabled. + * Purpose: To create a file with cache image feature enabled. * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Vailin Choi; March 2017 + * Programmer: Vailin Choi; March 2017 * *------------------------------------------------------------------------- */ @@ -136,9 +136,9 @@ error: } /* gen_cache_image_file() */ /*------------------------------------------------------------------------- - * Function: gen_enhance_files + * Function: gen_enhance_files * - * Purpose: To create the first 6 files in FILENAME_ENHANCE[]: + * Purpose: To create the first 6 files in FILENAME_ENHANCE[]: * (0) FILENAME_ENHANCE[0]: "h5clear_fsm_persist_equal.h5" * (1) FILENAME_ENHANCE[1]: "h5clear_fsm_persist_greater.h5" * (2) FILENAME_ENHANCE[2]: "h5clear_fsm_persist_less.h5" @@ -149,15 +149,15 @@ error: * value to the location where the EOA is stored in the superblock. * Also modify the chksum in the superblock due to this change. * - * The first call to this routine (without user block) will generate + * The first call to this routine (without user block) will generate * the first 3 files. * The second call to this routine (with user block) will generate * the last 3 files. * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Vailin Choi; March 2017 + * Programmer: Vailin Choi; March 2017 * *------------------------------------------------------------------------- */ @@ -190,7 +190,7 @@ gen_enhance_files(hbool_t user) if(H5Pset_file_space_strategy(fcpl, H5F_FSPACE_STRATEGY_FSM_AGGR, TRUE, (hsize_t)1) < 0) goto error; - /* + /* * Create the file, then write invalid EOA to the file. */ for(i = 0+u; i < 3+u; i++) { @@ -221,21 +221,21 @@ gen_enhance_files(hbool_t user) if(H5Fclose(fid) < 0) goto error; - /* + /* * No further action for: - * --FILENAME_ENHANCE[0]: "h5clear_fsm_persist_equal.h5" + * --FILENAME_ENHANCE[0]: "h5clear_fsm_persist_equal.h5" * --FILENAME_ENHANCE[3]: "h5clear_fsm_persist_user_equal.h5", */ if(!(i % 3)) continue; - /* + /* * For the following files: * --FILENAME_ENHANCE[1]: "h5clear_fsm_persist_greater.h5" * --FILENAME_ENHANCE[2]: "h5clear_fsm_persist_less.h5" * --FILENAME_ENHANCE[4]: "h5clear_fsm_persist_greater.h5" * --FILENAME_ENHANCE[5]: "h5clear_fsm_persist_less.h5" * - * Write invalid value to the location for stored eoa and + * Write invalid value to the location for stored eoa and * update the chksum value. */ /* Open the file */ @@ -306,9 +306,9 @@ error: } /* gen_enhance_files() */ /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Generate test files used by h5clear. + * Purpose: Generate test files used by h5clear. * * (A) gen_cache_image_file(): * --generate a file with cache image feature @@ -317,10 +317,10 @@ error: * --generate the first 6 files in FILENAME_ENHANCE[]: * (0) "h5clear_fsm_persist_equal.h5" * (1) "h5clear_fsm_persist_greater.h5" - * (2) "h5clear_fsm_persist_less.h5" - * (3) "h5clear_fsm_persist_user_equal.h5" + * (2) "h5clear_fsm_persist_less.h5" + * (3) "h5clear_fsm_persist_user_equal.h5" * (4) "h5clear_fsm_persist_user_greater.h5" - * (5) "h5clear_fsm_persist_user_less.h5" + * (5) "h5clear_fsm_persist_user_less.h5" * * (C) Generate the following FILENAME[] files in main(): * (0a) "h5clear_sec2_v3.h5" @@ -328,43 +328,43 @@ error: * (1a) "h5clear_log_v3.h5", * (1b) "latest_h5clear_log_v3.h5" * (2) "h5clear_sec2_v0.h5" - * (3) "h5clear_sec2_v2.h5" - * - * These HDF5 files are created with non-zero status_flags in + * (3) "h5clear_sec2_v2.h5" + * + * These HDF5 files are created with non-zero status_flags in * the superblock via flushing and exiting without closing the * library. - * Due to file locking, status_flags in the superblock will be - * nonzero after H5Fcreate. The library will clear status_flags - * on file closing. + * Due to file locking, status_flags in the superblock will be + * nonzero after H5Fcreate. The library will clear status_flags + * on file closing. * This program, after "H5Fcreate" the files, exits without - * going through library closing. Thus, status_flags for these - * files are not cleared. - * The library will check consistency of status_flags when - * opening a file with superblock >= v3 and will return error + * going through library closing. Thus, status_flags for these + * files are not cleared. + * The library will check consistency of status_flags when + * opening a file with superblock >= v3 and will return error * accordingly. - * The library will not check status_flags when opening a file - * with < v3 superblock. - * These files are used by "h5clear" to see if the tool clears - * status_flags properly so users can open the files afterwards. - * + * The library will not check status_flags when opening a file + * with < v3 superblock. + * These files are used by "h5clear" to see if the tool clears + * status_flags properly so users can open the files afterwards. + * * (D) Generate the last two files in FILENAME_ENHANCE[] in main(): - * (6) "h5clear_status_noclose.h5", + * (6) "h5clear_status_noclose.h5", * (7) "h5clear_fsm_persist_noclose.h5" * - * Return: Success: 0 - * Failure: 1 + * Return: Success: 0 + * Failure: 1 * - * Programmer: Vailin Choi; July 2013 + * Programmer: Vailin Choi; July 2013 * *------------------------------------------------------------------------- */ int main(void) { - hid_t fid = -1; /* File ID */ - hid_t fcpl = -1; /* File creation property list */ - hid_t fapl = -1, new_fapl = -1; /* File access property lists */ - char fname[512]; /* File name */ + hid_t fid = -1; /* File ID */ + hid_t fcpl = -1; /* File creation property list */ + hid_t fapl = -1, new_fapl = -1; /* File access property lists */ + char fname[512]; /* File name */ unsigned new_format; /* To use latest library format or not */ hid_t sid = -1; /* Dataspace ID */ hid_t did = -1; /* Dataset ID */ @@ -382,7 +382,7 @@ main(void) if(gen_enhance_files(TRUE) < 0) goto error; - /* + /* * Generate files in FILENAME[] */ /* Create a copy of the file access property list */ @@ -396,13 +396,13 @@ main(void) if(H5Pset_libver_bounds(new_fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST) < 0) goto error; - /* + /* * Files created within this for loop will have v3 superblock and nonzero status_flags * --FILENAME[0]: "h5clear_sec2_v3.h5", "latest_h5clear_sec2_v3.h5" * --FILENAME[1]: "h5clear_log_v3.h5", "latest_h5clear_log_v3.h5" */ for(new_format = FALSE; new_format <= TRUE; new_format++) { - hid_t fapl2, my_fapl; /* File access property lists */ + hid_t fapl2, my_fapl; /* File access property lists */ /* Set to use the appropriate file access property list */ if(new_format) @@ -415,14 +415,14 @@ main(void) if((my_fapl = H5Pcopy(fapl2)) < 0) goto error; /* Create the file */ - sprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[0]); - if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0) + HDsprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[0]); + if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0) goto error; /* Flush the file */ if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) goto error; - + /* Close the property list */ if(H5Pclose(my_fapl) < 0) goto error; @@ -439,8 +439,8 @@ main(void) goto error; /* Create the file */ - sprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[1]); - if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0) + HDsprintf(fname, "%s%s", new_format? "latest_":"", FILENAME[1]); + if((fid = H5Fcreate(fname, H5F_ACC_TRUNC | (new_format ? 0 : H5F_ACC_SWMR_WRITE), H5P_DEFAULT, my_fapl)) < 0) goto error; /* Flush the file */ @@ -453,11 +453,11 @@ main(void) } /* end for */ - /* + /* * Create a sec2 file with v0 superblock but nonzero status_flags: * FILENAME[2]: "h5clear_sec2_v0.h5" */ - if((fid = H5Fcreate(FILENAME[2], H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) + if((fid = H5Fcreate(FILENAME[2], H5F_ACC_TRUNC, H5P_DEFAULT, fapl)) < 0) goto error; /* Flush the file */ @@ -465,9 +465,9 @@ main(void) goto error; - /* + /* * Create a sec2 file with v2 superblock but nonzero status_flags: - * FILENAME[3]: "h5clear_sec2_v2.h5" + * FILENAME[3]: "h5clear_sec2_v2.h5" */ if((fcpl = H5Pcreate(H5P_FILE_CREATE)) < 0) goto error; @@ -476,14 +476,14 @@ main(void) if(H5Pset_shared_mesg_index(fcpl, 0, H5O_SHMESG_DTYPE_FLAG, 50) < 0) goto error; - if((fid = H5Fcreate(FILENAME[3], H5F_ACC_TRUNC, fcpl, fapl)) < 0) + if((fid = H5Fcreate(FILENAME[3], H5F_ACC_TRUNC, fcpl, fapl)) < 0) goto error; /* Flush the file */ if(H5Fflush(fid, H5F_SCOPE_GLOBAL) < 0) goto error; - + /* Close the property lists */ if(H5Pclose(fapl) < 0) goto error; @@ -492,10 +492,10 @@ main(void) if(H5Pclose(fcpl) < 0) goto error; - /* + /* * Create the last two files in FILENAME_ENHANCE[]: * --FILENAME_ENHANCE[6]: h5clear_status_noclose.h5 - * --FILENAME_ENHANCE[7]: h5clear_fsm_persist_noclose.h5 + * --FILENAME_ENHANCE[7]: h5clear_fsm_persist_noclose.h5 */ /* * FILENAME_ENHANCE[6]: h5clear_status_noclose.h5 @@ -503,7 +503,7 @@ main(void) * --version 3 superblock * --nonzero status_flags * --does not persist free-space - * --does not flush the file, just exit without closing file: + * --does not flush the file, just exit without closing file: * --this file is similar to the user-suppplied test file attached with HDFFV-10347 */ if((fapl = H5Pcreate(H5P_FILE_ACCESS)) < 0) @@ -542,8 +542,8 @@ main(void) /* Does not flush and does not close the file */ - /* - * FILENAME_ENHANCE[7]: h5clear_fsm_persist_noclose.h5 + /* + * FILENAME_ENHANCE[7]: h5clear_fsm_persist_noclose.h5 * --stored EOA < actual EOF * --persisting free-space * --undefined fsinfo.eoa_pre_fsm_fsalloc diff --git a/tools/test/misc/h5perf_gentest.c b/tools/test/misc/h5perf_gentest.c index 3784278..f50e5fb 100644 --- a/tools/test/misc/h5perf_gentest.c +++ b/tools/test/misc/h5perf_gentest.c @@ -10,8 +10,8 @@ * help@hdfgroup.org. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ /***************************************************************************** - This test generates attributes, groups, and datasets of many types. It - creates a large number of attributes, groups, and datasets by specifying + This test generates attributes, groups, and datasets of many types. It + creates a large number of attributes, groups, and datasets by specifying -a, -g, -d options respectively. Using "-h" option to see details. Programmer: Peter Cao <xcao@hdfgroup.org>, Jan. 2013 @@ -31,7 +31,7 @@ #define MAXVLEN 10 #define FIXED_LEN 8 -typedef enum { SOLID=0, LIQUID, GAS, PLASMA } phase_t; +typedef enum { SOLID=0, LIQUID, GAS, PLASMA } phase_t; typedef struct { int i; @@ -43,24 +43,24 @@ typedef struct { float f_array[FIXED_LEN]; hvl_t i_vlen; char *s_vlen; -} test_comp_t; +} test_comp_t; typedef struct { int zipcode; char *city; -} zipcode_t; +} zipcode_t; int add_attrs(hid_t oid, int idx); int add_attr(hid_t oid, const char *name, hid_t tid, hid_t sid, void *buf) ; -herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, - int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen, - int compressed, int latest); +herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, + int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen, + int compressed, int latest); int main (int argc, char *argv[]) { char fname[32]; - int i, ngrps=NGROUPS, ndsets=NDSETS, nattrs=NATTRS, dim0=DIM0, - chunk=DIM0/10+1, nrows=NROWS, vlen=MAXVLEN, l=0, z=0; + int i, ngrps=NGROUPS, ndsets=NDSETS, nattrs=NATTRS, dim0=DIM0, + chunk=DIM0/10+1, nrows=NROWS, vlen=MAXVLEN, l=0, z=0; memset(fname, 0, 32); for (i=1; i<argc; i++) { @@ -83,92 +83,92 @@ int main (int argc, char *argv[]) else if (strcmp(argv[i], "-l")==0) l = 1; else if (strcmp(argv[i], "-z")==0) - z = 1; + z = 1; else if (strcmp(argv[i], "-h")==0) { - printf("\nOPTONS:\n"); - printf("\t-f F:\tname of the test file (default: %s).\n", FNAME); - printf("\t-g N:\tnumber of top level groups (default: %d).\n", NGROUPS); - printf("\t-d N:\tnumber of datasets (default: %d).\n", NDSETS); - printf("\t-a N:\tnumber of attributes (default: %d).\n", NATTRS); - printf("\t-r N:\tnumber of rows in the large compound dataset (default: %d).\n", NROWS); - printf("\t-s N:\tsize of dim0 in datasets (default: %d).\n", DIM0); - printf("\t-c N:\tchunk size of dim0 (default: %d).\n", (DIM0/10+1)); - printf("\t-v N:\tmax vlen size (default: %d).\n", MAXVLEN); - printf("\t-l:\tuse latest format (default: no).\n"); - printf("\t-z:\tuse gzip compression (default: no).\n"); - printf("\t-h:\tthis help information.\n"); - printf("Example:\n"); - printf("\t./a.out -f test.h5 -g 10000 -d 5000 -a 500 -r 10000 -s 200 -c 20 -v 40 -l -z\n\n"); + HDprintf("\nOPTONS:\n"); + HDprintf("\t-f F:\tname of the test file (default: %s).\n", FNAME); + HDprintf("\t-g N:\tnumber of top level groups (default: %d).\n", NGROUPS); + HDprintf("\t-d N:\tnumber of datasets (default: %d).\n", NDSETS); + HDprintf("\t-a N:\tnumber of attributes (default: %d).\n", NATTRS); + HDprintf("\t-r N:\tnumber of rows in the large compound dataset (default: %d).\n", NROWS); + HDprintf("\t-s N:\tsize of dim0 in datasets (default: %d).\n", DIM0); + HDprintf("\t-c N:\tchunk size of dim0 (default: %d).\n", (DIM0/10+1)); + HDprintf("\t-v N:\tmax vlen size (default: %d).\n", MAXVLEN); + HDprintf("\t-l:\tuse latest format (default: no).\n"); + HDprintf("\t-z:\tuse gzip compression (default: no).\n"); + HDprintf("\t-h:\tthis help information.\n"); + HDprintf("Example:\n"); + HDprintf("\t./a.out -f test.h5 -g 10000 -d 5000 -a 500 -r 10000 -s 200 -c 20 -v 40 -l -z\n\n"); exit(0); } } - + if (strlen(fname)<=0) - sprintf(fname, FNAME); + HDsprintf(fname, FNAME); + + create_perf_test_file(fname, ngrps, ndsets, nattrs, (hsize_t)nrows, + (hsize_t)dim0, (hsize_t)chunk, vlen, z, l); - create_perf_test_file(fname, ngrps, ndsets, nattrs, (hsize_t)nrows, - (hsize_t)dim0, (hsize_t)chunk, vlen, z, l); - return 0; } /***************************************************************************** - This function generates attributes, groups, and datasets of many types. + This function generates attributes, groups, and datasets of many types. Parameters: - fname: file_name. - ngrps: number of top level groups. - ndsets: number of datasets. - attrs: number of attributes. - nrow: number of rows in a dataset. - chunk: chunk size (single number). - vlen: max vlen size. - comp: use latest format. - latest: use gzip comnpression. - + fname: file_name. + ngrps: number of top level groups. + ndsets: number of datasets. + attrs: number of attributes. + nrow: number of rows in a dataset. + chunk: chunk size (single number). + vlen: max vlen size. + comp: use latest format. + latest: use gzip comnpression. + Return: Non-negative on success/Negative on failure - + Programmer: Peter Cao <xcao@hdfgroup.org>, Jan. 2013 ****************************************************************************/ -herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, - int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen, - int compressed, int latest) +herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, + int nattrs, hsize_t nrows, hsize_t dim0, hsize_t chunk, int vlen, + int compressed, int latest) { int i, j, k; - hid_t fid, sid_null, sid_scalar, sid_1d, sid_2d, did, aid, sid_2, sid_large, - fapl=H5P_DEFAULT, dcpl=H5P_DEFAULT, gid1, gid2, cmp_tid, tid_str, - tid_enum, tid_array_f, tid_vlen_i, tid_vlen_s; + hid_t fid, sid_null, sid_scalar, sid_1d, sid_2d, did, aid, sid_2, sid_large, + fapl=H5P_DEFAULT, dcpl=H5P_DEFAULT, gid1, gid2, cmp_tid, tid_str, + tid_enum, tid_array_f, tid_vlen_i, tid_vlen_s; char name[32], tmp_name1[32], tmp_name2[32], tmp_name3[32]; - hsize_t dims[1]={dim0}, dims2d[2]={dim0, (dim0/4+1)}, dims_array[1]={FIXED_LEN}, - dim1[1]={2}; + hsize_t dims[1]={dim0}, dims2d[2]={dim0, (dim0/4+1)}, dims_array[1]={FIXED_LEN}, + dim1[1]={2}; char *enum_names[4] = {"SOLID", "LIQUID", "GAS", "PLASMA"}; test_comp_t *buf_comp=NULL, *buf_comp_large=NULL; int *buf_int=NULL; float (*buf_float_a)[FIXED_LEN]=NULL; double **buf_double2d=NULL; hvl_t *buf_vlen_i=NULL; - char (*buf_str)[FIXED_LEN]; - char **buf_vlen_s=NULL; - hobj_ref_t buf_ref[2]; - hdset_reg_ref_t buf_reg_ref[2]; + char (*buf_str)[FIXED_LEN]; + char **buf_vlen_s=NULL; + hobj_ref_t buf_ref[2]; + hdset_reg_ref_t buf_reg_ref[2]; size_t offset, len; herr_t status; - char *names[NTYPES] = { "int", "ulong", "float", "double", "fixed string", - "enum", "fixed float array", "vlen int array", "vlen strings"}; - hid_t types[NTYPES] = { H5T_NATIVE_INT, H5T_NATIVE_UINT64, H5T_NATIVE_FLOAT, + char *names[NTYPES] = { "int", "ulong", "float", "double", "fixed string", + "enum", "fixed float array", "vlen int array", "vlen strings"}; + hid_t types[NTYPES] = { H5T_NATIVE_INT, H5T_NATIVE_UINT64, H5T_NATIVE_FLOAT, H5T_NATIVE_DOUBLE, tid_str, tid_enum, tid_array_f, tid_vlen_i, tid_vlen_s}; - hsize_t coords[4][2] = { {0, 1}, {3, 5}, {1, 0}, {2, 4}}, start=0, stride=1, count=1; - - if (nrows < NROWS) nrows = NROWS; + hsize_t coords[4][2] = { {0, 1}, {3, 5}, {1, 0}, {2, 4}}, start=0, stride=1, count=1; + + if (nrows < NROWS) nrows = NROWS; if (ngrps<NGROUPS) ngrps=NGROUPS; - if (ndsets<NDSETS) ndsets=NDSETS; - if (nattrs<NATTRS) nattrs=NATTRS; - if (dim0<DIM0) dim0=DIM0; + if (ndsets<NDSETS) ndsets=NDSETS; + if (nattrs<NATTRS) nattrs=NATTRS; + if (dim0<DIM0) dim0=DIM0; if (chunk>dim0) chunk=dim0/4; if (chunk<1) chunk = 1; - if (vlen<1) vlen = MAXVLEN; + if (vlen<1) vlen = MAXVLEN; - /* create fixed string datatype */ + /* create fixed string datatype */ types[4] = tid_str = H5Tcopy (H5T_C_S1); H5Tset_size (tid_str, FIXED_LEN); @@ -181,15 +181,15 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, /* create float array datatype */ types[6] = tid_array_f = H5Tarray_create (H5T_NATIVE_FLOAT, 1, dims_array); - + /* create variable length integer datatypes */ types[7] = tid_vlen_i = H5Tvlen_create (H5T_NATIVE_INT); - + /* create variable length string datatype */ types[8] = tid_vlen_s = H5Tcopy (H5T_C_S1); H5Tset_size (tid_vlen_s, H5T_VARIABLE); - - /* create compound datatypes */ + + /* create compound datatypes */ cmp_tid = H5Tcreate (H5T_COMPOUND, sizeof (test_comp_t)); offset = 0; for (i=0; i<NTYPES-2; i++) { @@ -197,31 +197,31 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, offset += H5Tget_size(types[i]); } - H5Tinsert(cmp_tid, names[7], offset, types[7]); - offset += sizeof (hvl_t); - H5Tinsert(cmp_tid, names[8], offset, types[8]); + H5Tinsert(cmp_tid, names[7], offset, types[7]); + offset += sizeof (hvl_t); + H5Tinsert(cmp_tid, names[8], offset, types[8]); - /* create dataspace */ + /* create dataspace */ sid_1d = H5Screate_simple (1, dims, NULL); sid_2d = H5Screate_simple (2, dims2d, NULL); sid_2 = H5Screate_simple (1, dim1, NULL); - sid_large = H5Screate_simple (1, &nrows, NULL); - sid_null = H5Screate (H5S_NULL); - sid_scalar = H5Screate (H5S_SCALAR); - - /* create fid access property */ - fapl = H5Pcreate (H5P_FILE_ACCESS); + sid_large = H5Screate_simple (1, &nrows, NULL); + sid_null = H5Screate (H5S_NULL); + sid_scalar = H5Screate (H5S_SCALAR); + + /* create fid access property */ + fapl = H5Pcreate (H5P_FILE_ACCESS); H5Pset_libver_bounds (fapl, H5F_LIBVER_LATEST, H5F_LIBVER_LATEST); - /* create dataset creation property */ + /* create dataset creation property */ dcpl = H5Pcreate (H5P_DATASET_CREATE); - /* set dataset chunk */ + /* set dataset chunk */ if (chunk>0) { H5Pset_chunk (dcpl, 1, &chunk); } - /* set dataset compression */ + /* set dataset compression */ if (compressed) { if (chunk<=0) { chunk = dim0/10+1;; @@ -229,54 +229,54 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, } H5Pset_shuffle (dcpl); H5Pset_deflate (dcpl, 6); - } + } - /* allocate buffers */ + /* allocate buffers */ buf_comp = (test_comp_t *)calloc(dim0, sizeof(test_comp_t)); buf_comp_large = (test_comp_t *)calloc(nrows, sizeof(test_comp_t)); buf_int = (int *)calloc(dim0, sizeof(int)); buf_float_a = malloc(dim0*sizeof(*buf_float_a)); - buf_vlen_i = (hvl_t *)calloc(dim0, sizeof (hvl_t)); + buf_vlen_i = (hvl_t *)calloc(dim0, sizeof (hvl_t)); buf_vlen_s = (char **)calloc(dim0, sizeof(char *)); - buf_str = malloc(dim0*sizeof (*buf_str)); + buf_str = malloc(dim0*sizeof (*buf_str)); - /* allocate array of doulbe pointers */ - buf_double2d = (double **)calloc(dims2d[0],sizeof(double *)); - /* allocate a contigous chunk of memory for the data */ - buf_double2d[0] = (double *)calloc( dims2d[0]*dims2d[1],sizeof(double) ); - /* assign memory city to pointer array */ - for (i=1; i <dims2d[0]; i++) buf_double2d[i] = buf_double2d[0]+i*dims2d[1]; + /* allocate array of doulbe pointers */ + buf_double2d = (double **)calloc(dims2d[0],sizeof(double *)); + /* allocate a contigous chunk of memory for the data */ + buf_double2d[0] = (double *)calloc( dims2d[0]*dims2d[1],sizeof(double) ); + /* assign memory city to pointer array */ + for (i=1; i <dims2d[0]; i++) buf_double2d[i] = buf_double2d[0]+i*dims2d[1]; - /* fill buffer values */ - len = 1; + /* fill buffer values */ + len = 1; for (i=0; i<dims[0]; i++) { buf_comp[i].i = buf_int[i] = i-2147483648; buf_comp[i].l = 0xffffffffffffffff-i; buf_comp[i].f = 1.0/(i+1.0); buf_comp[i].d = 987654321.0*i+1.0/(i+1.0); buf_comp[i].e = (phase_t) (i % (int) (PLASMA + 1)); - - for (j=0; j<FIXED_LEN; j++) { - buf_comp[i].f_array[j] = buf_float_a[i][j] = i*100+j; - buf_str[i][j] = 'a' + (i%26); - } - buf_str[i][FIXED_LEN-1] = 0; + + for (j=0; j<FIXED_LEN; j++) { + buf_comp[i].f_array[j] = buf_float_a[i][j] = i*100+j; + buf_str[i][j] = 'a' + (i%26); + } + buf_str[i][FIXED_LEN-1] = 0; strcpy(buf_comp[i].s, buf_str[i]); - - len = (1-cos(i/8.0))/2*vlen+1; - if (!i) len = vlen; - buf_vlen_i[i].len = len; - buf_vlen_i[i].p = (int *)calloc(len, sizeof(int)); - for (j=0; j<len; j++) ((int*)(buf_vlen_i[i].p))[j] = i*100+j; - buf_comp[i].i_vlen = buf_vlen_i[i]; - - buf_vlen_s[i] = (char *)calloc(len, sizeof(char)); - for (j=0; j<len-1; j++) - buf_vlen_s[i][j] = j%26+'A'; - buf_comp[i].s_vlen = buf_vlen_s[i]; - - for (j=0; j<dims2d[1]; j++) - buf_double2d[i][j] = i+j/10000.0; + + len = (1-cos(i/8.0))/2*vlen+1; + if (!i) len = vlen; + buf_vlen_i[i].len = len; + buf_vlen_i[i].p = (int *)calloc(len, sizeof(int)); + for (j=0; j<len; j++) ((int*)(buf_vlen_i[i].p))[j] = i*100+j; + buf_comp[i].i_vlen = buf_vlen_i[i]; + + buf_vlen_s[i] = (char *)calloc(len, sizeof(char)); + for (j=0; j<len-1; j++) + buf_vlen_s[i][j] = j%26+'A'; + buf_comp[i].s_vlen = buf_vlen_s[i]; + + for (j=0; j<dims2d[1]; j++) + buf_double2d[i][j] = i+j/10000.0; } for (i=0; i<nrows; i++) { @@ -289,147 +289,147 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, buf_comp_large[i].f_array[j] = i*100+j; buf_comp_large[i].s[j] = 'a' + (i%26); } - len = i%vlen+1; + len = i%vlen+1; buf_comp_large[i].i_vlen.len = len; buf_comp_large[i].i_vlen.p = (int *)calloc(len, sizeof(int)); for (j=0; j<len; j++) ((int*)(buf_comp_large[i].i_vlen.p))[j] = i*100+j; buf_comp_large[i].s_vlen = (char *)calloc(i+2, sizeof(char)); for (j=0; j<i+1; j++) (buf_comp_large[i].s_vlen)[j] = j%26+'A'; } - - /* create file */ + + /* create file */ if (latest) fid = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, fapl); else fid = H5Fcreate (fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); - add_attrs(fid, 0); + add_attrs(fid, 0); - sprintf(name, "a cmp ds of %d rows", nrows); - did = H5Dcreate (fid, name, cmp_tid, sid_large, H5P_DEFAULT, dcpl, H5P_DEFAULT); - H5Dwrite (did, cmp_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_comp_large); - add_attrs(did, 0); - H5Dclose(did); + HDsprintf(name, "a cmp ds of %d rows", nrows); + did = H5Dcreate (fid, name, cmp_tid, sid_large, H5P_DEFAULT, dcpl, H5P_DEFAULT); + H5Dwrite (did, cmp_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_comp_large); + add_attrs(did, 0); + H5Dclose(did); - // /* add attributes*/ + // /* add attributes*/ gid1 = H5Gcreate (fid, "attributes", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (nattrs<1) nattrs = 1; - i=0; - while (i<nattrs) i += add_attrs(gid1, i); - H5Gclose(gid1); - - /* add many sub groups to a group*/ + if (nattrs<1) nattrs = 1; + i=0; + while (i<nattrs) i += add_attrs(gid1, i); + H5Gclose(gid1); + + /* add many sub groups to a group*/ gid1 = H5Gcreate (fid, "groups", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - add_attrs(gid1, 0); + add_attrs(gid1, 0); for (i=0; i<ngrps; i++) { - /* create sub groups */ - sprintf(name, "g%02d", i); + /* create sub groups */ + HDsprintf(name, "g%02d", i); gid2 = H5Gcreate (gid1, name, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (i<10) add_attrs(gid2, 0); - H5Gclose(gid2); - } - H5Gclose(gid1); - - /* add many datasets to a group */ - gid1 = H5Gcreate (fid, "datasets", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - add_attrs(gid1, 0); + if (i<10) add_attrs(gid2, 0); + H5Gclose(gid2); + } + H5Gclose(gid1); + + /* add many datasets to a group */ + gid1 = H5Gcreate (fid, "datasets", H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + add_attrs(gid1, 0); for (j=0; j<ndsets; j+=12) { - /* 1 add a null dataset */ - sprintf(name, "%05d null dataset", j); + /* 1 add a null dataset */ + HDsprintf(name, "%05d null dataset", j); did = H5Dcreate (gid1, name, H5T_STD_I32LE, sid_null, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - if (!j) add_attrs(did, j); - H5Dclose(did); + if (!j) add_attrs(did, j); + H5Dclose(did); - /* 2 add scalar int point */ - sprintf(name, "%05d scalar int point", j); + /* 2 add scalar int point */ + HDsprintf(name, "%05d scalar int point", j); did = H5Dcreate (gid1, name, H5T_NATIVE_INT, sid_scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite (did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &j); - if (!j) add_attrs(did, j); - H5Dclose(did); - - /* 3 scalar vlen string */ - sprintf(name, "%05d scalar vlen string", j); + H5Dwrite (did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, &j); + if (!j) add_attrs(did, j); + H5Dclose(did); + + /* 3 scalar vlen string */ + HDsprintf(name, "%05d scalar vlen string", j); did = H5Dcreate (gid1, name, tid_vlen_s, sid_scalar, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite (did, tid_vlen_s, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buf_vlen_s[0]); - if (!j) add_attrs(did, j); - H5Dclose(did); - - /* 4 add fixed-length float array */ - sprintf(name, "%05d fixed-length float array", j); - did = H5Dcreate (gid1, name, tid_array_f, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT); - H5Dwrite (did, tid_array_f, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_float_a); - if (!j) add_attrs(did, j); - H5Dclose(did); - - /* 5 add fixed-length strings */ - sprintf(name, "%05d fixed-length strings", j); - did = H5Dcreate (gid1, name, tid_str, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT); - H5Dwrite (did, tid_str, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_str); - if (!j) add_attrs(did, j); - H5Dclose(did); - - /* 6 add compound data */ - sprintf(name, "%05d compund data", j); - did = H5Dcreate (gid1, name, cmp_tid, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT); - H5Dwrite (did, cmp_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_comp); - if (!j) add_attrs(did, j); - H5Dclose(did); - - /* 7 add 2D double */ - sprintf(name, "%05d 2D double", j); - strcpy (tmp_name1, name); - did = H5Dcreate (gid1, name, H5T_NATIVE_DOUBLE, sid_2d, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite (did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_double2d[0]); - if (!j) add_attrs(did, j); - H5Dclose(did); - - /* 8 add 1D int array */ - sprintf(name, "%05d 1D int array", j); + H5Dwrite (did, tid_vlen_s, H5S_ALL, H5S_ALL, H5P_DEFAULT, &buf_vlen_s[0]); + if (!j) add_attrs(did, j); + H5Dclose(did); + + /* 4 add fixed-length float array */ + HDsprintf(name, "%05d fixed-length float array", j); + did = H5Dcreate (gid1, name, tid_array_f, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT); + H5Dwrite (did, tid_array_f, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_float_a); + if (!j) add_attrs(did, j); + H5Dclose(did); + + /* 5 add fixed-length strings */ + HDsprintf(name, "%05d fixed-length strings", j); + did = H5Dcreate (gid1, name, tid_str, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT); + H5Dwrite (did, tid_str, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_str); + if (!j) add_attrs(did, j); + H5Dclose(did); + + /* 6 add compound data */ + HDsprintf(name, "%05d compund data", j); + did = H5Dcreate (gid1, name, cmp_tid, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT); + H5Dwrite (did, cmp_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_comp); + if (!j) add_attrs(did, j); + H5Dclose(did); + + /* 7 add 2D double */ + HDsprintf(name, "%05d 2D double", j); + strcpy (tmp_name1, name); + did = H5Dcreate (gid1, name, H5T_NATIVE_DOUBLE, sid_2d, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); + H5Dwrite (did, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_double2d[0]); + if (!j) add_attrs(did, j); + H5Dclose(did); + + /* 8 add 1D int array */ + HDsprintf(name, "%05d 1D int array", j); did = H5Dcreate (gid1, name, H5T_NATIVE_INT, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT); - H5Dwrite (did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_int); - if (!j) add_attrs(did, j); - H5Dclose(did); - - /* 9 add vlen int array */ - sprintf(name, "%05d vlen int array", j); - strcpy (tmp_name2, name); + H5Dwrite (did, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_int); + if (!j) add_attrs(did, j); + H5Dclose(did); + + /* 9 add vlen int array */ + HDsprintf(name, "%05d vlen int array", j); + strcpy (tmp_name2, name); did = H5Dcreate (gid1, name, tid_vlen_i, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT); - H5Dwrite (did, tid_vlen_i, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_vlen_i); - if (!j) add_attrs(did, j); - H5Dclose(did); + H5Dwrite (did, tid_vlen_i, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_vlen_i); + if (!j) add_attrs(did, j); + H5Dclose(did); - /* 10 add vlen strings */ - sprintf(name, "%05d vlen strings", j); - strcpy (tmp_name3, name); + /* 10 add vlen strings */ + HDsprintf(name, "%05d vlen strings", j); + strcpy (tmp_name3, name); did = H5Dcreate (gid1, name, tid_vlen_s, sid_1d, H5P_DEFAULT, dcpl, H5P_DEFAULT); - H5Dwrite (did, tid_vlen_s, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_vlen_s); - if (!j) add_attrs(did, j); - H5Dclose(did); - - /* 11 add object refs */ - H5Rcreate(&buf_ref[0],gid1, ".", H5R_OBJECT, (hid_t)-1); - H5Rcreate(&buf_ref[1],gid1, tmp_name3, H5R_OBJECT, (hid_t)-1); - sprintf(name, "%05d obj refs", j); + H5Dwrite (did, tid_vlen_s, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_vlen_s); + if (!j) add_attrs(did, j); + H5Dclose(did); + + /* 11 add object refs */ + H5Rcreate(&buf_ref[0],gid1, ".", H5R_OBJECT, (hid_t)-1); + H5Rcreate(&buf_ref[1],gid1, tmp_name3, H5R_OBJECT, (hid_t)-1); + HDsprintf(name, "%05d obj refs", j); did = H5Dcreate (gid1, name, H5T_STD_REF_OBJ, sid_2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite (did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_ref); - if (!j) add_attrs(did, j); - H5Dclose(did); - - /* 12 add region refs */ - H5Sselect_elements (sid_2d, H5S_SELECT_SET, 4, coords[0]); - H5Rcreate(&buf_reg_ref[0],gid1, tmp_name1, H5R_DATASET_REGION, sid_2d); - H5Sselect_none(sid_2d); - count = dims[0]/2+1; - H5Sselect_hyperslab (sid_1d, H5S_SELECT_SET, &start, &stride, &count,NULL); - H5Rcreate(&buf_reg_ref[1],gid1, tmp_name2, H5R_DATASET_REGION, sid_1d); - H5Sselect_none(sid_1d); - sprintf(name, "%05d region refs", j); + H5Dwrite (did, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_ref); + if (!j) add_attrs(did, j); + H5Dclose(did); + + /* 12 add region refs */ + H5Sselect_elements (sid_2d, H5S_SELECT_SET, 4, coords[0]); + H5Rcreate(&buf_reg_ref[0],gid1, tmp_name1, H5R_DATASET_REGION, sid_2d); + H5Sselect_none(sid_2d); + count = dims[0]/2+1; + H5Sselect_hyperslab (sid_1d, H5S_SELECT_SET, &start, &stride, &count,NULL); + H5Rcreate(&buf_reg_ref[1],gid1, tmp_name2, H5R_DATASET_REGION, sid_1d); + H5Sselect_none(sid_1d); + HDsprintf(name, "%05d region refs", j); did = H5Dcreate (gid1, name, H5T_STD_REF_DSETREG, sid_2, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT); - H5Dwrite (did, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_reg_ref); - if (!j) add_attrs(did, j); - H5Dclose(did); - } - H5Gclose(gid1); - + H5Dwrite (did, H5T_STD_REF_DSETREG, H5S_ALL, H5S_ALL, H5P_DEFAULT, buf_reg_ref); + if (!j) add_attrs(did, j); + H5Dclose(did); + } + H5Gclose(gid1); + H5Tclose (tid_array_f); H5Tclose (tid_vlen_i); H5Tclose (tid_vlen_s); @@ -447,22 +447,22 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, H5Fclose (fid); for (i=0; i<dims[0]; i++) { - if (buf_vlen_i[i].p) free(buf_vlen_i[i].p); - if (buf_vlen_s[i]) free(buf_vlen_s[i]); - } + if (buf_vlen_i[i].p) free(buf_vlen_i[i].p); + if (buf_vlen_s[i]) free(buf_vlen_s[i]); + } for (i=0; i<nrows; i++) { - if (buf_comp_large[i].i_vlen.p) free(buf_comp_large[i].i_vlen.p); - if (buf_comp_large[i].s_vlen) free(buf_comp_large[i].s_vlen); - } - + if (buf_comp_large[i].i_vlen.p) free(buf_comp_large[i].i_vlen.p); + if (buf_comp_large[i].s_vlen) free(buf_comp_large[i].s_vlen); + } + free (buf_comp); free (buf_comp_large); free (buf_int); free (buf_float_a); free (buf_double2d[0]); free (buf_double2d); - free (buf_str); + free (buf_str); free(buf_vlen_i); free(buf_vlen_s); @@ -470,34 +470,34 @@ herr_t create_perf_test_file(const char *fname, int ngrps, int ndsets, } /* add a single attribute */ -int add_attr(hid_t oid, const char *name, hid_t tid, hid_t sid, void *buf) +int add_attr(hid_t oid, const char *name, hid_t tid, hid_t sid, void *buf) { hid_t aid; aid = H5Acreate (oid, name, tid, sid, H5P_DEFAULT, H5P_DEFAULT); - if (aid <0) - return 0; - - H5Awrite(aid, tid, buf); + if (aid <0) + return 0; + + H5Awrite(aid, tid, buf); H5Aclose(aid); - - return 1; + + return 1; } -/* +/* adds different types of attributes to an object. - - returns the number of attributes added to the objects. + + returns the number of attributes added to the objects. */ -int add_attrs(hid_t oid, int idx) +int add_attrs(hid_t oid, int idx) { char name[32]; int i0, i1, i2, j, nattrs=0; - hid_t aid, tid, tid1, sid; + hid_t aid, tid, tid1, sid; hvl_t i_vlen[4]; - hobj_ref_t ref; - zipcode_t cmp_data[4]; + hobj_ref_t ref; + zipcode_t cmp_data[4]; unsigned int i = 0xffffffff; long long l = -2147483647; float f = 123456789.987654321; @@ -505,22 +505,22 @@ int add_attrs(hid_t oid, int idx) char *s[7] = {"Parting", "is such", "sweeter", "sorrow."}; float f_array[4] = {1.0, 2.22, 3.333, 4.444}; char *s_vlen[4] = {"Parting", "is such", "sweet", "sorrow."}; - hsize_t dims1[1]={1}, dims2[1]={4}, dims3[2]={3,5}; - int int3d[4][3][5]; - size_t offset = 0; - - for (i0=0; i0<4; i0++) { - i_vlen[i0].len = (i0+1); - i_vlen[i0].p = (int *)calloc(i_vlen[i0].len, sizeof(int)); - for (j=0; j<i_vlen[i0].len; j++) - ((int *)i_vlen[i0].p)[j] = i0*100+j; - for (i1=0; i1<3; i1++) { - for (i2=0; i2<5; i2++) - int3d[i0][i1][i2] = i0*i1-i1*i2+i0*i2; - } + hsize_t dims1[1]={1}, dims2[1]={4}, dims3[2]={3,5}; + int int3d[4][3][5]; + size_t offset = 0; + + for (i0=0; i0<4; i0++) { + i_vlen[i0].len = (i0+1); + i_vlen[i0].p = (int *)calloc(i_vlen[i0].len, sizeof(int)); + for (j=0; j<i_vlen[i0].len; j++) + ((int *)i_vlen[i0].p)[j] = i0*100+j; + for (i1=0; i1<3; i1++) { + for (i2=0; i2<5; i2++) + int3d[i0][i1][i2] = i0*i1-i1*i2+i0*i2; + } } - cmp_data[0].zipcode = 01001; + cmp_data[0].zipcode = 01001; cmp_data[0].city = "Agawam, Massachusetts"; cmp_data[1].zipcode = 99950; cmp_data[1].city = "Ketchikan, Alaska"; @@ -528,82 +528,82 @@ int add_attrs(hid_t oid, int idx) cmp_data[2].city = "Holtsville, New York"; cmp_data[3].zipcode = 61820; cmp_data[3].city = "Champaign, Illinois"; - - /* 1 scalar point */ - sid = H5Screate (H5S_SCALAR); - sprintf(name, "%05d scalar int", idx); - nattrs += add_attr(oid, name, H5T_NATIVE_UINT, sid, &i); - sprintf(name, "%05d scalar ulong", idx); - nattrs += add_attr(oid, name, H5T_NATIVE_INT64, sid, &l); - sprintf(name, "%05d scalar str", idx); - tid = H5Tcopy (H5T_C_S1); + + /* 1 scalar point */ + sid = H5Screate (H5S_SCALAR); + HDsprintf(name, "%05d scalar int", idx); + nattrs += add_attr(oid, name, H5T_NATIVE_UINT, sid, &i); + HDsprintf(name, "%05d scalar ulong", idx); + nattrs += add_attr(oid, name, H5T_NATIVE_INT64, sid, &l); + HDsprintf(name, "%05d scalar str", idx); + tid = H5Tcopy (H5T_C_S1); H5Tset_size (tid, H5T_VARIABLE); - nattrs += add_attr(oid, name, tid, sid, &s[2]); - H5Tclose(tid); - H5Sclose(sid); + nattrs += add_attr(oid, name, tid, sid, &s[2]); + H5Tclose(tid); + H5Sclose(sid); - /* 4 single point */ - sid = H5Screate_simple (1, dims1, NULL); + /* 4 single point */ + sid = H5Screate_simple (1, dims1, NULL); H5Rcreate(&ref, oid, ".", H5R_OBJECT, (hid_t)-1); - sprintf(name, "%05d single float", idx); - nattrs += add_attr(oid, name, H5T_NATIVE_FLOAT, sid, &f); - sprintf(name, "%05d single double", idx); - nattrs += add_attr(oid, name, H5T_NATIVE_DOUBLE, sid, &d); - sprintf(name, "%05d single obj_ref", idx); - nattrs += add_attr(oid, name, H5T_STD_REF_OBJ, sid, &ref); - H5Sclose(sid); - - /* 7 fixed length 1D array */ - sid = H5Screate_simple (1, dims1, NULL); - tid = H5Tarray_create (H5T_NATIVE_FLOAT, 1, dims2); - sprintf(name, "%05d array float", idx); + HDsprintf(name, "%05d single float", idx); + nattrs += add_attr(oid, name, H5T_NATIVE_FLOAT, sid, &f); + HDsprintf(name, "%05d single double", idx); + nattrs += add_attr(oid, name, H5T_NATIVE_DOUBLE, sid, &d); + HDsprintf(name, "%05d single obj_ref", idx); + nattrs += add_attr(oid, name, H5T_STD_REF_OBJ, sid, &ref); + H5Sclose(sid); + + /* 7 fixed length 1D array */ + sid = H5Screate_simple (1, dims1, NULL); + tid = H5Tarray_create (H5T_NATIVE_FLOAT, 1, dims2); + HDsprintf(name, "%05d array float", idx); nattrs += add_attr(oid, name, tid, sid, &f_array[0]); - H5Tclose(tid); - tid = H5Tcopy (H5T_C_S1); - H5Tset_size (tid, strlen(s[0])+1); - tid1 = H5Tarray_create (tid, 1, dims2); - sprintf(name, "%05d array str", idx); - nattrs += add_attr(oid, name, tid1, sid, s); - H5Tclose(tid1); - H5Tclose(tid); - H5Sclose(sid); - - /* 9 fixed length 2D int arrays */ - sid = H5Screate_simple (1, dims2, NULL); - tid = H5Tarray_create (H5T_NATIVE_INT, 2, dims3); - sprintf(name, "%05d array int 2D", idx); + H5Tclose(tid); + tid = H5Tcopy (H5T_C_S1); + H5Tset_size (tid, strlen(s[0])+1); + tid1 = H5Tarray_create (tid, 1, dims2); + HDsprintf(name, "%05d array str", idx); + nattrs += add_attr(oid, name, tid1, sid, s); + H5Tclose(tid1); + H5Tclose(tid); + H5Sclose(sid); + + /* 9 fixed length 2D int arrays */ + sid = H5Screate_simple (1, dims2, NULL); + tid = H5Tarray_create (H5T_NATIVE_INT, 2, dims3); + HDsprintf(name, "%05d array int 2D", idx); nattrs += add_attr(oid, name, tid, sid, int3d[0][0]); - H5Tclose(tid); - H5Sclose(sid); - - /* 10 variable length arrays */ - sid = H5Screate_simple (1, dims2, NULL); - tid = H5Tcopy (H5T_C_S1); - H5Tset_size (tid, H5T_VARIABLE); - sprintf(name, "%05d vlen strings", idx); + H5Tclose(tid); + H5Sclose(sid); + + /* 10 variable length arrays */ + sid = H5Screate_simple (1, dims2, NULL); + tid = H5Tcopy (H5T_C_S1); + H5Tset_size (tid, H5T_VARIABLE); + HDsprintf(name, "%05d vlen strings", idx); nattrs += add_attr(oid, name, tid, sid, s_vlen); - H5Tclose(tid); - tid = H5Tvlen_create (H5T_NATIVE_INT);; - sprintf(name, "%05d vlen int array", idx); + H5Tclose(tid); + tid = H5Tvlen_create (H5T_NATIVE_INT);; + HDsprintf(name, "%05d vlen int array", idx); nattrs += add_attr(oid, name, tid, sid, i_vlen); - H5Tclose(tid); - H5Sclose(sid); - - /* 12 compound data */ - sid = H5Screate_simple (1, dims2, NULL); - tid = H5Tcreate (H5T_COMPOUND, sizeof (zipcode_t)); - tid1 = H5Tcopy (H5T_C_S1); - H5Tset_size (tid1, H5T_VARIABLE); + H5Tclose(tid); + H5Sclose(sid); + + /* 12 compound data */ + sid = H5Screate_simple (1, dims2, NULL); + tid = H5Tcreate (H5T_COMPOUND, sizeof (zipcode_t)); + tid1 = H5Tcopy (H5T_C_S1); + H5Tset_size (tid1, H5T_VARIABLE); H5Tinsert (tid, "zip code", 0, H5T_NATIVE_INT); offset += sizeof(H5T_NATIVE_INT); H5Tinsert (tid, "City", offset, tid1); offset += sizeof(char *); - sprintf(name, "%05d compound data", idx); + HDsprintf(name, "%05d compound data", idx); nattrs += add_attr(oid, name, tid, sid, cmp_data); - H5Tclose(tid1); - H5Tclose(tid); - H5Sclose(sid); - - for (i0=0; i0<4; i0++) - free(i_vlen[i0].p); - - return nattrs; + H5Tclose(tid1); + H5Tclose(tid); + H5Sclose(sid); + + for (i0=0; i0<4; i0++) + free(i_vlen[i0].p); + + return nattrs; } diff --git a/tools/test/misc/talign.c b/tools/test/misc/talign.c index 08ebfc7..7f1f038 100644 --- a/tools/test/misc/talign.c +++ b/tools/test/misc/talign.c @@ -51,14 +51,14 @@ int main(void) int result = 0; herr_t error = 1; - printf("%-70s", "Testing alignment in compound datatypes"); + HDprintf("%-70s", "Testing alignment in compound datatypes"); - strcpy(string5, "Hi!"); + HDstrcpy(string5, "Hi!"); HDunlink(fname); fil = H5Fcreate(fname, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT); if (fil < 0) { - puts("*FAILED*"); + HDputs("*FAILED*"); return 1; } @@ -123,8 +123,8 @@ int main(void) data = (char *)HDmalloc(H5Tget_size(fix)); if(!data) { - perror("malloc() failed"); - abort(); + HDperror("malloc() failed"); + HDabort(); } set = H5Dopen2(fil, setname, H5P_DEFAULT); @@ -136,7 +136,7 @@ int main(void) out: if(error < 0) { result = 1; - puts("*FAILED - HDF5 library error*"); + HDputs("*FAILED - HDF5 library error*"); } else if(!(H5_FLT_ABS_EQUAL(fok[0], fptr[0])) || !(H5_FLT_ABS_EQUAL(fok[1], fptr[1])) || !(H5_FLT_ABS_EQUAL(fnok[0], fptr[2])) @@ -145,7 +145,7 @@ out: result = 1; mname = H5Tget_member_name(fix, 0); - printf("%14s (%2d) %6s = %s\n", + HDprintf("%14s (%2d) %6s = %s\n", mname ? mname : "(null)", (int)H5Tget_member_offset(fix,0), string5, (char *)(data + H5Tget_member_offset(fix, 0))); if(mname) @@ -153,7 +153,7 @@ out: fptr = (float *)((void *)(data + H5Tget_member_offset(fix, 1))); mname = H5Tget_member_name(fix, 1); - printf("Data comparison:\n" + HDprintf("Data comparison:\n" "%14s (%2d) %6f = %f\n" " %6f = %f\n", mname ? mname : "(null)", (int)H5Tget_member_offset(fix,1), @@ -164,7 +164,7 @@ out: fptr = (float *)((void *)(data + H5Tget_member_offset(fix, 2))); mname = H5Tget_member_name(fix, 2); - printf("%14s (%2d) %6f = %f\n" + HDprintf("%14s (%2d) %6f = %f\n" " %6f = %6f\n", mname ? mname : "(null)", (int)H5Tget_member_offset(fix,2), (double)fnok[0], (double)fptr[0], @@ -173,7 +173,7 @@ out: H5free_memory(mname); fptr = (float *)((void *)(data + H5Tget_member_offset(fix, 1))); - printf("\n" + HDprintf("\n" "Short circuit\n" " %6f = %f\n" " %6f = %f\n" @@ -183,9 +183,9 @@ out: (double)fok[1], (double)fptr[1], (double)fnok[0], (double)fptr[2], (double)fnok[1], (double)fptr[3]); - puts("*FAILED - compound type alignmnent problem*"); + HDputs("*FAILED - compound type alignmnent problem*"); } else { - puts(" PASSED"); + HDputs(" PASSED"); } if(data) @@ -200,7 +200,7 @@ out: H5Pclose(plist); H5Fclose(fil); HDunlink(fname); - fflush(stdout); + HDfflush(stdout); return result; } diff --git a/tools/test/perform/CMakeTests.cmake b/tools/test/perform/CMakeTests.cmake index 20e7f59..f0ae416 100644 --- a/tools/test/perform/CMakeTests.cmake +++ b/tools/test/perform/CMakeTests.cmake @@ -53,9 +53,10 @@ add_test ( ) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME PERFORM_h5perf_serial COMMAND $<TARGET_FILE:h5perf_serial>) + add_test (NAME PERFORM_h5perf_serial COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5perf_serial>) else () add_test (NAME PERFORM_h5perf_serial COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5perf_serial>" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" @@ -66,17 +67,20 @@ else () -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () -set_tests_properties (PERFORM_h5perf_serial PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT}) -set_tests_properties (PERFORM_h5perf_serial PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects") +set_tests_properties (PERFORM_h5perf_serial PROPERTIES + TIMEOUT ${CTEST_VERY_LONG_TIMEOUT} + DEPENDS "PERFORM_h5perform-clearall-objects" +) if (HDF5_BUILD_PERFORM_STANDALONE) - add_test (NAME PERFORM_h5perf_serial_alone COMMAND $<TARGET_FILE:h5perf_serial_alone>) + add_test (NAME PERFORM_h5perf_serial_alone COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5perf_serial_alone>) endif () if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME PERFORM_chunk COMMAND $<TARGET_FILE:chunk>) + add_test (NAME PERFORM_chunk COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:chunk>) else () add_test (NAME PERFORM_chunk COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:chunk>" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" @@ -87,12 +91,15 @@ else () -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () -set_tests_properties (PERFORM_chunk PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects") +set_tests_properties (PERFORM_chunk PROPERTIES + DEPENDS "PERFORM_h5perform-clearall-objects" +) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME PERFORM_iopipe COMMAND $<TARGET_FILE:iopipe>) + add_test (NAME PERFORM_iopipe COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:iopipe>) else () add_test (NAME PERFORM_iopipe COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:iopipe>" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" @@ -103,12 +110,15 @@ else () -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () -set_tests_properties (PERFORM_iopipe PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects") +set_tests_properties (PERFORM_iopipe PROPERTIES + DEPENDS "PERFORM_h5perform-clearall-objects" +) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME PERFORM_overhead COMMAND $<TARGET_FILE:overhead>) + add_test (NAME PERFORM_overhead COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:overhead>) else () add_test (NAME PERFORM_overhead COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:overhead>" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" @@ -119,12 +129,15 @@ else () -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () -set_tests_properties (PERFORM_overhead PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects") +set_tests_properties (PERFORM_overhead PROPERTIES + DEPENDS "PERFORM_h5perform-clearall-objects" +) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME PERFORM_perf_meta COMMAND $<TARGET_FILE:perf_meta>) + add_test (NAME PERFORM_perf_meta COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:perf_meta>) else () add_test (NAME PERFORM_perf_meta COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:perf_meta>" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" @@ -135,12 +148,15 @@ else () -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () -set_tests_properties (PERFORM_perf_meta PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects") +set_tests_properties (PERFORM_perf_meta PROPERTIES + DEPENDS "PERFORM_h5perform-clearall-objects" +) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME PERFORM_zip_perf_help COMMAND $<TARGET_FILE:zip_perf> "-h") + add_test (NAME PERFORM_zip_perf_help COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:zip_perf> "-h") else () add_test (NAME PERFORM_zip_perf_help COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:zip_perf>" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" @@ -151,12 +167,15 @@ else () -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () -set_tests_properties (PERFORM_zip_perf_help PROPERTIES DEPENDS "PERFORM_h5perform-clearall-objects") +set_tests_properties (PERFORM_zip_perf_help PROPERTIES + DEPENDS "PERFORM_h5perform-clearall-objects" +) if (HDF5_ENABLE_USING_MEMCHECKER) - add_test (NAME PERFORM_zip_perf COMMAND $<TARGET_FILE:zip_perf> tfilters.h5) + add_test (NAME PERFORM_zip_perf COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:zip_perf> tfilters.h5) else () add_test (NAME PERFORM_zip_perf COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:zip_perf>" -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" @@ -167,7 +186,9 @@ else () -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () -set_tests_properties (PERFORM_zip_perf PROPERTIES DEPENDS "PERFORM_zip_perf_help;PERFORM_h5perform-clearall-objects") +set_tests_properties (PERFORM_zip_perf PROPERTIES + DEPENDS "PERFORM_zip_perf_help;PERFORM_h5perform-clearall-objects" +) if (H5_HAVE_PARALLEL) if (UNIX) diff --git a/tools/test/perform/iopipe.c b/tools/test/perform/iopipe.c index eac099b..2d9c44f 100644 --- a/tools/test/perform/iopipe.c +++ b/tools/test/perform/iopipe.c @@ -224,7 +224,7 @@ main (void) _ftime(tbstart); #endif #endif - fprintf (stderr, HEADING, "fill raw"); + HDfprintf (stderr, HEADING, "fill raw"); for(u = 0; u < nwrite; u++) { putc (PROGRESS, stderr); HDfflush(stderr); @@ -262,7 +262,7 @@ main (void) _ftime(tbstart); #endif #endif - fprintf (stderr, HEADING, "fill hdf5"); + HDfprintf (stderr, HEADING, "fill hdf5"); for(u = 0; u < nread; u++) { putc (PROGRESS, stderr); HDfflush(stderr); @@ -301,7 +301,7 @@ main (void) _ftime(tbstart); #endif #endif - fprintf (stderr, HEADING, "out raw"); + HDfprintf (stderr, HEADING, "out raw"); for(u = 0; u < nwrite; u++) { putc (PROGRESS, stderr); HDfflush(stderr); @@ -341,7 +341,7 @@ main (void) _ftime(tbstart); #endif #endif - fprintf (stderr, HEADING, "out hdf5"); + HDfprintf (stderr, HEADING, "out hdf5"); for(u = 0; u < nwrite; u++) { putc (PROGRESS, stderr); HDfflush(stderr); @@ -380,7 +380,7 @@ main (void) _ftime(tbstart); #endif #endif - fprintf (stderr, HEADING, "in raw"); + HDfprintf (stderr, HEADING, "in raw"); for(u = 0; u < nread; u++) { putc (PROGRESS, stderr); HDfflush(stderr); @@ -421,7 +421,7 @@ main (void) _ftime(tbstart); #endif #endif - fprintf (stderr, HEADING, "in hdf5"); + HDfprintf (stderr, HEADING, "in hdf5"); for(u = 0; u < nread; u++) { putc (PROGRESS, stderr); HDfflush(stderr); @@ -465,7 +465,7 @@ main (void) _ftime(tbstart); #endif #endif - fprintf (stderr, HEADING, "in hdf5 partial"); + HDfprintf (stderr, HEADING, "in hdf5 partial"); for(u = 0; u < nread; u++) { putc (PROGRESS, stderr); HDfflush(stderr); diff --git a/tools/test/perform/overhead.c b/tools/test/perform/overhead.c index 81f9de6..108d9e4 100644 --- a/tools/test/perform/overhead.c +++ b/tools/test/perform/overhead.c @@ -84,9 +84,9 @@ typedef enum fill_t { static void usage(const char *prog) { - fprintf(stderr, "usage: %s [STYLE|cache] [LEFT [MIDDLE [RIGHT]]]\n", + HDfprintf(stderr, "usage: %s [STYLE|cache] [LEFT [MIDDLE [RIGHT]]]\n", prog); - fprintf(stderr, "\ + HDfprintf(stderr, "\ STYLE is the order that the dataset is filled and should be one of:\n\ forward -- Fill the dataset from lowest address to highest\n\ address. This style tests the right split ratio.\n\ @@ -401,6 +401,6 @@ main(int argc, char *argv[]) return 0; error: - fprintf(stderr, "*** ERRORS DETECTED ***\n"); + HDfprintf(stderr, "*** ERRORS DETECTED ***\n"); return 1; } diff --git a/tools/test/perform/perf.c b/tools/test/perform/perf.c index 1d52471..34b8a2d 100644 --- a/tools/test/perform/perf.c +++ b/tools/test/perform/perf.c @@ -64,13 +64,13 @@ #define H5FATAL 1 #define VRFY(val, mesg, fatal) do { \ if (!val) { \ - printf("Proc %d: ", mynod); \ + printf("Proc %d: ", mynod); \ printf("*** Assertion failed (%s) at line %4d in %s\n", \ - mesg, (int)__LINE__, __FILE__); \ - if (fatal){ \ - fflush(stdout); \ - goto die_jar_jar_die; \ - } \ + mesg, (int)__LINE__, __FILE__); \ + if (fatal){ \ + fflush(stdout); \ + goto die_jar_jar_die; \ + } \ } \ } while(0) #define RANK 1 diff --git a/tools/test/perform/perf_meta.c b/tools/test/perform/perf_meta.c index c24e598..b56f074 100644 --- a/tools/test/perform/perf_meta.c +++ b/tools/test/perform/perf_meta.c @@ -313,7 +313,7 @@ create_dsets(hid_t file) * Create a dataset using the default dataset creation properties. */ for(i = 0; i < NUM_DSETS; i++) { - sprintf(dset_name, "dataset %d", i); + HDsprintf(dset_name, "dataset %d", i); if((dataset = H5Dcreate2(file, dset_name, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) goto error; @@ -378,14 +378,14 @@ create_attrs_1(void) * Create all(user specifies the number) attributes for each dataset */ for(i = 0; i < NUM_DSETS; i++) { - sprintf(dset_name, "dataset %d", i); + HDsprintf(dset_name, "dataset %d", i); open_t.start = retrieve_time(); if((dataset = H5Dopen2(file, dset_name, H5P_DEFAULT)) < 0) goto error; perf(&open_t, open_t.start, retrieve_time()); for(j = 0; j < NUM_ATTRS; j++) { - sprintf(attr_name, "all attrs for each dset %d", j); + HDsprintf(attr_name, "all attrs for each dset %d", j); attr_t.start = retrieve_time(); if((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE, small_space, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -422,7 +422,7 @@ create_attrs_1(void) attr_t.avg = attr_t.total / (NUM_ATTRS*NUM_DSETS); /* Print out the performance result */ - fprintf(stderr, "1. Create %d attributes for each of %d existing datasets\n", + HDfprintf(stderr, "1. Create %d attributes for each of %d existing datasets\n", NUM_ATTRS, NUM_DSETS); print_perf(open_t, close_t, attr_t); } @@ -480,7 +480,7 @@ create_attrs_2(void) * Create all(user specifies the number) attributes for each new dataset */ for(i = 0; i < NUM_DSETS; i++) { - sprintf(dset_name, "dataset %d", i); + HDsprintf(dset_name, "dataset %d", i); create_t.start = retrieve_time(); if((dataset = H5Dcreate2(file, dset_name, H5T_NATIVE_DOUBLE, space, H5P_DEFAULT, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -488,7 +488,7 @@ create_attrs_2(void) perf(&create_t, create_t.start, retrieve_time()); for(j = 0; j < NUM_ATTRS; j++) { - sprintf(attr_name, "all attrs for each dset %d", j); + HDsprintf(attr_name, "all attrs for each dset %d", j); attr_t.start = retrieve_time(); if((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE, small_space, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -525,7 +525,7 @@ create_attrs_2(void) attr_t.avg = attr_t.total / (NUM_ATTRS*NUM_DSETS); /* Print out the performance result */ - fprintf(stderr, "2. Create %d attributes for each of %d new datasets\n", + HDfprintf(stderr, "2. Create %d attributes for each of %d new datasets\n", NUM_ATTRS, NUM_DSETS); print_perf(create_t, close_t, attr_t); } @@ -593,14 +593,14 @@ create_attrs_3(void) for(i = 0; i < loop_num; i++) { for(j = 0; j < NUM_DSETS; j++) { - sprintf(dset_name, "dataset %d", j); + HDsprintf(dset_name, "dataset %d", j); open_t.start = retrieve_time(); if((dataset = H5Dopen2(file, dset_name, H5P_DEFAULT)) < 0) goto error; perf(&open_t, open_t.start, retrieve_time()); for(k = 0; k < BATCH_ATTRS; k++) { - sprintf(attr_name, "some attrs for each dset %d %d", i, k); + HDsprintf(attr_name, "some attrs for each dset %d %d", i, k); attr_t.start = retrieve_time(); if((attr = H5Acreate2(dataset, attr_name, H5T_NATIVE_DOUBLE, small_space, H5P_DEFAULT, H5P_DEFAULT)) < 0) @@ -637,7 +637,7 @@ create_attrs_3(void) attr_t.avg = attr_t.total / (NUM_ATTRS*NUM_DSETS); /* Print out the performance result */ - fprintf(stderr, "3. Create %d attributes for each of %d existing datasets for %d times\n", + HDfprintf(stderr, "3. Create %d attributes for each of %d existing datasets for %d times\n", BATCH_ATTRS, NUM_DSETS, loop_num); print_perf(open_t, close_t, attr_t); } @@ -750,12 +750,12 @@ void perf(p_time *perf_t, double start_t, double end_t) */ void print_perf(p_time open_t, p_time close_t, p_time attr_t) { - fprintf(stderr, "\t%s:\t\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n", + HDfprintf(stderr, "\t%s:\t\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n", open_t.func, open_t.avg, open_t.max, open_t.min); - fprintf(stderr, "\tH5Dclose:\t\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n", + HDfprintf(stderr, "\tH5Dclose:\t\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n", close_t.avg, close_t.max, close_t.min); if(NUM_ATTRS) - fprintf(stderr, "\tH5A(create & close):\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n", + HDfprintf(stderr, "\tH5A(create & close):\tavg=%.6fs;\tmax=%.6fs;\tmin=%.6fs\n", attr_t.avg, attr_t.max, attr_t.min); } @@ -799,7 +799,7 @@ main(int argc, char **argv) #ifdef H5_HAVE_PARALLEL if (facc_type == FACC_DEFAULT || (facc_type != FACC_DEFAULT && MAINPROCESS)) #endif /*H5_HAVE_PARALLEL*/ - fprintf(stderr, "\t\tPerformance result of metadata for datasets and attributes\n\n"); + HDfprintf(stderr, "\t\tPerformance result of metadata for datasets and attributes\n\n"); fapl = H5Pcreate (H5P_FILE_ACCESS); #ifdef H5_HAVE_PARALLEL diff --git a/tools/test/perform/pio_engine.c b/tools/test/perform/pio_engine.c index d47cd43..77c04ab 100644 --- a/tools/test/perform/pio_engine.c +++ b/tools/test/perform/pio_engine.c @@ -61,14 +61,14 @@ #define GOTOERROR(errcode) { ret_code = errcode; goto done; } #define GOTODONE { goto done; } #define ERRMSG(mesg) { \ - fprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \ - fprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", \ + HDfprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \ + HDfprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", \ mesg, (int)__LINE__, __FILE__); \ } #define MSG(mesg) { \ - fprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \ - fprintf(stderr, "(%s) at line %4d in %s\n", \ + HDfprintf(stderr, "Proc %d: ", pio_mpi_rank_g); \ + HDfprintf(stderr, "(%s) at line %4d in %s\n", \ mesg, (int)__LINE__, __FILE__); \ } @@ -194,7 +194,7 @@ do_pio(parameters param) break; default: /* unknown request */ - fprintf(stderr, "Unknown IO type request (%d)\n", iot); + HDfprintf(stderr, "Unknown IO type request (%d)\n", iot); GOTOERROR(FAIL); } @@ -213,21 +213,21 @@ do_pio(parameters param) } if (param.num_files < 0 ) { - fprintf(stderr, + HDfprintf(stderr, "number of files must be >= 0 (%ld)\n", param.num_files); GOTOERROR(FAIL); } if (ndsets < 0 ) { - fprintf(stderr, + HDfprintf(stderr, "number of datasets per file must be >= 0 (%ld)\n", ndsets); GOTOERROR(FAIL); } if (param.num_procs <= 0 ) { - fprintf(stderr, + HDfprintf(stderr, "maximum number of process to use must be > 0 (%d)\n", param.num_procs); GOTOERROR(FAIL); @@ -292,7 +292,7 @@ do_pio(parameters param) /* output all of the times for all iterations */ if (myrank == 0) - fprintf(output, "Timer details:\n"); + HDfprintf(output, "Timer details:\n"); } for (nf = 1; nf <= param.num_files; nf++) { @@ -302,7 +302,7 @@ do_pio(parameters param) /* Open file for write */ char base_name[256]; - sprintf(base_name, "#pio_tmp_%lu", nf); + HDsprintf(base_name, "#pio_tmp_%lu", nf); pio_create_filename(iot, base_name, fname, sizeof(fname)); if (pio_debug_level > 0) HDfprintf(output, "rank %d: data filename=%s\n", @@ -311,21 +311,21 @@ do_pio(parameters param) /* Need barrier to make sure everyone starts at the same time */ MPI_Barrier(pio_comm_g); - set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART); + io_time_set(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART); hrc = do_fopen(¶m, fname, &fd, PIO_CREATE | PIO_WRITE); VRFY((hrc == SUCCESS), "do_fopen failed"); - set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART); + io_time_set(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART); hrc = do_write(&res, &fd, ¶m, ndsets, nbytes, buf_size, buffer); - set_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP); + io_time_set(res.timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_write failed"); /* Close file for write */ hrc = do_fclose(iot, &fd); - set_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP); + io_time_set(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_fclose failed"); if (!param.h5_write_only) { @@ -339,20 +339,20 @@ do_pio(parameters param) MPI_Barrier(pio_comm_g); /* Open file for read */ - set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART); + io_time_set(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART); hrc = do_fopen(¶m, fname, &fd, PIO_READ); VRFY((hrc == SUCCESS), "do_fopen failed"); - set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTART); + io_time_set(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTART); hrc = do_read(&res, &fd, ¶m, ndsets, nbytes, buf_size, buffer); - set_time(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP); + io_time_set(res.timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_read failed"); /* Close file for read */ hrc = do_fclose(iot, &fd); - set_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP); + io_time_set(res.timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_fclose failed"); } @@ -385,7 +385,7 @@ done: /* release generic resources */ if(buffer) - free(buffer); + HDfree(buffer); res.ret_code = ret_code; return res; } @@ -620,7 +620,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, /* Prepare buffer for verifying data */ if (parms->verify) - memset(buffer,pio_mpi_rank_g+1,buf_size*blk_size); + HDmemset(buffer,pio_mpi_rank_g+1,buf_size*blk_size); } /* end else */ @@ -853,7 +853,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, /* Create the dataset transfer property list */ h5dxpl = H5Pcreate(H5P_DATASET_XFER); if (h5dxpl < 0) { - fprintf(stderr, "HDF5 Property List Create failed\n"); + HDfprintf(stderr, "HDF5 Property List Create failed\n"); GOTOERROR(FAIL); } @@ -861,7 +861,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, if(parms->collective) { hrc = H5Pset_dxpl_mpio(h5dxpl, H5FD_MPIO_COLLECTIVE); if (hrc < 0) { - fprintf(stderr, "HDF5 Property List Set failed\n"); + HDfprintf(stderr, "HDF5 Property List Set failed\n"); GOTOERROR(FAIL); } /* end if */ } /* end if */ @@ -883,7 +883,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, case PHDF5: h5dcpl = H5Pcreate(H5P_DATASET_CREATE); if (h5dcpl < 0) { - fprintf(stderr, "HDF5 Property List Create failed\n"); + HDfprintf(stderr, "HDF5 Property List Create failed\n"); GOTOERROR(FAIL); } /* 1D dataspace */ @@ -894,7 +894,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, h5dims[0] = blk_size; hrc = H5Pset_chunk(h5dcpl, 1, h5dims); if (hrc < 0) { - fprintf(stderr, "HDF5 Property List Set failed\n"); + HDfprintf(stderr, "HDF5 Property List Set failed\n"); GOTOERROR(FAIL); } /* end if */ } /* end if */ @@ -907,25 +907,25 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, h5dims[1] = blk_size; hrc = H5Pset_chunk(h5dcpl, 2, h5dims); if (hrc < 0) { - fprintf(stderr, "HDF5 Property List Set failed\n"); + HDfprintf(stderr, "HDF5 Property List Set failed\n"); GOTOERROR(FAIL); } /* end if */ } /* end if */ }/* end else */ - sprintf(dname, "Dataset_%ld", ndset); + HDsprintf(dname, "Dataset_%ld", ndset); h5ds_id = H5DCREATE(fd->h5fd, dname, ELMT_H5_TYPE, h5dset_space_id, h5dcpl); if (h5ds_id < 0) { - fprintf(stderr, "HDF5 Dataset Create failed\n"); + HDfprintf(stderr, "HDF5 Dataset Create failed\n"); GOTOERROR(FAIL); } hrc = H5Pclose(h5dcpl); /* verifying the close of the dcpl */ if (hrc < 0) { - fprintf(stderr, "HDF5 Property List Close failed\n"); + HDfprintf(stderr, "HDF5 Property List Close failed\n"); GOTOERROR(FAIL); } break; @@ -958,7 +958,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end else */ /* Start "raw data" write timer */ - set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART); + io_time_set(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART); while (nbytes_xfer < bytes_count){ /* Write */ @@ -1389,7 +1389,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end while */ /* Stop "raw data" write timer */ - set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP); + io_time_set(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP); /* Calculate write time */ @@ -1398,7 +1398,7 @@ do_write(results *res, file_descr *fd, parameters *parms, long ndsets, hrc = H5Dclose(h5ds_id); if (hrc < 0) { - fprintf(stderr, "HDF5 Dataset Close failed\n"); + HDfprintf(stderr, "HDF5 Dataset Close failed\n"); GOTOERROR(FAIL); } @@ -1455,7 +1455,7 @@ done: if (h5dset_space_id != -1) { hrc = H5Sclose(h5dset_space_id); if (hrc < 0){ - fprintf(stderr, "HDF5 Dataset Space Close failed\n"); + HDfprintf(stderr, "HDF5 Dataset Space Close failed\n"); ret_code = FAIL; } else { h5dset_space_id = -1; @@ -1465,7 +1465,7 @@ done: if (h5mem_space_id != -1) { hrc = H5Sclose(h5mem_space_id); if (hrc < 0) { - fprintf(stderr, "HDF5 Memory Space Close failed\n"); + HDfprintf(stderr, "HDF5 Memory Space Close failed\n"); ret_code = FAIL; } else { h5mem_space_id = -1; @@ -1475,7 +1475,7 @@ done: if (h5dxpl != -1) { hrc = H5Pclose(h5dxpl); if (hrc < 0) { - fprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n"); + HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n"); ret_code = FAIL; } else { h5dxpl = -1; @@ -1824,7 +1824,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, /* Create the dataset transfer property list */ h5dxpl = H5Pcreate(H5P_DATASET_XFER); if (h5dxpl < 0) { - fprintf(stderr, "HDF5 Property List Create failed\n"); + HDfprintf(stderr, "HDF5 Property List Create failed\n"); GOTOERROR(FAIL); } @@ -1832,7 +1832,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, if(parms->collective) { hrc = H5Pset_dxpl_mpio(h5dxpl, H5FD_MPIO_COLLECTIVE); if (hrc < 0) { - fprintf(stderr, "HDF5 Property List Set failed\n"); + HDfprintf(stderr, "HDF5 Property List Set failed\n"); GOTOERROR(FAIL); } /* end if */ } /* end if */ @@ -1852,10 +1852,10 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, break; case PHDF5: - sprintf(dname, "Dataset_%ld", ndset); + HDsprintf(dname, "Dataset_%ld", ndset); h5ds_id = H5DOPEN(fd->h5fd, dname); if (h5ds_id < 0) { - fprintf(stderr, "HDF5 Dataset open failed\n"); + HDfprintf(stderr, "HDF5 Dataset open failed\n"); GOTOERROR(FAIL); } @@ -1889,7 +1889,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end else */ /* Start "raw data" read timer */ - set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART); + io_time_set(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART); while (nbytes_xfer < bytes_count){ /* Read */ @@ -2344,7 +2344,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, } /* end while */ /* Stop "raw data" read timer */ - set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP); + io_time_set(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP); /* Calculate read time */ @@ -2353,7 +2353,7 @@ do_read(results *res, file_descr *fd, parameters *parms, long ndsets, hrc = H5Dclose(h5ds_id); if (hrc < 0) { - fprintf(stderr, "HDF5 Dataset Close failed\n"); + HDfprintf(stderr, "HDF5 Dataset Close failed\n"); GOTOERROR(FAIL); } @@ -2410,7 +2410,7 @@ done: if (h5dset_space_id != -1) { hrc = H5Sclose(h5dset_space_id); if (hrc < 0){ - fprintf(stderr, "HDF5 Dataset Space Close failed\n"); + HDfprintf(stderr, "HDF5 Dataset Space Close failed\n"); ret_code = FAIL; } else { h5dset_space_id = -1; @@ -2420,7 +2420,7 @@ done: if (h5mem_space_id != -1) { hrc = H5Sclose(h5mem_space_id); if (hrc < 0) { - fprintf(stderr, "HDF5 Memory Space Close failed\n"); + HDfprintf(stderr, "HDF5 Memory Space Close failed\n"); ret_code = FAIL; } else { h5mem_space_id = -1; @@ -2430,7 +2430,7 @@ done: if (h5dxpl != -1) { hrc = H5Pclose(h5dxpl); if (hrc < 0) { - fprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n"); + HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n"); ret_code = FAIL; } else { h5dxpl = -1; @@ -2461,7 +2461,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) fd->posixfd = POSIXOPEN(fname, O_RDONLY); if (fd->posixfd < 0 ) { - fprintf(stderr, "POSIX File Open failed(%s)\n", fname); + HDfprintf(stderr, "POSIX File Open failed(%s)\n", fname); GOTOERROR(FAIL); } @@ -2485,7 +2485,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) h5_io_info_g, &fd->mpifd); if (mrc != MPI_SUCCESS) { - fprintf(stderr, "MPI File Open failed(%s)\n", fname); + HDfprintf(stderr, "MPI File Open failed(%s)\n", fname); GOTOERROR(FAIL); } @@ -2493,13 +2493,13 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) /*filesize , set size to 0 explicitedly. */ mrc = MPI_File_set_size(fd->mpifd, (MPI_Offset)0); if (mrc != MPI_SUCCESS) { - fprintf(stderr, "MPI_File_set_size failed\n"); + HDfprintf(stderr, "MPI_File_set_size failed\n"); GOTOERROR(FAIL); } } else { mrc = MPI_File_open(pio_comm_g, fname, MPI_MODE_RDONLY, h5_io_info_g, &fd->mpifd); if (mrc != MPI_SUCCESS) { - fprintf(stderr, "MPI File Open failed(%s)\n", fname); + HDfprintf(stderr, "MPI File Open failed(%s)\n", fname); GOTOERROR(FAIL); } } @@ -2508,19 +2508,19 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) case PHDF5: if ((acc_tpl = H5Pcreate(H5P_FILE_ACCESS)) < 0) { - fprintf(stderr, "HDF5 Property List Create failed\n"); + HDfprintf(stderr, "HDF5 Property List Create failed\n"); GOTOERROR(FAIL); } /* Set the file driver to the MPI-IO driver */ if (H5Pset_fapl_mpio(acc_tpl, pio_comm_g, h5_io_info_g) < 0) { - fprintf(stderr, "HDF5 Property List Set failed\n"); + HDfprintf(stderr, "HDF5 Property List Set failed\n"); GOTOERROR(FAIL); } /* Set the alignment of objects in HDF5 file */ if (H5Pset_alignment(acc_tpl, param->h5_thresh, param->h5_align) < 0) { - fprintf(stderr, "HDF5 Property List Set failed\n"); + HDfprintf(stderr, "HDF5 Property List Set failed\n"); GOTOERROR(FAIL); } @@ -2530,13 +2530,13 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) else fd->h5fd = H5Fopen(fname, H5F_ACC_RDONLY, acc_tpl); if (fd->h5fd < 0) { - fprintf(stderr, "HDF5 File Create failed(%s)\n", fname); + HDfprintf(stderr, "HDF5 File Create failed(%s)\n", fname); GOTOERROR(FAIL); } /* verifying the close of the acc_tpl */ if (H5Pclose(acc_tpl) < 0) { - fprintf(stderr, "HDF5 Property List Close failed\n"); + HDfprintf(stderr, "HDF5 Property List Close failed\n"); GOTOERROR(FAIL); } @@ -2565,7 +2565,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/) rc = POSIXCLOSE(fd->posixfd); if (rc != 0){ - fprintf(stderr, "POSIX File Close failed\n"); + HDfprintf(stderr, "POSIX File Close failed\n"); GOTOERROR(FAIL); } @@ -2576,7 +2576,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/) mrc = MPI_File_close(&fd->mpifd); if (mrc != MPI_SUCCESS){ - fprintf(stderr, "MPI File close failed\n"); + HDfprintf(stderr, "MPI File close failed\n"); GOTOERROR(FAIL); } @@ -2587,7 +2587,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/) hrc = H5Fclose(fd->h5fd); if (hrc < 0) { - fprintf(stderr, "HDF5 File Close failed\n"); + HDfprintf(stderr, "HDF5 File Close failed\n"); GOTOERROR(FAIL); } @@ -2621,7 +2621,7 @@ do_cleanupfile(iotype iot, char *fname) if (clean_file_g){ switch (iot){ case POSIXIO: - remove(fname); + HDremove(fname); break; case MPIO: case PHDF5: @@ -2639,9 +2639,9 @@ int MPI_File_read_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { int err; - set_time(timer_g, HDF5_MPI_READ, TSTART); + io_time_set(timer_g, HDF5_MPI_READ, TSTART); err=PMPI_File_read_at(fh, offset, buf, count, datatype, status); - set_time(timer_g, HDF5_MPI_READ, TSTOP); + io_time_set(timer_g, HDF5_MPI_READ, TSTOP); return err; } @@ -2650,9 +2650,9 @@ int MPI_File_read_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { int err; - set_time(timer_g, HDF5_MPI_READ, TSTART); + io_time_set(timer_g, HDF5_MPI_READ, TSTART); err=PMPI_File_read_at_all(fh, offset, buf, count, datatype, status); - set_time(timer_g, HDF5_MPI_READ, TSTOP); + io_time_set(timer_g, HDF5_MPI_READ, TSTOP); return err; } @@ -2660,9 +2660,9 @@ int MPI_File_write_at(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { int err; - set_time(timer_g, HDF5_MPI_WRITE, TSTART); + io_time_set(timer_g, HDF5_MPI_WRITE, TSTART); err=PMPI_File_write_at(fh, offset, buf, count, datatype, status); - set_time(timer_g, HDF5_MPI_WRITE, TSTOP); + io_time_set(timer_g, HDF5_MPI_WRITE, TSTOP); return err; } @@ -2670,9 +2670,9 @@ int MPI_File_write_at_all(MPI_File fh, MPI_Offset offset, void *buf, int count, MPI_Datatype datatype, MPI_Status *status) { int err; - set_time(timer_g, HDF5_MPI_WRITE, TSTART); + io_time_set(timer_g, HDF5_MPI_WRITE, TSTART); err=PMPI_File_write_at_all(fh, offset, buf, count, datatype, status); - set_time(timer_g, HDF5_MPI_WRITE, TSTOP); + io_time_set(timer_g, HDF5_MPI_WRITE, TSTOP); return err; } diff --git a/tools/test/perform/pio_perf.c b/tools/test/perform/pio_perf.c index 597629e..9f4d116 100644 --- a/tools/test/perform/pio_perf.c +++ b/tools/test/perform/pio_perf.c @@ -277,13 +277,13 @@ struct options { unsigned interleaved; /* Interleaved vs. contiguous blocks */ unsigned collective; /* Collective vs. independent I/O */ unsigned dim2d; /* 1D vs. 2D geometry */ - int print_times; /* print times as well as throughputs */ - int print_raw; /* print raw data throughput info */ + int print_times; /* print times as well as throughputs */ + int print_raw; /* print raw data throughput info */ off_t h5_alignment; /* alignment in HDF5 file */ off_t h5_threshold; /* threshold for alignment in HDF5 file */ - int h5_use_chunks; /* Make HDF5 dataset chunked */ - int h5_write_only; /* Perform the write tests only */ - int verify; /* Verify data correctness */ + int h5_use_chunks; /* Make HDF5 dataset chunked */ + int h5_write_only; /* Perform the write tests only */ + int verify; /* Verify data correctness */ }; typedef struct _minmax { @@ -339,12 +339,12 @@ main(int argc, char **argv) ret = MPI_Comm_size(MPI_COMM_WORLD, &comm_world_nprocs_g); if (ret != MPI_SUCCESS) { - fprintf(stderr, "%s: MPI_Comm_size call failed\n", progname); + HDfprintf(stderr, "%s: MPI_Comm_size call failed\n", progname); if (ret == MPI_ERR_COMM) - fprintf(stderr, "invalid MPI communicator\n"); + HDfprintf(stderr, "invalid MPI communicator\n"); else - fprintf(stderr, "invalid argument\n"); + HDfprintf(stderr, "invalid argument\n"); exit_value = EXIT_FAILURE; goto finish; @@ -353,12 +353,12 @@ main(int argc, char **argv) ret = MPI_Comm_rank(MPI_COMM_WORLD, &comm_world_rank_g); if (ret != MPI_SUCCESS) { - fprintf(stderr, "%s: MPI_Comm_rank call failed\n", progname); + HDfprintf(stderr, "%s: MPI_Comm_rank call failed\n", progname); if (ret == MPI_ERR_COMM) - fprintf(stderr, "invalid MPI communicator\n"); + HDfprintf(stderr, "invalid MPI communicator\n"); else - fprintf(stderr, "invalid argument\n"); + HDfprintf(stderr, "invalid argument\n"); exit_value = EXIT_FAILURE; goto finish; @@ -376,7 +376,7 @@ main(int argc, char **argv) if (opts->output_file) { if ((output = HDfopen(opts->output_file, "w")) == NULL) { - fprintf(stderr, "%s: cannot open output file\n", progname); + HDfprintf(stderr, "%s: cannot open output file\n", progname); perror(opts->output_file); goto finish; } @@ -587,74 +587,74 @@ run_test(iotype iot, parameters parms, struct options *opts) res = do_pio(parms); /* gather all of the "mpi write" times */ - t = get_time(res.timers, HDF5_MPI_WRITE); + t = io_time_get(res.timers, HDF5_MPI_WRITE); get_minmax(&write_mpi_mm, t); write_mpi_mm_table[i] = write_mpi_mm; /* gather all of the "write" times */ - t = get_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS); + t = io_time_get(res.timers, HDF5_FINE_WRITE_FIXED_DIMS); get_minmax(&write_mm, t); write_mm_table[i] = write_mm; /* gather all of the "write" times from open to close */ - t = get_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS); + t = io_time_get(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS); get_minmax(&write_gross_mm, t); write_gross_mm_table[i] = write_gross_mm; /* gather all of the raw "write" times */ - t = get_time(res.timers, HDF5_RAW_WRITE_FIXED_DIMS); + t = io_time_get(res.timers, HDF5_RAW_WRITE_FIXED_DIMS); get_minmax(&write_raw_mm, t); write_raw_mm_table[i] = write_raw_mm; /* gather all of the file open times (time from open to first write) */ - t = get_time(res.timers, HDF5_FILE_WRITE_OPEN); + t = io_time_get(res.timers, HDF5_FILE_WRITE_OPEN); get_minmax(&write_open_mm, t); write_open_mm_table[i] = write_open_mm; /* gather all of the file close times (time from last write to close) */ - t = get_time(res.timers, HDF5_FILE_WRITE_CLOSE); + t = io_time_get(res.timers, HDF5_FILE_WRITE_CLOSE); get_minmax(&write_close_mm, t); write_close_mm_table[i] = write_close_mm; if (!parms.h5_write_only) { /* gather all of the "mpi read" times */ - t = get_time(res.timers, HDF5_MPI_READ); + t = io_time_get(res.timers, HDF5_MPI_READ); get_minmax(&read_mpi_mm, t); read_mpi_mm_table[i] = read_mpi_mm; /* gather all of the "read" times */ - t = get_time(res.timers, HDF5_FINE_READ_FIXED_DIMS); + t = io_time_get(res.timers, HDF5_FINE_READ_FIXED_DIMS); get_minmax(&read_mm, t); read_mm_table[i] = read_mm; /* gather all of the "read" times from open to close */ - t = get_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS); + t = io_time_get(res.timers, HDF5_GROSS_READ_FIXED_DIMS); get_minmax(&read_gross_mm, t); read_gross_mm_table[i] = read_gross_mm; /* gather all of the raw "read" times */ - t = get_time(res.timers, HDF5_RAW_READ_FIXED_DIMS); + t = io_time_get(res.timers, HDF5_RAW_READ_FIXED_DIMS); get_minmax(&read_raw_mm, t); read_raw_mm_table[i] = read_raw_mm; /* gather all of the file open times (time from open to first read) */ - t = get_time(res.timers, HDF5_FILE_READ_OPEN); + t = io_time_get(res.timers, HDF5_FILE_READ_OPEN); get_minmax(&read_open_mm, t); read_open_mm_table[i] = read_open_mm; /* gather all of the file close times (time from last read to close) */ - t = get_time(res.timers, HDF5_FILE_READ_CLOSE); + t = io_time_get(res.timers, HDF5_FILE_READ_CLOSE); get_minmax(&read_close_mm, t); read_close_mm_table[i] = read_close_mm; @@ -667,7 +667,7 @@ run_test(iotype iot, parameters parms, struct options *opts) /* * Show various statistics */ - /* Write statistics */ + /* Write statistics */ /* Print the raw data throughput if desired */ if (opts->print_raw) { /* accumulate and output the max, min, and average "raw write" times */ @@ -733,7 +733,7 @@ run_test(iotype iot, parameters parms, struct options *opts) } if (!parms.h5_write_only) { - /* Read statistics */ + /* Read statistics */ /* Print the raw data throughput if desired */ if (opts->print_raw) { /* accumulate and output the max, min, and average "raw read" times */ @@ -925,7 +925,7 @@ create_comm_world(int num_procs, int *doing_pio) MPI_Comm_size(MPI_COMM_WORLD, &nprocs); if (num_procs > nprocs) { - fprintf(stderr, + HDfprintf(stderr, "number of process(%d) must be <= number of processes in MPI_COMM_WORLD(%d)\n", num_procs, nprocs); goto error_done; @@ -936,7 +936,7 @@ create_comm_world(int num_procs, int *doing_pio) mrc = MPI_Comm_split(MPI_COMM_WORLD, color, myrank, &pio_comm_g); if (mrc != MPI_SUCCESS) { - fprintf(stderr, "MPI_Comm_split failed\n"); + HDfprintf(stderr, "MPI_Comm_split failed\n"); goto error_done; } @@ -1065,9 +1065,9 @@ output_report(const char *fmt, ...) if (myrank == 0) { va_list ap; - va_start(ap, fmt); - vfprintf(output, fmt, ap); - va_end(ap); + HDva_start(ap, fmt); + HDvfprintf(output, fmt, ap); + HDva_end(ap); } } @@ -1087,10 +1087,10 @@ print_indent(register int indent) MPI_Comm_rank(pio_comm_g, &myrank); if (myrank == 0) { - indent *= TAB_SPACE; + indent *= TAB_SPACE; - for (; indent > 0; --indent) - fputc(' ', output); + for (; indent > 0; --indent) + HDfputc(' ', output); } } @@ -1115,11 +1115,11 @@ static void print_io_api(long io_types) { if (io_types & PIO_POSIX) - HDfprintf(output, "posix "); + HDfprintf(output, "posix "); if (io_types & PIO_MPI) - HDfprintf(output, "mpiio "); + HDfprintf(output, "mpiio "); if (io_types & PIO_HDF5) - HDfprintf(output, "phdf5 "); + HDfprintf(output, "phdf5 "); HDfprintf(output, "\n"); } @@ -1128,7 +1128,7 @@ report_parameters(struct options *opts) { int rank = comm_world_rank_g; - print_version("HDF5 Library"); /* print library version */ + print_version("HDF5 Library"); /* print library version */ HDfprintf(output, "rank %d: ==== Parameters ====\n", rank); HDfprintf(output, "rank %d: IO API=", rank); @@ -1303,9 +1303,9 @@ parse_command_line(int argc, char *argv[]) } else if (!HDstrcasecmp(buf, "posix")) { cl_opts->io_types |= PIO_POSIX; } else { - fprintf(stderr, "pio_perf: invalid --api option %s\n", + HDfprintf(stderr, "pio_perf: invalid --api option %s\n", buf); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } if (*end == '\0') @@ -1345,17 +1345,17 @@ parse_command_line(int argc, char *argv[]) HDmemset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) - if (isalnum(*end) && i < 10) + if (HDisalnum(*end) && i < 10) buf[i++] = *end; - if (strlen(buf) > 1 || isdigit(buf[0])) { + if (HDstrlen(buf) > 1 || HDisdigit(buf[0])) { size_t j; for (j = 0; j < 10 && buf[j] != '\0'; ++j) if (!isdigit(buf[j])) { - fprintf(stderr, "pio_perf: invalid --debug option %s\n", + HDfprintf(stderr, "pio_perf: invalid --debug option %s\n", buf); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } pio_debug_level = atoi(buf); @@ -1379,8 +1379,8 @@ parse_command_line(int argc, char *argv[]) cl_opts->verify = TRUE; break; default: - fprintf(stderr, "pio_perf: invalid --debug option %s\n", buf); - exit(EXIT_FAILURE); + HDfprintf(stderr, "pio_perf: invalid --debug option %s\n", buf); + HDexit(EXIT_FAILURE); } } @@ -1396,13 +1396,13 @@ parse_command_line(int argc, char *argv[]) cl_opts->num_bpp = parse_size_directive(opt_arg); break; case 'F': - cl_opts->num_files = atoi(opt_arg); + cl_opts->num_files = HDatoi(opt_arg); break; case 'g': cl_opts->dim2d = 1; break; case 'i': - cl_opts->num_iters = atoi(opt_arg); + cl_opts->num_iters = HDatoi(opt_arg); break; case 'I': cl_opts->interleaved = 1; @@ -1411,10 +1411,10 @@ parse_command_line(int argc, char *argv[]) cl_opts->output_file = opt_arg; break; case 'p': - cl_opts->min_num_procs = atoi(opt_arg); + cl_opts->min_num_procs = HDatoi(opt_arg); break; case 'P': - cl_opts->max_num_procs = atoi(opt_arg); + cl_opts->max_num_procs = HDatoi(opt_arg); break; case 'T': cl_opts->h5_threshold = parse_size_directive(opt_arg); @@ -1432,7 +1432,7 @@ parse_command_line(int argc, char *argv[]) case '?': default: usage(progname); - free(cl_opts); + HDfree(cl_opts); return NULL; } } @@ -1526,8 +1526,8 @@ parse_size_directive(const char *size) s *= ONE_GB; break; default: - fprintf(stderr, "Illegal size specifier '%c'\n", *endptr); - exit(EXIT_FAILURE); + HDfprintf(stderr, "Illegal size specifier '%c'\n", *endptr); + HDexit(EXIT_FAILURE); } } @@ -1540,7 +1540,7 @@ parse_size_directive(const char *size) * Return: Nothing * Programmer: Bill Wendling, 31. October 2001 * Modifications: - * Added 2D testing (Christian Chilan, 10. August 2005) + * Added 2D testing (Christian Chilan, 10. August 2005) */ static void usage(const char *prog) @@ -1550,125 +1550,125 @@ usage(const char *prog) MPI_Comm_rank(pio_comm_g, &myrank); if (myrank == 0) { - print_version(prog); - printf("usage: %s [OPTIONS]\n", prog); - printf(" OPTIONS\n"); - printf(" -h, --help Print a usage message and exit\n"); - printf(" -a S, --align=S Alignment of objects in HDF5 file [default: 1]\n"); - printf(" -A AL, --api=AL Which APIs to test [default: all of them]\n"); + print_version(prog); + HDprintf("usage: %s [OPTIONS]\n", prog); + HDprintf(" OPTIONS\n"); + HDprintf(" -h, --help Print a usage message and exit\n"); + HDprintf(" -a S, --align=S Alignment of objects in HDF5 file [default: 1]\n"); + HDprintf(" -A AL, --api=AL Which APIs to test [default: all of them]\n"); #if 0 - printf(" -b, --binary The elusive binary option\n"); + HDprintf(" -b, --binary The elusive binary option\n"); #endif /* 0 */ - printf(" -B S, --block-size=S Block size within transfer buffer\n"); - printf(" (see below for description)\n"); - printf(" [default: half the number of bytes per process\n"); - printf(" per dataset]\n"); - printf(" -c, --chunk Create HDF5 datasets using chunked storage\n"); - printf(" [default: contiguous storage]\n"); - printf(" -C, --collective Use collective I/O for MPI and HDF5 APIs\n"); - printf(" [default: independent I/O)\n"); - printf(" -d N, --num-dsets=N Number of datasets per file [default: 1]\n"); - printf(" -D DL, --debug=DL Indicate the debugging level\n"); - printf(" [default: no debugging]\n"); - printf(" -e S, --num-bytes=S Number of bytes per process per dataset\n"); - printf(" (see below for description)\n"); - printf(" [default: 256K for 1D, 8K for 2D]\n"); - printf(" -F N, --num-files=N Number of files [default: 1]\n"); - printf(" -g, --geometry Use 2D geometry [default: 1D geometry]\n"); - printf(" -i N, --num-iterations=N Number of iterations to perform [default: 1]\n"); - printf(" -I, --interleaved Interleaved access pattern\n"); - printf(" (see below for example)\n"); - printf(" [default: Contiguous access pattern]\n"); - printf(" -o F, --output=F Output raw data into file F [default: none]\n"); - printf(" -p N, --min-num-processes=N Minimum number of processes to use [default: 1]\n"); - printf(" -P N, --max-num-processes=N Maximum number of processes to use\n"); - printf(" [default: all MPI_COMM_WORLD processes ]\n"); - printf(" -T S, --threshold=S Threshold for alignment of objects in HDF5 file\n"); - printf(" [default: 1]\n"); - printf(" -w, --write-only Perform write tests not the read tests\n"); - printf(" -x S, --min-xfer-size=S Minimum transfer buffer size\n"); - printf(" (see below for description)\n"); - printf(" [default: half the number of bytes per process\n"); - printf(" per dataset]\n"); - printf(" -X S, --max-xfer-size=S Maximum transfer buffer size\n"); - printf(" [default: the number of bytes per process per\n"); - printf(" dataset]\n"); - printf("\n"); - printf(" F - is a filename.\n"); - printf(" N - is an integer >=0.\n"); - printf(" S - is a size specifier, an integer >=0 followed by a size indicator:\n"); - printf(" K - Kilobyte (%d)\n", ONE_KB); - printf(" M - Megabyte (%d)\n", ONE_MB); - printf(" G - Gigabyte (%d)\n", ONE_GB); - printf("\n"); - printf(" Example: '37M' is 37 megabytes or %d bytes\n", 37*ONE_MB); - printf("\n"); - printf(" AL - is an API list. Valid values are:\n"); - printf(" phdf5 - Parallel HDF5\n"); - printf(" mpiio - MPI-I/O\n"); - printf(" posix - POSIX\n"); - printf("\n"); - printf(" Example: --api=mpiio,phdf5\n"); - printf("\n"); - printf(" Dataset size:\n"); - printf(" Depending on the selected geometry, each test dataset is either a linear\n"); - printf(" array of size bytes-per-process * num-processes, or a square array of size\n"); - printf(" (bytes-per-process * num-processes) x (bytes-per-process * num-processes).\n"); - printf("\n"); - printf(" Block size vs. Transfer buffer size:\n"); - printf(" buffer-size controls the size of the memory buffer, which is broken into\n"); - printf(" blocks and written to the file. Depending on the selected geometry, each\n"); - printf(" block can be a linear array of size block-size or a square array of size\n"); - printf(" block-size x block-size. The arrangement in which blocks are written is\n"); - printf(" determined by the access pattern.\n"); - printf("\n"); - printf(" In 1D geometry, the transfer buffer is a linear array of size buffer-size.\n"); - printf(" In 2D geometry, it is a rectangular array of size block-size x buffer-size\n"); - printf(" or buffer-size x block-size if interleaved pattern is selected.\n"); - printf("\n"); - printf(" Interleaved and Contiguous patterns in 1D geometry:\n"); - printf(" When contiguous access pattern is chosen, the dataset is evenly divided\n"); - printf(" into num-processes regions and each process writes data to its own region.\n"); - printf(" When interleaved blocks are written to a dataset, space for the first\n"); - printf(" block of the first process is allocated in the dataset, then space is\n"); - printf(" allocated for the first block of the second process, etc. until space is\n"); - printf(" allocated for the first block of each process, then space is allocated for\n"); - printf(" the second block of the first process, the second block of the second\n"); - printf(" process, etc.\n"); - printf("\n"); - printf(" For example, with a 3 process run, 512KB bytes-per-process, 256KB transfer\n"); - printf(" buffer size, and 64KB block size, each process must issue 2 transfer\n"); - printf(" requests to complete access to the dataset.\n"); - printf(" Contiguous blocks of the first transfer request are written like so:\n"); - printf(" 1111----2222----3333----\n"); - printf(" Interleaved blocks of the first transfer request are written like so:\n"); - printf(" 123123123123------------\n"); - printf(" The actual number of I/O operations involved in a transfer request\n"); - printf(" depends on the access pattern and communication mode.\n"); - printf(" When using independent I/O with interleaved pattern, each process\n"); - printf(" performs 4 small non-contiguous I/O operations per transfer request.\n"); - printf(" If collective I/O is turned on, the combined content of the buffers of\n"); - printf(" the 3 processes will be written using one collective I/O operation\n"); - printf(" per transfer request.\n"); - printf("\n"); - printf(" For information about access patterns in 2D geometry, please refer to the\n"); - printf(" HDF5 Reference Manual.\n"); - printf("\n"); - printf(" DL - is a list of debugging flags. Valid values are:\n"); - printf(" 1 - Minimal\n"); - printf(" 2 - Not quite everything\n"); - printf(" 3 - Everything\n"); - printf(" 4 - The kitchen sink\n"); - printf(" r - Raw data I/O throughput information\n"); - printf(" t - Times as well as throughputs\n"); - printf(" v - Verify data correctness\n"); - printf("\n"); - printf(" Example: --debug=2,r,t\n"); - printf("\n"); - printf(" Environment variables:\n"); - printf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n"); - printf(" HDF5_MPI_INFO MPI INFO object key=value separated by ;\n"); - printf(" HDF5_PARAPREFIX Paralllel data files prefix\n"); + HDprintf(" -B S, --block-size=S Block size within transfer buffer\n"); + HDprintf(" (see below for description)\n"); + HDprintf(" [default: half the number of bytes per process\n"); + HDprintf(" per dataset]\n"); + HDprintf(" -c, --chunk Create HDF5 datasets using chunked storage\n"); + HDprintf(" [default: contiguous storage]\n"); + HDprintf(" -C, --collective Use collective I/O for MPI and HDF5 APIs\n"); + HDprintf(" [default: independent I/O)\n"); + HDprintf(" -d N, --num-dsets=N Number of datasets per file [default: 1]\n"); + HDprintf(" -D DL, --debug=DL Indicate the debugging level\n"); + HDprintf(" [default: no debugging]\n"); + HDprintf(" -e S, --num-bytes=S Number of bytes per process per dataset\n"); + HDprintf(" (see below for description)\n"); + HDprintf(" [default: 256K for 1D, 8K for 2D]\n"); + HDprintf(" -F N, --num-files=N Number of files [default: 1]\n"); + HDprintf(" -g, --geometry Use 2D geometry [default: 1D geometry]\n"); + HDprintf(" -i N, --num-iterations=N Number of iterations to perform [default: 1]\n"); + HDprintf(" -I, --interleaved Interleaved access pattern\n"); + HDprintf(" (see below for example)\n"); + HDprintf(" [default: Contiguous access pattern]\n"); + HDprintf(" -o F, --output=F Output raw data into file F [default: none]\n"); + HDprintf(" -p N, --min-num-processes=N Minimum number of processes to use [default: 1]\n"); + HDprintf(" -P N, --max-num-processes=N Maximum number of processes to use\n"); + HDprintf(" [default: all MPI_COMM_WORLD processes ]\n"); + HDprintf(" -T S, --threshold=S Threshold for alignment of objects in HDF5 file\n"); + HDprintf(" [default: 1]\n"); + HDprintf(" -w, --write-only Perform write tests not the read tests\n"); + HDprintf(" -x S, --min-xfer-size=S Minimum transfer buffer size\n"); + HDprintf(" (see below for description)\n"); + HDprintf(" [default: half the number of bytes per process\n"); + HDprintf(" per dataset]\n"); + HDprintf(" -X S, --max-xfer-size=S Maximum transfer buffer size\n"); + HDprintf(" [default: the number of bytes per process per\n"); + HDprintf(" dataset]\n"); + HDprintf("\n"); + HDprintf(" F - is a filename.\n"); + HDprintf(" N - is an integer >=0.\n"); + HDprintf(" S - is a size specifier, an integer >=0 followed by a size indicator:\n"); + HDprintf(" K - Kilobyte (%d)\n", ONE_KB); + HDprintf(" M - Megabyte (%d)\n", ONE_MB); + HDprintf(" G - Gigabyte (%d)\n", ONE_GB); + HDprintf("\n"); + HDprintf(" Example: '37M' is 37 megabytes or %d bytes\n", 37*ONE_MB); + HDprintf("\n"); + HDprintf(" AL - is an API list. Valid values are:\n"); + HDprintf(" phdf5 - Parallel HDF5\n"); + HDprintf(" mpiio - MPI-I/O\n"); + HDprintf(" posix - POSIX\n"); + HDprintf("\n"); + HDprintf(" Example: --api=mpiio,phdf5\n"); + HDprintf("\n"); + HDprintf(" Dataset size:\n"); + HDprintf(" Depending on the selected geometry, each test dataset is either a linear\n"); + HDprintf(" array of size bytes-per-process * num-processes, or a square array of size\n"); + HDprintf(" (bytes-per-process * num-processes) x (bytes-per-process * num-processes).\n"); + HDprintf("\n"); + HDprintf(" Block size vs. Transfer buffer size:\n"); + HDprintf(" buffer-size controls the size of the memory buffer, which is broken into\n"); + HDprintf(" blocks and written to the file. Depending on the selected geometry, each\n"); + HDprintf(" block can be a linear array of size block-size or a square array of size\n"); + HDprintf(" block-size x block-size. The arrangement in which blocks are written is\n"); + HDprintf(" determined by the access pattern.\n"); + HDprintf("\n"); + HDprintf(" In 1D geometry, the transfer buffer is a linear array of size buffer-size.\n"); + HDprintf(" In 2D geometry, it is a rectangular array of size block-size x buffer-size\n"); + HDprintf(" or buffer-size x block-size if interleaved pattern is selected.\n"); + HDprintf("\n"); + HDprintf(" Interleaved and Contiguous patterns in 1D geometry:\n"); + HDprintf(" When contiguous access pattern is chosen, the dataset is evenly divided\n"); + HDprintf(" into num-processes regions and each process writes data to its own region.\n"); + HDprintf(" When interleaved blocks are written to a dataset, space for the first\n"); + HDprintf(" block of the first process is allocated in the dataset, then space is\n"); + HDprintf(" allocated for the first block of the second process, etc. until space is\n"); + HDprintf(" allocated for the first block of each process, then space is allocated for\n"); + HDprintf(" the second block of the first process, the second block of the second\n"); + HDprintf(" process, etc.\n"); + HDprintf("\n"); + HDprintf(" For example, with a 3 process run, 512KB bytes-per-process, 256KB transfer\n"); + HDprintf(" buffer size, and 64KB block size, each process must issue 2 transfer\n"); + HDprintf(" requests to complete access to the dataset.\n"); + HDprintf(" Contiguous blocks of the first transfer request are written like so:\n"); + HDprintf(" 1111----2222----3333----\n"); + HDprintf(" Interleaved blocks of the first transfer request are written like so:\n"); + HDprintf(" 123123123123------------\n"); + HDprintf(" The actual number of I/O operations involved in a transfer request\n"); + HDprintf(" depends on the access pattern and communication mode.\n"); + HDprintf(" When using independent I/O with interleaved pattern, each process\n"); + HDprintf(" performs 4 small non-contiguous I/O operations per transfer request.\n"); + HDprintf(" If collective I/O is turned on, the combined content of the buffers of\n"); + HDprintf(" the 3 processes will be written using one collective I/O operation\n"); + HDprintf(" per transfer request.\n"); + HDprintf("\n"); + HDprintf(" For information about access patterns in 2D geometry, please refer to the\n"); + HDprintf(" HDF5 Reference Manual.\n"); + HDprintf("\n"); + HDprintf(" DL - is a list of debugging flags. Valid values are:\n"); + HDprintf(" 1 - Minimal\n"); + HDprintf(" 2 - Not quite everything\n"); + HDprintf(" 3 - Everything\n"); + HDprintf(" 4 - The kitchen sink\n"); + HDprintf(" r - Raw data I/O throughput information\n"); + HDprintf(" t - Times as well as throughputs\n"); + HDprintf(" v - Verify data correctness\n"); + HDprintf("\n"); + HDprintf(" Example: --debug=2,r,t\n"); + HDprintf("\n"); + HDprintf(" Environment variables:\n"); + HDprintf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n"); + HDprintf(" HDF5_MPI_INFO MPI INFO object key=value separated by ;\n"); + HDprintf(" HDF5_PARAPREFIX Paralllel data files prefix\n"); fflush(stdout); } /* end if */ } /* end usage() */ @@ -1685,7 +1685,7 @@ usage(const char *prog) int main(void) { - printf("No parallel IO performance because parallel is not configured\n"); + HDprintf("No parallel IO performance because parallel is not configured\n"); return EXIT_SUCCESS; } /* end main */ diff --git a/tools/test/perform/pio_standalone.h b/tools/test/perform/pio_standalone.h index a40cff8..e6db2e8 100644 --- a/tools/test/perform/pio_standalone.h +++ b/tools/test/perform/pio_standalone.h @@ -294,6 +294,7 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #define HDpipe(F) pipe(F) #define HDpow(X,Y) pow(X,Y) /* printf() variable arguments */ +#define HDprintf(...) HDfprintf(stdout, __VA_ARGS__) #define HDputc(C,F) putc(C,F) #define HDputchar(C) putchar(C) #define HDputs(S) puts(S) @@ -355,6 +356,7 @@ H5_DLL int c99_snprintf(char* str, size_t size, const char* format, ...); #define HDsnprintf snprintf /*varargs*/ #endif /* sprintf() variable arguments */ +#define HDsprintf sprintf /*varargs*/ #define HDsqrt(X) sqrt(X) #ifdef H5_HAVE_RAND_R H5_DLL void HDsrand(unsigned int seed); diff --git a/tools/test/perform/sio_engine.c b/tools/test/perform/sio_engine.c index ed15fa5..07a39cb 100644 --- a/tools/test/perform/sio_engine.c +++ b/tools/test/perform/sio_engine.c @@ -41,7 +41,7 @@ #define GOTOERROR(errcode) { ret_code = errcode; goto done; } #define ERRMSG(mesg) { \ - fprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", \ + HDfprintf(stderr, "*** Assertion failed (%s) at line %4d in %s\n", \ mesg, (int)__LINE__, __FILE__); \ } @@ -198,7 +198,7 @@ do_sio(parameters param, results *res) if (sio_debug_level >= 4) /* output all of the times for all iterations */ - fprintf(output, "Timer details:\n"); + HDfprintf(output, "Timer details:\n"); /* * Write performance measurement @@ -212,18 +212,18 @@ do_sio(parameters param, results *res) HDfprintf(output, "data filename=%s\n", fname); - set_time(res->timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART); + io_time_set(res->timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTART); hrc = do_fopen(¶m, fname, &fd, SIO_CREATE | SIO_WRITE); VRFY((hrc == SUCCESS), "do_fopen failed"); - set_time(res->timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART); + io_time_set(res->timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTART); hrc = do_write(res, &fd, ¶m, buffer); - set_time(res->timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP); + io_time_set(res->timers, HDF5_FINE_WRITE_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_write failed"); /* Close file for write */ hrc = do_fclose(iot, &fd); - set_time(res->timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP); + io_time_set(res->timers, HDF5_GROSS_WRITE_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_fclose failed"); if (!param.h5_write_only) { @@ -232,19 +232,19 @@ do_sio(parameters param, results *res) */ /* Open file for read */ - set_time(res->timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART); + io_time_set(res->timers, HDF5_GROSS_READ_FIXED_DIMS, TSTART); hrc = do_fopen(¶m, fname, &fd, SIO_READ); VRFY((hrc == SUCCESS), "do_fopen failed"); - set_time(res->timers, HDF5_FINE_READ_FIXED_DIMS, TSTART); + io_time_set(res->timers, HDF5_FINE_READ_FIXED_DIMS, TSTART); hrc = do_read(res, &fd, ¶m, buffer); - set_time(res->timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP); + io_time_set(res->timers, HDF5_FINE_READ_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_read failed"); /* Close file for read */ hrc = do_fclose(iot, &fd); - set_time(res->timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP); + io_time_set(res->timers, HDF5_GROSS_READ_FIXED_DIMS, TSTOP); VRFY((hrc == SUCCESS), "do_fclose failed"); } @@ -264,7 +264,7 @@ done: case HDF5: if (fd.h5fd != -1) hrc = do_fclose(iot, &fd); - break; + break; default: /* unknown request */ HDassert(0 && "Unknown IO type"); @@ -490,7 +490,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer) /* Create the dataset transfer property list */ h5dxpl = H5Pcreate(H5P_DATASET_XFER); if (h5dxpl < 0) { - fprintf(stderr, "HDF5 Property List Create failed\n"); + HDfprintf(stderr, "HDF5 Property List Create failed\n"); GOTOERROR(FAIL); } @@ -512,7 +512,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer) h5dcpl = H5Pcreate(H5P_DATASET_CREATE); if (h5dcpl < 0) { - fprintf(stderr, "HDF5 Property List Create failed\n"); + HDfprintf(stderr, "HDF5 Property List Create failed\n"); GOTOERROR(FAIL); } @@ -520,12 +520,12 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer) /* Set the chunk size to be the same as the buffer size */ hrc = H5Pset_chunk(h5dcpl, rank, h5chunk); if (hrc < 0) { - fprintf(stderr, "HDF5 Property List Set failed\n"); + HDfprintf(stderr, "HDF5 Property List Set failed\n"); GOTOERROR(FAIL); } /* end if */ } /* end if */ - sprintf(dname, "Dataset_%ld", (unsigned long)parms->num_bytes); + HDsprintf(dname, "Dataset_%ld", (unsigned long)parms->num_bytes); h5ds_id = H5Dcreate2(fd->h5fd, dname, ELMT_H5_TYPE, h5dset_space_id, H5P_DEFAULT, h5dcpl, H5P_DEFAULT); @@ -550,19 +550,19 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer) } /* Start "raw data" write timer */ - set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART); + io_time_set(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTART); /* Perform write */ hrc = dset_write(rank-1, fd, parms, buffer); if (hrc < 0) { - fprintf(stderr, "Error in dataset write\n"); + HDfprintf(stderr, "Error in dataset write\n"); GOTOERROR(FAIL); } /* Stop "raw data" write timer */ - set_time(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP); + io_time_set(res->timers, HDF5_RAW_WRITE_FIXED_DIMS, TSTOP); /* Calculate write time */ @@ -571,7 +571,7 @@ do_write(results *res, file_descr *fd, parameters *parms, void *buffer) hrc = H5Dclose(h5ds_id); if (hrc < 0) { - fprintf(stderr, "HDF5 Dataset Close failed\n"); + HDfprintf(stderr, "HDF5 Dataset Close failed\n"); GOTOERROR(FAIL); } @@ -584,7 +584,7 @@ done: if (h5dset_space_id != -1) { hrc = H5Sclose(h5dset_space_id); if (hrc < 0){ - fprintf(stderr, "HDF5 Dataset Space Close failed\n"); + HDfprintf(stderr, "HDF5 Dataset Space Close failed\n"); ret_code = FAIL; } else { h5dset_space_id = -1; @@ -594,7 +594,7 @@ done: if (h5mem_space_id != -1) { hrc = H5Sclose(h5mem_space_id); if (hrc < 0) { - fprintf(stderr, "HDF5 Memory Space Close failed\n"); + HDfprintf(stderr, "HDF5 Memory Space Close failed\n"); ret_code = FAIL; } else { h5mem_space_id = -1; @@ -604,7 +604,7 @@ done: if (h5dxpl != -1) { hrc = H5Pclose(h5dxpl); if (hrc < 0) { - fprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n"); + HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n"); ret_code = FAIL; } else { h5dxpl = -1; @@ -685,7 +685,7 @@ dset_write(int local_dim, file_descr *fd, parameters *parms, void *buffer) VRFY((hrc >= 0), "H5Dwrite"); break; - + default: /* unknown request */ HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type); @@ -837,7 +837,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer) /* Create the dataset transfer property list */ h5dxpl = H5Pcreate(H5P_DATASET_XFER); if (h5dxpl < 0) { - fprintf(stderr, "HDF5 Property List Create failed\n"); + HDfprintf(stderr, "HDF5 Property List Create failed\n"); GOTOERROR(FAIL); } break; @@ -856,14 +856,14 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer) break; case HDF5: - sprintf(dname, "Dataset_%ld", (long)parms->num_bytes); + HDsprintf(dname, "Dataset_%ld", (long)parms->num_bytes); h5ds_id = H5Dopen2(fd->h5fd, dname, H5P_DEFAULT); if (h5ds_id < 0) { HDfprintf(stderr, "HDF5 Dataset open failed\n"); GOTOERROR(FAIL); } break; - + default: /* unknown request */ HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type); @@ -872,16 +872,16 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer) } /* end switch */ /* Start "raw data" read timer */ - set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART); + io_time_set(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTART); hrc = dset_read(rank-1, fd, parms, buffer, buffer2); if (hrc < 0) { - fprintf(stderr, "Error in dataset read\n"); + HDfprintf(stderr, "Error in dataset read\n"); GOTOERROR(FAIL); } /* Stop "raw data" read timer */ - set_time(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP); + io_time_set(res->timers, HDF5_RAW_READ_FIXED_DIMS, TSTOP); /* Calculate read time */ @@ -890,7 +890,7 @@ do_read(results *res, file_descr *fd, parameters *parms, void *buffer) hrc = H5Dclose(h5ds_id); if (hrc < 0) { - fprintf(stderr, "HDF5 Dataset Close failed\n"); + HDfprintf(stderr, "HDF5 Dataset Close failed\n"); GOTOERROR(FAIL); } @@ -903,7 +903,7 @@ done: if (h5dset_space_id != -1) { hrc = H5Sclose(h5dset_space_id); if (hrc < 0){ - fprintf(stderr, "HDF5 Dataset Space Close failed\n"); + HDfprintf(stderr, "HDF5 Dataset Space Close failed\n"); ret_code = FAIL; } else { h5dset_space_id = -1; @@ -913,7 +913,7 @@ done: if (h5mem_space_id != -1) { hrc = H5Sclose(h5mem_space_id); if (hrc < 0) { - fprintf(stderr, "HDF5 Memory Space Close failed\n"); + HDfprintf(stderr, "HDF5 Memory Space Close failed\n"); ret_code = FAIL; } else { h5mem_space_id = -1; @@ -923,7 +923,7 @@ done: if (h5dxpl != -1) { hrc = H5Pclose(h5dxpl); if (hrc < 0) { - fprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n"); + HDfprintf(stderr, "HDF5 Dataset Transfer Property List Close failed\n"); ret_code = FAIL; } else { h5dxpl = -1; @@ -987,7 +987,7 @@ dset_read(int local_dim, file_descr *fd, parameters *parms, void *buffer, h5dset_space_id, h5dxpl, buffer); VRFY((hrc >= 0), "H5Dread"); break; - + default: /* unknown request */ HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)parms->io_type); @@ -1089,7 +1089,7 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) fapl = set_vfd(param); if (fapl < 0) { - fprintf(stderr, "HDF5 Property List Create failed\n"); + HDfprintf(stderr, "HDF5 Property List Create failed\n"); GOTOERROR(FAIL); } @@ -1110,11 +1110,11 @@ do_fopen(parameters *param, char *fname, file_descr *fd /*out*/, int flags) if (fd->h5fd < 0) { - fprintf(stderr, "HDF5 File Create failed(%s)\n", fname); + HDfprintf(stderr, "HDF5 File Create failed(%s)\n", fname); GOTOERROR(FAIL); } break; - + default: /* unknown request */ HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)param->io_type); @@ -1176,7 +1176,7 @@ set_vfd(parameters *param) HDassert(HDstrlen(multi_letters)==H5FD_MEM_NTYPES); for (mt=H5FD_MEM_DEFAULT; mt<H5FD_MEM_NTYPES; H5_INC_ENUM(H5FD_mem_t,mt)) { memb_fapl[mt] = H5P_DEFAULT; - sprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]); + HDsprintf(sv[mt], "%%s-%c.h5", multi_letters[mt]); memb_name[mt] = sv[mt]; memb_addr[mt] = (haddr_t)MAX(mt - 1,0) * (HADDR_MAX / 10); } @@ -1225,7 +1225,7 @@ do_fclose(iotype iot, file_descr *fd /*out*/) rc = POSIXCLOSE(fd->posixfd); if (rc != 0){ - fprintf(stderr, "POSIX File Close failed\n"); + HDfprintf(stderr, "POSIX File Close failed\n"); GOTOERROR(FAIL); } @@ -1236,13 +1236,13 @@ do_fclose(iotype iot, file_descr *fd /*out*/) hrc = H5Fclose(fd->h5fd); if (hrc < 0) { - fprintf(stderr, "HDF5 File Close failed\n"); + HDfprintf(stderr, "HDF5 File Close failed\n"); GOTOERROR(FAIL); } fd->h5fd = -1; break; - + default: /* unknown request */ HDfprintf(stderr, "Unknown IO type request (%d)\n", (int)iot); diff --git a/tools/test/perform/sio_perf.c b/tools/test/perform/sio_perf.c index e77b99e..a56558e 100644 --- a/tools/test/perform/sio_perf.c +++ b/tools/test/perform/sio_perf.c @@ -98,7 +98,7 @@ static const char *progname = "h5perf_serial"; * It seems that only the options that accept additional information * such as dataset size (-e) require the colon next to it. */ -static const char *s_opts = "a:A:B:b:c:Cd:D:e:F:G:ghi:Imno:p:P:r:stT:v:wx:X:"; +static const char *s_opts = "a:A:B:c:Cd:D:e:F:ghi:Imno:p:P:r:stT:v:wx:X:"; static struct long_options l_opts[] = { { "align", require_arg, 'a' }, { "alig", require_arg, 'a' }, @@ -281,14 +281,14 @@ struct options { int buf_rank; /* Rank */ int order_rank; /* Rank */ int chk_rank; /* Rank */ - int print_times; /* print times as well as throughputs */ - int print_raw; /* print raw data throughput info */ + int print_times; /* print times as well as throughputs */ + int print_raw; /* print raw data throughput info */ hsize_t h5_alignment; /* alignment in HDF5 file */ hsize_t h5_threshold; /* threshold for alignment in HDF5 file */ - int h5_use_chunks; /* Make HDF5 dataset chunked */ - int h5_write_only; /* Perform the write tests only */ - int h5_extendable; /* Perform the write tests only */ - int verify; /* Verify data correctness */ + int h5_use_chunks; /* Make HDF5 dataset chunked */ + int h5_write_only; /* Perform the write tests only */ + int h5_extendable; /* Perform the write tests only */ + int verify; /* Verify data correctness */ vfdtype vfd; /* File driver */ size_t page_buffer_size; size_t page_size; @@ -333,7 +333,7 @@ main(int argc, char **argv) /* Initialize h5tools lib */ h5tools_init(); #endif - + output = stdout; opts = parse_command_line(argc, argv); @@ -345,8 +345,8 @@ main(int argc, char **argv) if (opts->output_file) { if ((output = HDfopen(opts->output_file, "w")) == NULL) { - fprintf(stderr, "%s: cannot open output file\n", progname); - perror(opts->output_file); + HDfprintf(stderr, "%s: cannot open output file\n", progname); + HDperror(opts->output_file); goto finish; } } @@ -356,7 +356,7 @@ main(int argc, char **argv) run_test_loop(opts); finish: - free(opts); + HDfree(opts); return exit_value; } @@ -385,8 +385,8 @@ static void run_test_loop(struct options *opts) { parameters parms; - int i; - size_t buf_bytes; + int i; + size_t buf_bytes; /* load options into parameter structure */ parms.num_files = opts->num_files; @@ -498,50 +498,50 @@ run_test(iotype iot, parameters parms, struct options *opts) do_sio(parms, &res); /* gather all of the "sys write" times */ - t = get_time(res.timers, HDF5_MPI_WRITE); + t = io_time_get(res.timers, HDF5_MPI_WRITE); get_minmax(&write_sys_mm, t); write_sys_mm_table[i] = write_sys_mm; /* gather all of the "write" times */ - t = get_time(res.timers, HDF5_FINE_WRITE_FIXED_DIMS); + t = io_time_get(res.timers, HDF5_FINE_WRITE_FIXED_DIMS); get_minmax(&write_mm, t); write_mm_table[i] = write_mm; /* gather all of the "write" times from open to close */ - t = get_time(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS); + t = io_time_get(res.timers, HDF5_GROSS_WRITE_FIXED_DIMS); get_minmax(&write_gross_mm, t); write_gross_mm_table[i] = write_gross_mm; /* gather all of the raw "write" times */ - t = get_time(res.timers, HDF5_RAW_WRITE_FIXED_DIMS); + t = io_time_get(res.timers, HDF5_RAW_WRITE_FIXED_DIMS); get_minmax(&write_raw_mm, t); write_raw_mm_table[i] = write_raw_mm; if (!parms.h5_write_only) { /* gather all of the "mpi read" times */ - t = get_time(res.timers, HDF5_MPI_READ); + t = io_time_get(res.timers, HDF5_MPI_READ); get_minmax(&read_sys_mm, t); read_sys_mm_table[i] = read_sys_mm; /* gather all of the "read" times */ - t = get_time(res.timers, HDF5_FINE_READ_FIXED_DIMS); + t = io_time_get(res.timers, HDF5_FINE_READ_FIXED_DIMS); get_minmax(&read_mm, t); read_mm_table[i] = read_mm; /* gather all of the "read" times from open to close */ - t = get_time(res.timers, HDF5_GROSS_READ_FIXED_DIMS); + t = io_time_get(res.timers, HDF5_GROSS_READ_FIXED_DIMS); get_minmax(&read_gross_mm, t); read_gross_mm_table[i] = read_gross_mm; /* gather all of the raw "read" times */ - t = get_time(res.timers, HDF5_RAW_READ_FIXED_DIMS); + t = io_time_get(res.timers, HDF5_RAW_READ_FIXED_DIMS); get_minmax(&read_raw_mm, t); read_raw_mm_table[i] = read_gross_mm; @@ -552,7 +552,7 @@ run_test(iotype iot, parameters parms, struct options *opts) /* * Show various statistics */ - /* Write statistics */ + /* Write statistics */ /* Print the raw data throughput if desired */ if (opts->print_raw) { /* accumulate and output the max, min, and average "raw write" times */ @@ -598,7 +598,7 @@ run_test(iotype iot, parameters parms, struct options *opts) output_results(opts,"Write Open-Close",write_gross_mm_table,parms.num_iters,raw_size); if (!parms.h5_write_only) { - /* Read statistics */ + /* Read statistics */ /* Print the raw data throughput if desired */ if (opts->print_raw) { /* accumulate and output the max, min, and average "raw read" times */ @@ -647,16 +647,16 @@ run_test(iotype iot, parameters parms, struct options *opts) } /* clean up our mess */ - free(write_sys_mm_table); - free(write_mm_table); - free(write_gross_mm_table); - free(write_raw_mm_table); + HDfree(write_sys_mm_table); + HDfree(write_mm_table); + HDfree(write_gross_mm_table); + HDfree(write_raw_mm_table); if (!parms.h5_write_only) { - free(read_sys_mm_table); - free(read_mm_table); - free(read_gross_mm_table); - free(read_raw_mm_table); + HDfree(read_sys_mm_table); + HDfree(read_mm_table); + HDfree(read_gross_mm_table); + HDfree(read_raw_mm_table); } return ret_value; @@ -790,9 +790,9 @@ output_report(const char *fmt, ...) { va_list ap; - va_start(ap, fmt); - vfprintf(output, fmt, ap); - va_end(ap); + HDva_start(ap, fmt); + HDvfprintf(output, fmt, ap); + HDva_end(ap); } /* @@ -806,10 +806,10 @@ output_report(const char *fmt, ...) static void print_indent(register int indent) { - indent *= TAB_SPACE; + indent *= TAB_SPACE; - for (; indent > 0; --indent) - fputc(' ', output); + for (; indent > 0; --indent) + HDfputc(' ', output); } static void @@ -833,9 +833,9 @@ static void print_io_api(long io_types) { if (io_types & SIO_POSIX) - HDfprintf(output, "posix "); + HDfprintf(output, "posix "); if (io_types & SIO_HDF5) - HDfprintf(output, "hdf5 "); + HDfprintf(output, "hdf5 "); HDfprintf(output, "\n"); } @@ -845,7 +845,7 @@ report_parameters(struct options *opts) int i, rank; rank = opts->dset_rank; - print_version("HDF5 Library"); /* print library version */ + print_version("HDF5 Library"); /* print library version */ HDfprintf(output, "==== Parameters ====\n"); HDfprintf(output, "IO API="); @@ -1004,7 +1004,7 @@ parse_command_line(int argc, char *argv[]) HDmemset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) - if (isalnum(*end) && i < 10) + if (HDisalnum(*end) && i < 10) buf[i++] = *end; if (!HDstrcasecmp(buf, "hdf5")) { @@ -1012,9 +1012,9 @@ parse_command_line(int argc, char *argv[]) } else if (!HDstrcasecmp(buf, "posix")) { cl_opts->io_types |= SIO_POSIX; } else { - fprintf(stderr, "sio_perf: invalid --api option %s\n", + HDfprintf(stderr, "sio_perf: invalid --api option %s\n", buf); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } if (*end == '\0') @@ -1043,7 +1043,7 @@ parse_command_line(int argc, char *argv[]) HDmemset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) - if (isalnum(*end) && i < 10) + if (HDisalnum(*end) && i < 10) buf[i++] = *end; cl_opts->chk_size[j] = parse_size_directive(buf); @@ -1071,17 +1071,17 @@ parse_command_line(int argc, char *argv[]) HDmemset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) - if (isalnum(*end) && i < 10) + if (HDisalnum(*end) && i < 10) buf[i++] = *end; - if (strlen(buf) > 1 || isdigit(buf[0])) { + if (HDstrlen(buf) > 1 || HDisdigit(buf[0])) { size_t j; for (j = 0; j < 10 && buf[j] != '\0'; ++j) - if (!isdigit(buf[j])) { - fprintf(stderr, "sio_perf: invalid --debug option %s\n", + if (!HDisdigit(buf[j])) { + HDfprintf(stderr, "sio_perf: invalid --debug option %s\n", buf); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } sio_debug_level = atoi(buf); @@ -1105,8 +1105,8 @@ parse_command_line(int argc, char *argv[]) cl_opts->verify = TRUE; break; default: - fprintf(stderr, "sio_perf: invalid --debug option %s\n", buf); - exit(EXIT_FAILURE); + HDfprintf(stderr, "sio_perf: invalid --debug option %s\n", buf); + HDexit(EXIT_FAILURE); } } @@ -1129,7 +1129,7 @@ parse_command_line(int argc, char *argv[]) HDmemset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) - if (isalnum(*end) && i < 10) + if (HDisalnum(*end) && i < 10) buf[i++] = *end; cl_opts->dset_size[j] = parse_size_directive(buf); @@ -1147,7 +1147,7 @@ parse_command_line(int argc, char *argv[]) break; case 'i': - cl_opts->num_iters = atoi(opt_arg); + cl_opts->num_iters = HDatoi(opt_arg); break; case 'o': cl_opts->output_file = opt_arg; @@ -1171,9 +1171,9 @@ parse_command_line(int argc, char *argv[]) } else if (!HDstrcasecmp(opt_arg, "direct")) { cl_opts->vfd=direct; } else { - fprintf(stderr, "sio_perf: invalid --api option %s\n", + HDfprintf(stderr, "sio_perf: invalid --api option %s\n", opt_arg); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } break; case 'w': @@ -1193,7 +1193,7 @@ parse_command_line(int argc, char *argv[]) HDmemset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) - if (isalnum(*end) && i < 10) + if (HDisalnum(*end) && i < 10) buf[i++] = *end; cl_opts->buf_size[j] = parse_size_directive(buf); @@ -1221,7 +1221,7 @@ parse_command_line(int argc, char *argv[]) HDmemset(buf, '\0', sizeof(buf)); for (i = 0; *end != '\0' && *end != ','; ++end) - if (isalnum(*end) && i < 10) + if (HDisalnum(*end) && i < 10) buf[i++] = *end; cl_opts->order[j] = (int)parse_size_directive(buf); @@ -1243,7 +1243,7 @@ parse_command_line(int argc, char *argv[]) case '?': default: usage(progname); - free(cl_opts); + HDfree(cl_opts); return NULL; } } @@ -1339,8 +1339,8 @@ parse_size_directive(const char *size) break; default: - fprintf(stderr, "Illegal size specifier '%c'\n", *endptr); - exit(EXIT_FAILURE); + HDfprintf(stderr, "Illegal size specifier '%c'\n", *endptr); + HDexit(EXIT_FAILURE); } } @@ -1357,72 +1357,72 @@ parse_size_directive(const char *size) static void usage(const char *prog) { - print_version(prog); - printf("usage: %s [OPTIONS]\n", prog); - printf(" OPTIONS\n"); - printf(" -h Print an usage message and exit\n"); - printf(" -A AL Which APIs to test\n"); - printf(" [default: all of them]\n"); - printf(" -c SL Selects chunked storage and defines chunks dimensions\n"); - printf(" and sizes\n"); - printf(" [default: Off]\n"); - printf(" -e SL Dimensions and sizes of dataset\n"); - printf(" [default: 100,200]\n"); - printf(" -i N Number of iterations to perform\n"); - printf(" [default: 1]\n"); - printf(" -r NL Dimension access order (see below for description)\n"); - printf(" [default: 1,2]\n"); - printf(" -t Selects extendable dimensions for HDF5 dataset\n"); - printf(" [default: Off]\n"); - printf(" -v VFD Selects file driver for HDF5 access\n"); - printf(" [default: sec2]\n"); - printf(" -w Perform write tests, not the read tests\n"); - printf(" [default: Off]\n"); - printf(" -x SL Dimensions and sizes of the transfer buffer\n"); - printf(" [default: 10,20]\n"); - printf("\n"); - printf(" N - is an integer > 0.\n"); - printf("\n"); - printf(" S - is a size specifier, an integer > 0 followed by a size indicator:\n"); - printf(" K - Kilobyte (%d)\n", ONE_KB); - printf(" M - Megabyte (%d)\n", ONE_MB); - printf(" G - Gigabyte (%d)\n", ONE_GB); - printf("\n"); - printf(" Example: '37M' is 37 megabytes or %d bytes\n", 37*ONE_MB); - printf("\n"); - printf(" AL - is an API list. Valid values are:\n"); - printf(" hdf5 - HDF5\n"); - printf(" posix - POSIX\n"); - printf("\n"); - printf(" Example: -A posix,hdf5\n"); - printf("\n"); - printf(" NL - is list of integers (N) separated by commas.\n"); - printf("\n"); - printf(" Example: 1,2,3\n"); - printf("\n"); - printf(" SL - is list of size specifiers (S) separated by commas.\n"); - printf("\n"); - printf(" Example: 2K,2K,3K\n"); - printf("\n"); - printf(" The example defines an object (dataset, tranfer buffer) with three\n"); - printf(" dimensions. Be aware that as the number of dimensions increases, the\n"); - printf(" the total size of the object increases exponentially.\n"); - printf("\n"); - printf(" VFD - is an HDF5 file driver specifier. Valid values are:\n"); - printf(" sec2, stdio, core, split, multi, family, direct\n"); - printf("\n"); - printf(" Dimension access order:\n"); - printf(" Data access starts at the cardinal origin of the dataset using the\n"); - printf(" transfer buffer. The next access occurs on a dataset region next to\n"); - printf(" the previous one. For a multidimensional dataset, there are several\n"); - printf(" directions as to where to proceed. This can be specified in the dimension\n"); - printf(" access order. For example, -r 1,2 states that the tool should traverse\n"); - printf(" dimension 1 first, and then dimension 2.\n"); - printf("\n"); - printf(" Environment variables:\n"); - printf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n"); - printf(" HDF5_PREFIX Data file prefix\n"); - printf("\n"); - fflush(stdout); + print_version(prog); + HDprintf("usage: %s [OPTIONS]\n", prog); + HDprintf(" OPTIONS\n"); + HDprintf(" -h Print an usage message and exit\n"); + HDprintf(" -A AL Which APIs to test\n"); + HDprintf(" [default: all of them]\n"); + HDprintf(" -c SL Selects chunked storage and defines chunks dimensions\n"); + HDprintf(" and sizes\n"); + HDprintf(" [default: Off]\n"); + HDprintf(" -e SL Dimensions and sizes of dataset\n"); + HDprintf(" [default: 100,200]\n"); + HDprintf(" -i N Number of iterations to perform\n"); + HDprintf(" [default: 1]\n"); + HDprintf(" -r NL Dimension access order (see below for description)\n"); + HDprintf(" [default: 1,2]\n"); + HDprintf(" -t Selects extendable dimensions for HDF5 dataset\n"); + HDprintf(" [default: Off]\n"); + HDprintf(" -v VFD Selects file driver for HDF5 access\n"); + HDprintf(" [default: sec2]\n"); + HDprintf(" -w Perform write tests, not the read tests\n"); + HDprintf(" [default: Off]\n"); + HDprintf(" -x SL Dimensions and sizes of the transfer buffer\n"); + HDprintf(" [default: 10,20]\n"); + HDprintf("\n"); + HDprintf(" N - is an integer > 0.\n"); + HDprintf("\n"); + HDprintf(" S - is a size specifier, an integer > 0 followed by a size indicator:\n"); + HDprintf(" K - Kilobyte (%d)\n", ONE_KB); + HDprintf(" M - Megabyte (%d)\n", ONE_MB); + HDprintf(" G - Gigabyte (%d)\n", ONE_GB); + HDprintf("\n"); + HDprintf(" Example: '37M' is 37 megabytes or %d bytes\n", 37*ONE_MB); + HDprintf("\n"); + HDprintf(" AL - is an API list. Valid values are:\n"); + HDprintf(" hdf5 - HDF5\n"); + HDprintf(" posix - POSIX\n"); + HDprintf("\n"); + HDprintf(" Example: -A posix,hdf5\n"); + HDprintf("\n"); + HDprintf(" NL - is list of integers (N) separated by commas.\n"); + HDprintf("\n"); + HDprintf(" Example: 1,2,3\n"); + HDprintf("\n"); + HDprintf(" SL - is list of size specifiers (S) separated by commas.\n"); + HDprintf("\n"); + HDprintf(" Example: 2K,2K,3K\n"); + HDprintf("\n"); + HDprintf(" The example defines an object (dataset, tranfer buffer) with three\n"); + HDprintf(" dimensions. Be aware that as the number of dimensions increases, the\n"); + HDprintf(" the total size of the object increases exponentially.\n"); + HDprintf("\n"); + HDprintf(" VFD - is an HDF5 file driver specifier. Valid values are:\n"); + HDprintf(" sec2, stdio, core, split, multi, family, direct\n"); + HDprintf("\n"); + HDprintf(" Dimension access order:\n"); + HDprintf(" Data access starts at the cardinal origin of the dataset using the\n"); + HDprintf(" transfer buffer. The next access occurs on a dataset region next to\n"); + HDprintf(" the previous one. For a multidimensional dataset, there are several\n"); + HDprintf(" directions as to where to proceed. This can be specified in the dimension\n"); + HDprintf(" access order. For example, -r 1,2 states that the tool should traverse\n"); + HDprintf(" dimension 1 first, and then dimension 2.\n"); + HDprintf("\n"); + HDprintf(" Environment variables:\n"); + HDprintf(" HDF5_NOCLEANUP Do not remove data files if set [default remove]\n"); + HDprintf(" HDF5_PREFIX Data file prefix\n"); + HDprintf("\n"); + HDfflush(stdout); } /* end usage() */ diff --git a/tools/test/perform/sio_standalone.h b/tools/test/perform/sio_standalone.h index e73a6b5..5ce922b 100644 --- a/tools/test/perform/sio_standalone.h +++ b/tools/test/perform/sio_standalone.h @@ -316,6 +316,7 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...); #define HDpipe(F) pipe(F) #define HDpow(X,Y) pow(X,Y) /* printf() variable arguments */ +#define HDprintf(...) HDfprintf(stdout, __VA_ARGS__) #define HDputc(C,F) putc(C,F) #define HDputchar(C) putchar(C) #define HDputs(S) puts(S) @@ -377,6 +378,7 @@ H5_DLL int c99_snprintf(char* str, size_t size, const char* format, ...); #define HDsnprintf snprintf /*varargs*/ #endif /* sprintf() variable arguments */ +#define HDsprintf sprintf /*varargs*/ #define HDsqrt(X) sqrt(X) #ifdef H5_HAVE_RAND_R H5_DLL void HDsrand(unsigned int seed); |