diff options
author | Allen Byrne <50328838+byrnHDF@users.noreply.github.com> | 2022-08-07 04:59:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-07 04:59:31 (GMT) |
commit | 956282fa6f5f5b7df92be6f14c12681f7ecabbc9 (patch) | |
tree | 262418febb0a037f752e577ab632accd358edd93 | |
parent | 7127d8912c8fa601d59b4e8ce522eaf149c02344 (diff) | |
download | hdf5-956282fa6f5f5b7df92be6f14c12681f7ecabbc9.zip hdf5-956282fa6f5f5b7df92be6f14c12681f7ecabbc9.tar.gz hdf5-956282fa6f5f5b7df92be6f14c12681f7ecabbc9.tar.bz2 |
Develop cmake clean (#1971)
74 files changed, 2017 insertions, 1418 deletions
diff --git a/c++/examples/CMakeTests.cmake b/c++/examples/CMakeTests.cmake index a7fc9b8..2a3bef5 100644 --- a/c++/examples/CMakeTests.cmake +++ b/c++/examples/CMakeTests.cmake @@ -16,17 +16,31 @@ ############################################################################## ############################################################################## # Remove any output file left over from previous test run +set (CPP_EX_CLEANFILES + Group.h5 + SDS.h5 + SDScompound.h5 + SDSextendible.h5 + Select.h5 +) add_test ( NAME CPP_ex-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove - Group.h5 - SDS.h5 - SDScompound.h5 - SDSextendible.h5 - Select.h5 + -E remove ${CPP_EX_CLEANFILES} +) +set_tests_properties (CPP_ex-clear-objects PROPERTIES + FIXTURES_SETUP clear_cppex + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) +add_test ( + NAME CPP_ex-clean-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${CPP_EX_CLEANFILES} +) +set_tests_properties (CPP_ex-clean-objects PROPERTIES + FIXTURES_CLEANUP clear_cppex + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} ) -set_tests_properties (CPP_ex-clear-objects PROPERTIES FIXTURES_SETUP clear_cppex) foreach (example ${examples}) if (HDF5_ENABLE_USING_MEMCHECKER) @@ -53,19 +67,32 @@ endforeach () #the following dependencies are handled by the order of the files # SET_TESTS_PROPERTIES(CPP_ex_readdata PROPERTIES DEPENDS CPP_ex_create) # SET_TESTS_PROPERTIES(CPP_ex_chunks PROPERTIES DEPENDS CPP_ex_extend_ds) - +set (CPP_EX_TUTR_CLEANFILES + h5tutr_cmprss.h5 + h5tutr_dset.h5 + h5tutr_extend.h5 + h5tutr_group.h5 + h5tutr_groups.h5 + h5tutr_subset.h5 +) add_test ( NAME CPP_ex_tutr-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove - h5tutr_cmprss.h5 - h5tutr_dset.h5 - h5tutr_extend.h5 - h5tutr_group.h5 - h5tutr_groups.h5 - h5tutr_subset.h5 + -E remove ${CPP_EX_TUTR_CLEANFILES} +) +set_tests_properties (CPP_ex_tutr-clear-objects PROPERTIES + FIXTURES_SETUP clear_cppex_tutr + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) +add_test ( + NAME CPP_ex_tutr-clean-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${CPP_EX_TUTR_CLEANFILES} +) +set_tests_properties (CPP_ex_tutr-clean-objects PROPERTIES + FIXTURES_CLEANUP clear_cppex_tutr + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} ) -set_tests_properties (CPP_ex_tutr-clear-objects PROPERTIES FIXTURES_SETUP clear_cppex_tutr) foreach (example ${tutr_examples}) if (HDF5_ENABLE_USING_MEMCHECKER) @@ -77,8 +104,8 @@ foreach (example ${tutr_examples}) -D "TEST_ARGS:STRING=" -D "TEST_EXPECT=0" -D "TEST_SKIP_COMPARE=TRUE" - -D "TEST_OUTPUT=cpp_ex_${example}.txt" - #-D "TEST_REFERENCE=cpp_ex_${example}.out" + -D "TEST_OUTPUT=tutr_cpp_ex_${example}.txt" + #-D "TEST_REFERENCE=cpp_ex_tutr_${example}.out" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) diff --git a/c++/test/CMakeTests.cmake b/c++/test/CMakeTests.cmake index 2a0a6be..098c606 100644 --- a/c++/test/CMakeTests.cmake +++ b/c++/test/CMakeTests.cmake @@ -17,20 +17,6 @@ add_custom_target(cpp_testhdf5_files ALL COMMENT "Copying files needed by cpp_te ### T E S T I N G ### ############################################################################## ############################################################################## -# Remove any output file left over from previous test run -add_test ( - NAME CPP_testhdf5-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove - tattr_basic.h5 - tattr_compound.h5 - tattr_dtype.h5 - tattr_multi.h5 - tattr_scalar.h5 - tfattrs.h5 - titerate.h5 -) - if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME CPP_testhdf5 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:cpp_testhdf5>) else () @@ -46,7 +32,9 @@ else () -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () -set_tests_properties (CPP_testhdf5 PROPERTIES DEPENDS CPP_testhdf5-clear-objects) +set_tests_properties (CPP_testhdf5 PROPERTIES + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) ############################################################################## ############################################################################## diff --git a/c++/test/CMakeVFDTests.cmake b/c++/test/CMakeVFDTests.cmake index ced9b0c..92b7340 100644 --- a/c++/test/CMakeVFDTests.cmake +++ b/c++/test/CMakeVFDTests.cmake @@ -22,19 +22,15 @@ H5_CREATE_VFD_DIR() ### T H E T E S T S M A C R O S ### ############################################################################## ############################################################################## - +set (CPP_VFD_CLEANFILES + *-cpp_testhdf5.out + *-cpp_testhdf5.out.err +) macro (ADD_VFD_TEST vfdname resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME CPP_VFD-${vfdname}-cpp_testhdf5-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove - tattr_basic.h5 - tattr_compound.h5 - tattr_dtype.h5 - tattr_multi.h5 - tattr_scalar.h5 - tfattrs.h5 - titerate.h5 + COMMAND ${CMAKE_COMMAND} -E remove ${CPP_VFD_CLEANFILES} WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${vfdname} ) add_test ( @@ -51,6 +47,12 @@ macro (ADD_VFD_TEST vfdname resultcode) ) set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES DEPENDS CPP_VFD-${vfdname}-cpp_testhdf5-clear-objects) set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5 PROPERTIES TIMEOUT ${CTEST_SHORT_TIMEOUT}) + add_test ( + NAME CPP_VFD-${vfdname}-cpp_testhdf5-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove ${CPP_VFD_CLEANFILES} + WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${vfdname} + ) + set_tests_properties (CPP_VFD-${vfdname}-cpp_testhdf5-clean-objects PROPERTIES DEPENDS CPP_VFD-${vfdname}-cpp_testhdf5) endif () endmacro () diff --git a/c++/test/dsets.cpp b/c++/test/dsets.cpp index 6d2753e..389d26c 100644 --- a/c++/test/dsets.cpp +++ b/c++/test/dsets.cpp @@ -1446,4 +1446,5 @@ extern "C" void cleanup_dsets() { HDremove(FILE1.c_str()); + HDremove(FILE_ACCPLIST.c_str()); } // cleanup_dsets diff --git a/c++/test/tobject.cpp b/c++/test/tobject.cpp index f040007..2f8220c 100644 --- a/c++/test/tobject.cpp +++ b/c++/test/tobject.cpp @@ -761,4 +761,7 @@ extern "C" void cleanup_object() { HDremove(FILE_OBJECTS.c_str()); + HDremove(FILE_OBJHDR.c_str()); + HDremove(FILE_OBJINFO.c_str()); + HDremove(FILE_INTERGRPS.c_str()); } // cleanup_objects diff --git a/c++/test/ttypes.cpp b/c++/test/ttypes.cpp index c488f0e..b731d37 100644 --- a/c++/test/ttypes.cpp +++ b/c++/test/ttypes.cpp @@ -45,7 +45,8 @@ using namespace H5; /* #include "H5Tpkg.h" */ -const char *FILENAME[] = {"dtypes1.h5", "dtypes2.h5", "dtypes3.h5", "dtypes4.h5", NULL}; +const char *FILENAME[] = {"dtypes1.h5", "dtypes2.h5", "dtypes3.h5", "dtypes4.h5", + "encode_decode.h5", "h5_type_operators.h5", NULL}; typedef enum flt_t { FLT_FLOAT, FLT_DOUBLE, FLT_LDOUBLE, FLT_OTHER } flt_t; @@ -557,7 +558,6 @@ test_query() * January, 2007 *------------------------------------------------------------------------- */ -const char *filename1 = "dtypes1.h5"; static void test_transient() @@ -568,7 +568,7 @@ test_transient() try { // Create the file and the dataspace. - H5File file(filename1, H5F_ACC_TRUNC); + H5File file(FILENAME[0], H5F_ACC_TRUNC); DataSpace space(2, ds_size, ds_size); // Copying a predefined type results in a modifiable copy @@ -637,7 +637,6 @@ test_transient() * January, 2007 *------------------------------------------------------------------------- */ -const H5std_string filename2("dtypes2.h5"); static void test_named() @@ -649,7 +648,7 @@ test_named() SUBTEST("Named datatypes"); try { // Create the file. - H5File file(filename2, H5F_ACC_TRUNC); + H5File file(FILENAME[1], H5F_ACC_TRUNC); // Create a simple dataspace. DataSpace space(2, ds_size, ds_size); @@ -805,9 +804,8 @@ test_named() * August, 2017 *------------------------------------------------------------------------- */ -const H5std_string filename3("encode_decode.h5"); -const int ARRAY1_RANK = 1; -const int ARRAY1_DIM = 10; +const int ARRAY1_RANK = 1; +const int ARRAY1_DIM = 10; static void test_encode_decode() @@ -817,7 +815,7 @@ test_encode_decode() SUBTEST("DataType::encode() and DataType::decode()"); try { // Create the file. - H5File file(filename3, H5F_ACC_TRUNC); + H5File file(FILENAME[4], H5F_ACC_TRUNC); // // Test with CompType @@ -1026,7 +1024,6 @@ test_encode_decode() * August, 2017 *------------------------------------------------------------------------- */ -const H5std_string filename4("h5_type_operators.h5"); static void test_operators() @@ -1036,7 +1033,7 @@ test_operators() SUBTEST("DataType::operator== and DataType::operator!="); try { // Create the file. - H5File file(filename4, H5F_ACC_TRUNC); + H5File file(FILENAME[5], H5F_ACC_TRUNC); // // Test with CompType @@ -1140,6 +1137,6 @@ test_types() extern "C" void cleanup_types() { - for (int i = 0; i < 3; i++) + for (int i = 0; i < 6; i++) HDremove(FILENAME[i]); } // cleanup_types diff --git a/config/Makefile.am b/config/Makefile.am new file mode 100644 index 0000000..fcfd34e --- /dev/null +++ b/config/Makefile.am @@ -0,0 +1,248 @@ +# +# Copyright by The HDF Group. +# Copyright by the Board of Trustees of the University of Illinois. +# 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://www.hdfgroup.org/licenses. +# If you do not have access to either file, you may request a copy from +# help@hdfgroup.org. +## +## Makefile.am +## Run automake to generate a Makefile.in from this file. +## +# +# HDF5 Library Test Makefile(.in) +# + +include $(top_srcdir)/config/commence.am + +AM_CPPFLAGS+=-I$(top_srcdir)/src -I$(top_builddir)/src + +# Test scripts-- +# test_abort_fail.sh: filenotclosed.c and del_many_dense_attrs.c +# test_check_version.sh: tcheck_version +# test_error.sh: err_compat, error_test +# test_external_env.sh: external_env +# test_flush_refresh.sh: flushrefresh +# test_libinfo.sh: +# test_links_env.sh: links_env +# test_mirror.sh: mirror_vfd ../utils/mirror_vfd/* +# test_plugin.sh: filter_plugin.c vfd_plugin.c vol_plugin.c +# test_swmr.sh: swmr* +# test_vds_env.sh: vds_env +# test_vds_swmr.sh: vds_swmr* +# test_use_cases.sh: use_append_chunk, use_append_mchunks, use_disable_mdc_flushes +TEST_SCRIPT = test_abort_fail.sh test_check_version.sh test_error.sh \ + test_flush_refresh.sh test_external_env.sh test_libinfo.sh \ + test_links_env.sh test_swmr.sh test_vds_env.sh test_vds_swmr.sh \ + test_use_cases.sh +SCRIPT_DEPEND = error_test$(EXEEXT) err_compat$(EXEEXT) links_env$(EXEEXT) \ + external_env$(EXEEXT) filenotclosed$(EXEEXT) del_many_dense_attrs$(EXEEXT) \ + flushrefresh$(EXEEXT) use_append_chunk$(EXEEXT) use_append_mchunks$(EXEEXT) use_disable_mdc_flushes$(EXEEXT) \ + swmr_generator$(EXEEXT) swmr_reader$(EXEEXT) swmr_writer$(EXEEXT) \ + swmr_remove_reader$(EXEEXT) swmr_remove_writer$(EXEEXT) swmr_addrem_writer$(EXEEXT) \ + swmr_sparse_reader$(EXEEXT) swmr_sparse_writer$(EXEEXT) swmr_start_write$(EXEEXT) \ + vds_env$(EXEEXT) vds_swmr_gen$(EXEEXT) vds_swmr_reader$(EXEEXT) vds_swmr_writer$(EXEEXT) +if HAVE_SHARED_CONDITIONAL + TEST_SCRIPT += test_plugin.sh + SCRIPT_DEPEND += filter_plugin$(EXEEXT) vfd_plugin $(EXEEXT) vol_plugin$(EXEEXT) +endif +if MIRROR_VFD_CONDITIONAL + TEST_SCRIPT += test_mirror.sh +endif + +check_SCRIPTS = $(TEST_SCRIPT) + +# These are our main targets. They should be listed in the order to be +# executed, generally most specific tests to least specific tests. +# As an exception, long-running tests should occur earlier in the list. +# This gives them more time to run when tests are executing in parallel. +TEST_PROG= testhdf5 \ + cache cache_api cache_image cache_tagging lheap ohdr \ + stab gheap evict_on_close farray earray btree2 fheap \ + accum hyperslab istore bittests dt_arith page_buffer \ + dtypes dsets chunk_info cmpd_dset cmpd_dtransform filter_fail extend direct_chunk \ + external efc objcopy objcopy_ref links unlink twriteorder big mtime \ + fillval mount \ + flush1 flush2 app_ref enum set_extent ttsafe enc_dec_plist \ + enc_dec_plist_cross_platform getname vfd ros3 s3comms hdfs ntypes \ + dangle dtransform reserved cross_read freespace mf vds file_image \ + unregister cache_logging cork swmr thread_id vol timer event_set + +# List programs to be built when testing here +# +# error_test and err_compat are built at the same time as the other tests, but executed by test_error.sh +# tcheck_version is used by test_check_version.sh +# accum_swmr_reader is used by accum.c +# atomic_writer and atomic_reader are stand-alone programs +# links_env is used by test_links_env.sh +# external_env is used by test_external_env.sh +# filenotclosed and del_many_dense_attrs are used by test_abort_fail.sh +# flushrefresh is used by test_flush_refresh.sh +# use_append_chunk, use_append_mchunks and use_disable_mdc_flushes are used by test_use_cases.sh +# swmr_* files (besides swmr.c) are used by test_swmr.sh +# vds_swmr_* files are used by test_vds_swmr.sh +# vds_env is used by test_vds_env.sh +# mirror_vfd is used by test_mirror.sh +# +# 'make check' doesn't run them directly, so they are not included in TEST_PROG. +# +# Also build testmeta, which is used for the timing test. It builds quickly +# and this lets automake keep all its test programs in one place. +check_PROGRAMS=$(TEST_PROG) error_test err_compat tcheck_version \ + testmeta accum_swmr_reader atomic_writer atomic_reader external_env \ + links_env filenotclosed del_many_dense_attrs flushrefresh \ + use_append_chunk use_append_chunk_mirror use_append_mchunks use_disable_mdc_flushes \ + swmr_generator swmr_start_write swmr_reader swmr_writer swmr_remove_reader \ + swmr_remove_writer swmr_addrem_writer swmr_sparse_reader swmr_sparse_writer \ + vds_env vds_swmr_gen vds_swmr_reader vds_swmr_writer +if HAVE_SHARED_CONDITIONAL + check_PROGRAMS+= filter_plugin vfd_plugin vol_plugin +endif +if MIRROR_VFD_CONDITIONAL + check_PROGRAMS+= mirror_vfd +endif + +# These programs generate test files for the tests. They don't need to be +# compiled every time we want to test the library. However, putting +# them in a conditional causes automake to generate rules so that they +# can be built by hand. They can also be built by specifying +# --enable-build-all at configure time. +# The gen_old_* files can only be compiled with older versions of the library +# so do not appear in this list. +BUILD_ALL_PROGS=gen_bad_ohdr gen_bogus gen_cross gen_deflate gen_filters gen_new_array \ + gen_new_fill gen_new_group gen_new_mtime gen_new_super gen_noencoder \ + gen_nullspace gen_udlinks space_overflow gen_filespace gen_specmetaread \ + gen_sizes_lheap gen_file_image gen_plist gen_bad_offset gen_bounds + +if BUILD_ALL_CONDITIONAL + noinst_PROGRAMS=$(BUILD_ALL_PROGS) +endif + +if HAVE_SHARED_CONDITIONAL + # The libh5test library provides common support code for the tests. + # The filter_plugin* libraries are for use in filter_plugin.c. + # Build them as shared libraries if that option was enabled in configure. + noinst_LTLIBRARIES=libh5test.la libfilter_plugin1_dsets.la libfilter_plugin2_dsets.la libfilter_plugin3_dsets.la libfilter_plugin4_groups.la libnull_vfd_plugin.la libnull_vol_connector.la + libfilter_plugin1_dsets_la_SOURCES=filter_plugin1_dsets.c + libfilter_plugin2_dsets_la_SOURCES=filter_plugin2_dsets.c + libfilter_plugin3_dsets_la_SOURCES=filter_plugin3_dsets.c + libfilter_plugin4_groups_la_SOURCES=filter_plugin4_groups.c + libfilter_plugin1_dsets_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere + libfilter_plugin2_dsets_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere + libfilter_plugin3_dsets_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere + libfilter_plugin4_groups_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere + libfilter_plugin3_dsets_la_LIBADD=$(LIBHDF5) + libfilter_plugin4_groups_la_LIBADD=$(LIBHDF5) + + # VFD plugin test libraries + # + # null_vfd_plugin is used for testing basic VFD plugin functionality. + libnull_vfd_plugin_la_SOURCES=null_vfd_plugin.c + libnull_vfd_plugin_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere + + # VOL plugin test libraries + # + # null_vol_connector is used for testing basic VOL plugin functionality. + libnull_vol_connector_la_SOURCES=null_vol_connector.c + libnull_vol_connector_la_LDFLAGS=$(AM_LDFLAGS) -avoid-version -module -shared -export-dynamic -rpath /nowhere + +else + # The libh5test library provides common support code for the tests. + noinst_LTLIBRARIES=libh5test.la +endif + +libh5test_la_SOURCES=h5test.c testframe.c cache_common.c swmr_common.c external_common.c + +# Use libhd5test.la to compile all of the tests +LDADD=libh5test.la $(LIBHDF5) + +# List the source files for tests that have more than one +ttsafe_SOURCES=ttsafe.c ttsafe_dcreate.c ttsafe_error.c ttsafe_cancel.c \ + ttsafe_acreate.c ttsafe_attr_vlen.c +cache_image_SOURCES=cache_image.c genall5.c +mirror_vfd_SOURCES=mirror_vfd.c genall5.c + +# Additional target for running timing test +timings _timings: testmeta + @for timing in $(TIMINGS) dummy; do \ + if test $$timing != dummy; then \ + echo "Running $$timing $(TEST_FLAGS)"; \ + $(RUNEXEC) ./$$timing $(TEST_FLAGS) || exit 1; \ + fi; \ + done; + +# The flush1 test must run before the flush2 test +flush2.chkexe_: flush1.chkexe_ + +# Temporary files. These files are the ones created by setting the +# HDF5_NOCLEANUP environment variable and running `make test' without +# specifying a file prefix or low-level driver. Changing the file +# prefix or low-level driver with environment variables will influence +# the temporary file name in ways that the makefile is not aware of. +CHECK_CLEANFILES+=accum.h5 cmpd_dset.h5 compact_dataset.h5 dataset.h5 dset_offset.h5 \ + max_compact_dataset.h5 simple.h5 set_local.h5 random_chunks.h5 \ + huge_chunks.h5 chunk_cache.h5 big_chunk.h5 chunk_fast.h5 chunk_expand.h5 \ + chunk_fixed.h5 copy_dcpl_newfile.h5 partial_chunks.h5 layout_extend.h5 \ + zero_chunk.h5 chunk_single.h5 swmr_non_latest.h5 \ + earray_hdr_fd.h5 farray_hdr_fd.h5 bt2_hdr_fd.h5 \ + storage_size.h5 dls_01_strings.h5 power2up.h5 version_bounds.h5 \ + alloc_0sized.h5 h5s_block.h5 h5s_plist.h5 \ + extend.h5 istore.h5 extlinks*.h5 frspace.h5 links*.h5 \ + sys_file1 tfile[1-7].h5 th5s[1-4].h5 lheap.h5 fheap.h5 ohdr.h5 \ + stab.h5 extern_[1-5].h5 extern_[1-4][rw].raw gheap[0-4].h5 \ + ohdr_min_a.h5 ohdr_min_b.h5 min_dset_ohdr_testfile.h5 \ + dt_arith[1-2] links.h5 links[0-6]*.h5 extlinks[0-15].h5 \ + tmp tmp_links tmp2_links tmp_links_env tmp_vds tmp_vds_env \ + big.data big[0-9][0-9][0-9][0-9][0-9].h5 \ + stdio.h5 sec2.h5 dtypes[0-9].h5 dtypes1[0].h5 dt_arith[1-2].h5 tattr.h5 \ + tselect.h5 mtime.h5 unlink.h5 unicode.h5 coord.h5 \ + fillval_[0-9].h5 fillval.raw mount_[0-9].h5 testmeta.h5 ttime.h5 \ + trefer[1-3].h5 trefer_*.h5 tvltypes.h5 tvlstr.h5 tvlstr2.h5 twriteorder.dat \ + flush.h5 flush-swmr.h5 noflush.h5 noflush-swmr.h5 flush_extend.h5 \ + flush_extend-swmr.h5 noflush_extend.h5 noflush_extend-swmr.h5 \ + enum1.h5 titerate.h5 ttsafe.h5 tarray1.h5 tgenprop.h5 \ + tmisc[0-9]*.h5 set_extent[1-5].h5 ext[12].bin \ + getname.h5 getname[1-3].h5 sec2_file.h5 direct_file.h5 \ + family_file000[0-3][0-9].h5 new_family_v16-000[0-3][0-9].h5 \ + multi_file-[rs].h5 core_file filter_plugin.h5 \ + new_move_[ab].h5 ntypes.h5 dangle.h5 error_test.h5 err_compat.h5 \ + dtransform.h5 test_filters.h5 get_file_name.h5 tstint[1-2].h5 \ + unlink_chunked.h5 btree2.h5 btree2_tmp.h5 objcopy_src.h5 objcopy_dst.h5 \ + objcopy_ext.dat app_ref.h5 farray.h5 farray_tmp.h5 \ + earray.h5 earray_tmp.h5 efc[0-5].h5 log_vfd_out.log log_ros3_out.log \ + log_s3comms_out.log new_multi_file_v16-r.h5 new_multi_file_v16-s.h5 \ + split_get_file_image_test-m.h5 split_get_file_image_test-r.h5 \ + file_image_core_test.h5.copy unregister_filter_1.h5 unregister_filter_2.h5 \ + vds_virt.h5 vds_dapl.h5 vds_src_[0-1].h5 \ + swmr_data.h5 use_use_append_chunk.h5 use_append_mchunks.h5 \ + use_disable_mdc_flushes.h5 flushrefresh.h5 flushrefresh_VERIFICATION_START \ + flushrefresh_VERIFICATION_CHECKPOINT1 flushrefresh_VERIFICATION_CHECKPOINT2 \ + flushrefresh_VERIFICATION_DONE filenotclosed.h5 del_many_dense_attrs.h5 \ + atomic_data accum_swmr_big.h5 ohdr_swmr.h5 \ + test_swmr*.h5 cache_logging.h5 cache_logging.out vds_swmr.h5 vds_swmr_src_*.h5 \ + swmr[0-2].h5 swmr_writer.out swmr_writer.log.* swmr_reader.out.* swmr_reader.log.* \ + tbogus.h5.copy cache_image_test.h5 direct_chunk.h5 native_vol_test.h5 \ + splitter*.h5 splitter.log mirror_rw mirror_ro event_set_[0-9].h5 + +# Sources for testhdf5 executable +testhdf5_SOURCES=testhdf5.c tarray.c tattr.c tchecksum.c tconfig.c tfile.c \ + tgenprop.c th5o.c th5s.c tcoords.c tid.c titerate.c tmeta.c tmisc.c \ + trefer.c trefer_deprec.c trefstr.c tselect.c tskiplist.c tsohm.c ttime.c tunicode.c \ + tvlstr.c tvltypes.c + +# Sources for Use Cases +use_append_chunk_SOURCES=use_append_chunk.c use_common.c +use_append_chunk_mirror_SOURCES=use_append_chunk_mirror.c use_common.c +use_append_mchunks_SOURCES=use_append_mchunks.c use_common.c +use_disable_mdc_flushes_SOURCES=use_disable_mdc_flushes.c + +# Temporary files. +DISTCLEANFILES=testerror.sh testlibinfo.sh testcheck_version.sh testlinks_env.sh test_filter_plugin.sh \ + testexternal_env.sh testswmr.sh testvds_env.sh testvdsswmr.sh test_usecases.sh testflushrefresh.sh \ + testabort_fail.sh test_vol_plugin.sh test_mirror.sh + +include $(top_srcdir)/config/conclude.am diff --git a/config/cmake/CTestCustom.cmake b/config/cmake/CTestCustom.cmake index 9517e4b..1661216 100644 --- a/config/cmake/CTestCustom.cmake +++ b/config/cmake/CTestCustom.cmake @@ -55,19 +55,32 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE H5TEST-vds_env-clear-objects PERFORM_h5perform-clear-objects HL_test-clear-objects + HL_test-clean-objects HL_FORTRAN_test-clear-objects + HL_FORTRAN_test-clean-objects FORTRAN_testhdf5-clear-objects + FORTRAN_testhdf5-clean-objects FORTRAN_flush1-clear-objects + FORTRAN_flush1-clean-objects CPP_testhdf5-clear-objects + CPP_testhdf5-clean-objects ######### examples ######### EXAMPLES-clear-objects + EXAMPLES-clean-objects CPP_ex-clear-objects + CPP_ex-clean-objects CPP_ex_tutr-clear-objects + CPP_ex_tutr-clean-objects HL_ex-clear-objects + HL_ex-clean-objects f90_ex-clear-objects + f90_ex-clean-objects HL_CPP_ptableTest-clear-objects + HL_CPP_ptableTest-clean-objects HL_CPP_ex_ptExampleFL-clear-objects + HL_CPP_ex_ptExampleFL-clean-objects HL_FORTRAN_f90_ex-clear-objects + HL_FORTRAN_f90_ex-clean-objects ######### tools/h5clear ######### H5CLEAR-clearall-objects H5CLEAR-h5clear_gentest # does not close ids by design @@ -187,5 +200,7 @@ set (CTEST_CUSTOM_MEMCHECK_IGNORE PERFORM_h5perform-clearall-objects ######### hl/tools ######### HL_TOOLS-clear-objects + HL_TOOLS-clean-objects H5WATCH-clearall-objects + H5WATCH-cleanall-objects ) diff --git a/config/cmake/jrunTest.cmake b/config/cmake/jrunTest.cmake index 13e50dd..be856c5 100644 --- a/config/cmake/jrunTest.cmake +++ b/config/cmake/jrunTest.cmake @@ -298,6 +298,22 @@ if (TEST_SKIP_COMPARE AND NOT TEST_NO_DISPLAY) endif () endif () +if (NOT DEFINED ENV{HDF5_NOCLEANUP}) + if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}") + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}) + endif () + + if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err") + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err) + endif () + + if (TEST_DELETE_LIST) + foreach (dfile in ${TEST_DELETE_LIST}) + file (REMOVE ${dfile}) + endforeach () + endif () +endif () + # everything went fine... message (STATUS "${TEST_PROGRAM} Passed") diff --git a/config/cmake/vfdTest.cmake b/config/cmake/vfdTest.cmake index f5a4e3e..fadc67f 100644 --- a/config/cmake/vfdTest.cmake +++ b/config/cmake/vfdTest.cmake @@ -72,5 +72,21 @@ endif () message (STATUS "COMMAND Error: ${TEST_ERROR}") +if (NOT DEFINED ENV{HDF5_NOCLEANUP}) + if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}") + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}) + endif () + + if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err") + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err) + endif () + + if (TEST_DELETE_LIST) + foreach (dfile in ${TEST_DELETE_LIST}) + file (REMOVE ${dfile}) + endforeach () + endif () +endif () + # everything went fine... message (STATUS "Passed: The ${TEST_PROGRAM} program used vfd ${TEST_VFD}") diff --git a/config/cmake/volTest.cmake b/config/cmake/volTest.cmake index 27ef8a2..a47c3e9 100644 --- a/config/cmake/volTest.cmake +++ b/config/cmake/volTest.cmake @@ -72,5 +72,21 @@ endif () message (STATUS "COMMAND Error: ${TEST_ERROR}") +if (NOT DEFINED ENV{HDF5_NOCLEANUP}) + if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}") + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}) + endif () + + if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err") + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err) + endif () + + if (TEST_DELETE_LIST) + foreach (dfile in ${TEST_DELETE_LIST}) + file (REMOVE ${dfile}) + endforeach () + endif () +endif () + # everything went fine... message (STATUS "Passed: The ${TEST_PROGRAM} program used vol ${TEST_VOL}") diff --git a/config/cmake_ext_mod/grepTest.cmake b/config/cmake_ext_mod/grepTest.cmake index 631fca6..3b0baf5 100644 --- a/config/cmake_ext_mod/grepTest.cmake +++ b/config/cmake_ext_mod/grepTest.cmake @@ -190,6 +190,22 @@ if (TEST_FILTER) endif () endif () +if (NOT DEFINED ENV{HDF5_NOCLEANUP}) + if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}") + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}) + endif () + + if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err") + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err) + endif () + + if (TEST_DELETE_LIST) + foreach (dfile in ${TEST_DELETE_LIST}) + file (REMOVE ${dfile}) + endforeach () + endif () +endif () + # everything went fine... message (STATUS "Passed: The output of ${TEST_PROGRAM} matched") diff --git a/config/cmake_ext_mod/runTest.cmake b/config/cmake_ext_mod/runTest.cmake index b373fe4..ad72a9e 100644 --- a/config/cmake_ext_mod/runTest.cmake +++ b/config/cmake_ext_mod/runTest.cmake @@ -376,6 +376,22 @@ if (TEST_SKIP_COMPARE AND NOT TEST_NO_DISPLAY) ) endif () +if (NOT DEFINED ENV{HDF5_NOCLEANUP}) + if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}" AND NOT TEST_SAVE) + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}) + endif () + + if (EXISTS "${TEST_FOLDER}/${TEST_OUTPUT}.err") + file (REMOVE ${TEST_FOLDER}/${TEST_OUTPUT}.err) + endif () + + if (TEST_DELETE_LIST) + foreach (dfile in ${TEST_DELETE_LIST}) + file (REMOVE ${dfile}) + endforeach () + endif () +endif () + # everything went fine... message (STATUS "${TEST_PROGRAM} Passed") diff --git a/examples/CMakeTests.cmake b/examples/CMakeTests.cmake index 3e24ba0..d81adfc 100644 --- a/examples/CMakeTests.cmake +++ b/examples/CMakeTests.cmake @@ -37,6 +37,9 @@ set (test_ex_CLEANFILES only_huge_mesgs_file.h5 REF_REG.h5 refere.h5 + refer_deprec.h5 + refer_extern1.h5 + refer_extern2.h5 SDS.h5 SDScompound.h5 SDSextendible.h5 @@ -70,7 +73,18 @@ if (HDF5_TEST_SERIAL) NAME EXAMPLES-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${test_ex_CLEANFILES} ) - set_tests_properties (EXAMPLES-clear-objects PROPERTIES FIXTURES_SETUP clear_EXAMPLES) + set_tests_properties (EXAMPLES-clear-objects PROPERTIES + FIXTURES_SETUP clear_EXAMPLES + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + ) + add_test ( + NAME EXAMPLES-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove ${test_ex_CLEANFILES} + ) + set_tests_properties (EXAMPLES-clean-objects PROPERTIES + FIXTURES_CLEANUP clear_EXAMPLES + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + ) foreach (example ${examples}) if (HDF5_ENABLE_USING_MEMCHECKER) @@ -102,6 +116,27 @@ if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL AND NOT WIN32) # The number 24 corresponds to SPACE1_DIM1 and SPACE1_DIM2 defined in ph5example.c math(EXPR NUMPROCS "24 / ((24 + ${MPIEXEC_MAX_NUMPROCS} - 1) / ${MPIEXEC_MAX_NUMPROCS})") + set (mpi_test_ex_CLEANFILES + ) + + # Remove any output file left over from previous test run + add_test ( + NAME MPI_TEST_EXAMPLES-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${mpi_test_ex_CLEANFILES} + ) + set_tests_properties (MPI_TEST_EXAMPLES-clear-objects PROPERTIES + FIXTURES_SETUP clear_MPI_TEST_EXAMPLES + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + ) + add_test ( + NAME MPI_TEST_EXAMPLES-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove ${mpi_test_ex_CLEANFILES} + ) + set_tests_properties (MPI_TEST_EXAMPLES-clean-objects PROPERTIES + FIXTURES_CLEANUP clear_MPI_TEST_EXAMPLES + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + ) + foreach (parallel_example ${parallel_examples}) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME MPI_TEST_EXAMPLES-${parallel_example} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:${parallel_example}> ${MPIEXEC_POSTFLAGS}) @@ -118,6 +153,7 @@ if (H5_HAVE_PARALLEL AND HDF5_TEST_PARALLEL AND NOT WIN32) -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) endif () + set_tests_properties (MPI_TEST_EXAMPLES-${parallel_example} PROPERTIES FIXTURES_REQUIRED clear_MPI_TEST_EXAMPLES) if (last_test) set_tests_properties (MPI_TEST_EXAMPLES-${parallel_example} PROPERTIES DEPENDS ${last_test}) endif () diff --git a/fortran/examples/CMakeTests.cmake b/fortran/examples/CMakeTests.cmake index e59d6f8..d43a0f7 100644 --- a/fortran/examples/CMakeTests.cmake +++ b/fortran/examples/CMakeTests.cmake @@ -40,7 +40,18 @@ if (HDF5_TEST_SERIAL) NAME f90_ex-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${test_ex_fortran_CLEANFILES} ) - set_tests_properties (f90_ex-clear-objects PROPERTIES FIXTURES_SETUP clear_f90_ex) + set_tests_properties (f90_ex-clear-objects PROPERTIES + FIXTURES_SETUP clear_f90_ex + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + ) + add_test ( + NAME f90_ex-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove ${test_ex_fortran_CLEANFILES} + ) + set_tests_properties (f90_ex-clean-objects PROPERTIES + FIXTURES_CLEANUP clear_f90_ex + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} + ) foreach (example ${examples}) if (HDF5_ENABLE_USING_MEMCHECKER) diff --git a/fortran/test/CMakeTests.cmake b/fortran/test/CMakeTests.cmake index 0588416..8c4d897 100644 --- a/fortran/test/CMakeTests.cmake +++ b/fortran/test/CMakeTests.cmake @@ -27,11 +27,12 @@ set (testhdf5_fortran_CLEANFILES extern_2a.raw extern_3a.raw extern_4a.raw - extren_raw.raw + extern_raw.h5 get_info.h5 nbit.h5 t_array_F03.h5 t_bit_F03.h5 + t_controlchar.h5 t_controlchar_F03.h5 t_enum_F03.h5 t_objref_F03.h5 @@ -39,6 +40,7 @@ set (testhdf5_fortran_CLEANFILES t_regref_F03.h5 t_string_F03.h5 t_vlen_F03.h5 + t_vlstring.h5 t_vlstring_F03.h5 t_vlstringrw_F03.h5 tarray1.h5 @@ -50,6 +52,7 @@ set (testhdf5_fortran_CLEANFILES titerate.h5 vds.h5 visit.h5 + voltest.h5 ) # Remove any output file left over from previous test run @@ -57,7 +60,18 @@ add_test ( NAME FORTRAN_testhdf5-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${testhdf5_fortran_CLEANFILES} ) -set_tests_properties (FORTRAN_testhdf5-clear-objects PROPERTIES FIXTURES_SETUP clear_testhdf5_fortran) +set_tests_properties (FORTRAN_testhdf5-clear-objects PROPERTIES + FIXTURES_SETUP clear_testhdf5_fortran + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) +add_test ( + NAME FORTRAN_testhdf5-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove ${testhdf5_fortran_CLEANFILES} +) +set_tests_properties (FORTRAN_testhdf5-clean-objects PROPERTIES + FIXTURES_CLEANUP clear_testhdf5_fortran + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME FORTRAN_testhdf5_fortran COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:testhdf5_fortran>) @@ -147,6 +161,9 @@ else () -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () +set_tests_properties (FORTRAN_vol_connector PROPERTIES + FIXTURES_REQUIRED clear_testhdf5_fortran +) #-- Adding test for fflush1 add_test ( @@ -169,3 +186,10 @@ add_test ( set_tests_properties (FORTRAN_fflush2 PROPERTIES DEPENDS FORTRAN_fflush1 ) +add_test ( + NAME FORTRAN_flush1-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove flush.h5 +) +set_tests_properties (FORTRAN_flush1-clean-objects PROPERTIES + DEPENDS FORTRAN_fflush2 +) diff --git a/fortran/test/tH5P_F03.F90 b/fortran/test/tH5P_F03.F90 index 43dd1c0..acd5a6a 100644 --- a/fortran/test/tH5P_F03.F90 +++ b/fortran/test/tH5P_F03.F90 @@ -567,7 +567,7 @@ SUBROUTINE external_test_offset(cleanup,total_error) ! ! Create the file and an initial group. CALL h5pcreate_f(H5P_FILE_ACCESS_F, fapl, error) - CALL h5fcreate_f('extren_raw.h5', H5F_ACC_TRUNC_F, file, error, access_prp=fapl) + CALL h5fcreate_f('extern_raw.h5', H5F_ACC_TRUNC_F, file, error, access_prp=fapl) CALL check("h5fcreate_f",error,total_error) CALL h5gcreate_f(file, "emit-diagnostics", grp, error) @@ -646,7 +646,7 @@ SUBROUTINE external_test_offset(cleanup,total_error) CALL h5_cleanup_f(filename, H5P_DEFAULT_F, error) CALL check("h5_cleanup_f", error, total_error) ENDDO - IF(cleanup) CALL h5_cleanup_f("extren_raw.h5", H5P_DEFAULT_F, error) + IF(cleanup) CALL h5_cleanup_f("extern_raw.h5", H5P_DEFAULT_F, error) CALL check("h5_cleanup_f", error, total_error) END SUBROUTINE external_test_offset diff --git a/hl/c++/examples/CMakeTests.cmake b/hl/c++/examples/CMakeTests.cmake index 82b32cf..f72b2a0 100644 --- a/hl/c++/examples/CMakeTests.cmake +++ b/hl/c++/examples/CMakeTests.cmake @@ -16,12 +16,16 @@ ############################################################################## ############################################################################## # Remove any output file left over from previous test run +set (HL_CPP_EX_PT_CLEANFILES + PTcppexampleFL.h5 +) add_test ( NAME HL_CPP_ex_ptExampleFL-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove - PTcppexampleFL.h5 - ptExampleFL.txt + -E remove ${HL_CPP_EX_PT_CLEANFILES} +) +set_tests_properties (HL_CPP_ex_ptExampleFL-clear-objects PROPERTIES + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} ) if (HDF5_ENABLE_USING_MEMCHECKER) @@ -40,3 +44,12 @@ else () ) endif () set_tests_properties (HL_CPP_ex_ptExampleFL PROPERTIES DEPENDS HL_CPP_ex_ptExampleFL-clear-objects) +add_test ( + NAME HL_CPP_ex_ptExampleFL-clean-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${HL_CPP_EX_PT_CLEANFILES} +) +set_tests_properties (HL_CPP_ex_ptExampleFL-clean-objects PROPERTIES + DEPENDS HL_CPP_ex_ptExampleFL + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) diff --git a/hl/c++/test/CMakeTests.cmake b/hl/c++/test/CMakeTests.cmake index 28ee5df..fa2a3f2 100644 --- a/hl/c++/test/CMakeTests.cmake +++ b/hl/c++/test/CMakeTests.cmake @@ -15,12 +15,19 @@ ### T E S T I N G ### ############################################################################## ############################################################################## - +# Remove any output file left over from previous test run +set (HL_CPP_PT_CLEANFILES + packettest.h5 +) add_test ( NAME HL_CPP_ptableTest-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove ${example}.txt + -E remove ${HL_CPP_PT_CLEANFILES} ) +set_tests_properties (HL_CPP_ptableTest-clear-objects PROPERTIES + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) + if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME HL_CPP_ptableTest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:hl_ptableTest>) else () @@ -37,3 +44,12 @@ else () ) endif () set_tests_properties (HL_CPP_ptableTest PROPERTIES DEPENDS HL_CPP_ptableTest-clear-objects) +add_test ( + NAME HL_CPP_ptableTest-clean-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${HL_CPP_PT_CLEANFILES} +) +set_tests_properties (HL_CPP_ptableTest-clean-objects PROPERTIES + DEPENDS HL_CPP_ptableTest + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) diff --git a/hl/examples/CMakeTests.cmake b/hl/examples/CMakeTests.cmake index b997096..1fdbc14 100644 --- a/hl/examples/CMakeTests.cmake +++ b/hl/examples/CMakeTests.cmake @@ -27,31 +27,45 @@ endforeach () add_custom_target(hl_ex_ex_ds1_files ALL COMMENT "Copying files needed by hl_ex_ex_ds1 tests" DEPENDS ${hl_ex_ex_ds1_files_list}) # Remove any output file left over from previous test run +set (HL_EX_CLEANFILES + ex_lite1.h5 + ex_lite2.h5 + ex_lite3.h5 + packet_table_FLexample.h5 + ex_image1.h5 + ex_image2.h5 + ex_table_01.h5 + ex_table_02.h5 + ex_table_03.h5 + ex_table_04.h5 + ex_table_05.h5 + ex_table_06.h5 + ex_table_07.h5 + ex_table_08.h5 + ex_table_09.h5 + ex_table_10.h5 + ex_table_11.h5 + ex_table_12.h5 + ex_ds1.h5 +) add_test ( NAME HL_ex-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove - ex_lite1.h5 - ex_lite2.h5 - ex_lite3.h5 - packet_table_FLexample.h5 - ex_image1.h5 - ex_image2.h5 - ex_table_01.h5 - ex_table_02.h5 - ex_table_03.h5 - ex_table_04.h5 - ex_table_05.h5 - ex_table_06.h5 - ex_table_07.h5 - ex_table_08.h5 - ex_table_09.h5 - ex_table_10.h5 - ex_table_11.h5 - ex_table_12.h5 - ex_ds1.h5 + -E remove ${HL_EX_CLEANFILES} +) +set_tests_properties (HL_ex-clear-objects PROPERTIES + FIXTURES_SETUP clear_HL_ex + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) +add_test ( + NAME HL_ex-clean-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${HL_EX_CLEANFILES} +) +set_tests_properties (HL_ex-clean-objects PROPERTIES + FIXTURES_CLEANUP clear_HL_ex + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} ) -set_tests_properties (HL_ex-clear-objects PROPERTIES FIXTURES_SETUP clear_HL_ex) foreach (example ${examples}) if (HDF5_ENABLE_USING_MEMCHECKER) diff --git a/hl/fortran/examples/CMakeTests.cmake b/hl/fortran/examples/CMakeTests.cmake index 2e73ad9..b51e657 100644 --- a/hl/fortran/examples/CMakeTests.cmake +++ b/hl/fortran/examples/CMakeTests.cmake @@ -17,14 +17,28 @@ ############################################################################## # Remove any output file left over from previous test run +set (HL_FORTRAN_F90_EX_CLEANFILES + ex_ds1.h5 + exlite.h5 +) add_test ( NAME HL_FORTRAN_f90_ex-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove - ex_ds1.h5 - exlite.h5 + -E remove ${HL_FORTRAN_F90_EX_CLEANFILES} +) +set_tests_properties (HL_FORTRAN_f90_ex-clear-objects PROPERTIES + FIXTURES_SETUP clear_HL_FORTRAN_f90_ex + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) +add_test ( + NAME HL_FORTRAN_f90_ex-clean-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${HL_FORTRAN_F90_EX_CLEANFILES} +) +set_tests_properties (HL_FORTRAN_f90_ex-clean-objects PROPERTIES + FIXTURES_CLEANUP clear_HL_FORTRAN_f90_ex + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} ) -set_tests_properties (HL_FORTRAN_f90_ex-clear-objects PROPERTIES FIXTURES_SETUP clear_HL_FORTRAN_f90_ex) foreach (example ${examples}) if (HDF5_ENABLE_USING_MEMCHECKER) @@ -44,5 +58,6 @@ foreach (example ${examples}) endif () set_tests_properties (HL_FORTRAN_f90_ex_${example} PROPERTIES FIXTURES_REQUIRED clear_HL_FORTRAN_f90_ex + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} ) endforeach () diff --git a/hl/fortran/test/CMakeTests.cmake b/hl/fortran/test/CMakeTests.cmake index bceb6ee..c33fb5f 100644 --- a/hl/fortran/test/CMakeTests.cmake +++ b/hl/fortran/test/CMakeTests.cmake @@ -17,15 +17,15 @@ ############################################################################## set (test_hl_fortran_CLEANFILES - dsetf1.h5 - dsetf2.h5 - dsetf3.h5 - dsetf4.h5 - dsetf5.h5 - f1img.h5 - f1tab.h5 - f2tab.h5 - tstds.h5 + dsetf1.h5 + dsetf2.h5 + dsetf3.h5 + dsetf4.h5 + dsetf5.h5 + f1img.h5 + f1tab.h5 + f2tab.h5 + tstds.h5 ) # Remove any output file left over from previous test run @@ -34,7 +34,19 @@ add_test ( COMMAND ${CMAKE_COMMAND} -E remove ${test_hl_fortran_CLEANFILES} ) -set_tests_properties (HL_FORTRAN_test-clear-objects PROPERTIES FIXTURES_SETUP clear_HL_FORTRAN_test) +set_tests_properties (HL_FORTRAN_test-clear-objects PROPERTIES + FIXTURES_SETUP clear_HL_FORTRAN_test + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) +add_test ( + NAME HL_FORTRAN_test-clean-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${test_hl_fortran_CLEANFILES} +) +set_tests_properties (HL_FORTRAN_test-clean-objects PROPERTIES + FIXTURES_CLEANUP clear_HL_FORTRAN_test + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} +) macro (ADD_H5_FORTRAN_TEST file) if (HDF5_ENABLE_USING_MEMCHECKER) @@ -54,6 +66,7 @@ macro (ADD_H5_FORTRAN_TEST file) endif () set_tests_properties (HL_FORTRAN_f90_${file} PROPERTIES FIXTURES_REQUIRED clear_HL_FORTRAN_test + WORKING_DIRECTORY ${PROJECT_BINARY_DIR} ) endmacro () diff --git a/hl/test/CMakeTests.cmake b/hl/test/CMakeTests.cmake index e532253..9cbc30b 100644 --- a/hl/test/CMakeTests.cmake +++ b/hl/test/CMakeTests.cmake @@ -81,7 +81,18 @@ add_test ( NAME HL_test-clear-objects COMMAND ${CMAKE_COMMAND} -E remove ${test_hl_CLEANFILES} ) -set_tests_properties (HL_test-clear-objects PROPERTIES FIXTURES_SETUP clear_test_hl) +set_tests_properties (HL_test-clear-objects PROPERTIES + FIXTURES_SETUP clear_test_hl + WORKING_DIRECTORY ${HDF5_HL_TEST_BINARY_DIR} +) +add_test ( + NAME HL_test-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove ${test_hl_CLEANFILES} +) +set_tests_properties (HL_test-clean-objects PROPERTIES + FIXTURES_CLEANUP clear_test_hl + WORKING_DIRECTORY ${HDF5_HL_TEST_BINARY_DIR} +) # -------------------------------------------------------------------- # Macro used to add a unit test diff --git a/hl/tools/gif2h5/CMakeTests.cmake b/hl/tools/gif2h5/CMakeTests.cmake index 36ea5f9..b2a8e27 100644 --- a/hl/tools/gif2h5/CMakeTests.cmake +++ b/hl/tools/gif2h5/CMakeTests.cmake @@ -28,16 +28,24 @@ HDFTEST_COPY_FILE("${HDF5_HL_TOOLS_GIF2H5_SOURCE_DIR}/testfiles/ex_image2.h5" "$ add_custom_target(gif2h5_files ALL COMMENT "Copying files needed by gif2h5 tests" DEPENDS ${gif2h5_files_list}) # Remove any output file left over from previous test run +set (HL_TOOLS_CLEANFILES + image1.gif + image1.h5 + image.gif + image24.gif +) add_test ( NAME HL_TOOLS-clear-objects COMMAND ${CMAKE_COMMAND} - -E remove - image1.gif - image1.h5 - image.gif - image24.gif + -E remove ${HL_TOOLS_CLEANFILES} ) set_tests_properties (HL_TOOLS-clear-objects PROPERTIES FIXTURES_SETUP clear_tools_hl) +add_test ( + NAME HL_TOOLS-clean-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${HL_TOOLS_CLEANFILES} +) +set_tests_properties (HL_TOOLS-clean-objects PROPERTIES FIXTURES_CLEANUP clear_tools_hl) add_test (NAME HL_TOOLS_gif2h5 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:gif2h5${tgt_file_ext}> testfiles/image1.gif image1.h5) set_tests_properties (HL_TOOLS_gif2h5 PROPERTIES diff --git a/hl/tools/h5watch/CMakeTests.cmake b/hl/tools/h5watch/CMakeTests.cmake index b2f689b..84d491a 100644 --- a/hl/tools/h5watch/CMakeTests.cmake +++ b/hl/tools/h5watch/CMakeTests.cmake @@ -86,7 +86,7 @@ add_custom_target(H5WATCH_files ALL COMMENT "Copying files needed by H5WATCH tes DEPENDS ${last_test} FIXTURES_REQUIRED gen_test_watch ) - set (last_test "H5WATCH_ARGS-h5watch-${resultfile}") + set (last_test "H5WATCH_ARGS-h5watch-${resultfile}s") endif () endmacro () @@ -116,12 +116,6 @@ add_custom_target(H5WATCH_files ALL COMMENT "Copying files needed by H5WATCH tes macro (ADD_H5_WATCH resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5WATCH-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} - -E remove ${resultfile}.h5 - ) - set_tests_properties (H5WATCH-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - add_test ( NAME H5WATCH-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" @@ -134,7 +128,7 @@ add_custom_target(H5WATCH_files ALL COMMENT "Copying files needed by H5WATCH tes -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5WATCH-${resultfile} PROPERTIES - DEPENDS H5WATCH-${resultfile}-clear-objects + DEPENDS ${last_test} FIXTURES_REQUIRED gen_test_watch ) set (last_test "H5WATCH-${resultfile}") @@ -164,7 +158,12 @@ set_tests_properties (H5WATCH-clearall-objects PROPERTIES FIXTURES_REQUIRED swmr if (last_test) set_tests_properties (H5WATCH-clearall-objects PROPERTIES DEPENDS ${last_test}) endif () -set (last_test "H5WATCH-clearall-objects") +set (last_test "H5WATCH-cleanall-objects") +add_test ( + NAME H5WATCH-cleanall-objects + COMMAND ${CMAKE_COMMAND} -E remove WATCH.h5 +) +set_tests_properties (H5WATCH-cleanall-objects PROPERTIES FIXTURES_CLEANUP swmr_vfd_check_compat) ################################################################################################# # # @@ -189,7 +188,7 @@ set (last_test "H5WATCH-clearall-objects") add_test (NAME H5WATCH-h5watchgentest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5watchgentest>) set_tests_properties (H5WATCH-h5watchgentest PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - DEPENDS "H5WATCH-clearall-objects" + DEPENDS H5WATCH-clearall-objects ) set_tests_properties (H5WATCH-h5watchgentest PROPERTIES FIXTURES_SETUP gen_test_watch) set_tests_properties (H5WATCH-h5watchgentest PROPERTIES FIXTURES_REQUIRED swmr_vfd_check_compat) diff --git a/java/examples/datasets/CMakeLists.txt b/java/examples/datasets/CMakeLists.txt index e63ead0..a630e52 100644 --- a/java/examples/datasets/CMakeLists.txt +++ b/java/examples/datasets/CMakeLists.txt @@ -93,7 +93,8 @@ if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) else () add_test ( NAME JAVA_datasets-${example}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 + COMMAND ${CMAKE_COMMAND} -E remove + ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 ) endif () @@ -122,5 +123,23 @@ if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) set_tests_properties (JAVA_datasets-${example} PROPERTIES DEPENDS JAVA_datasets-${example}-copy-objects ) + + if (example STREQUAL "H5Ex_D_External") + add_test ( + NAME JAVA_datasets-${example}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 + ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.data + ) + else () + add_test ( + NAME JAVA_datasets-${example}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 + ) + set_tests_properties (JAVA_datasets-${example}-clean-objects PROPERTIES + DEPENDS JAVA_datasets-${example} + ) + endif () endforeach () endif () diff --git a/java/examples/datatypes/CMakeLists.txt b/java/examples/datatypes/CMakeLists.txt index 4512221..afaaf3d 100644 --- a/java/examples/datatypes/CMakeLists.txt +++ b/java/examples/datatypes/CMakeLists.txt @@ -70,7 +70,8 @@ if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) foreach (example ${HDF_JAVA_EXAMPLES}) add_test ( NAME JAVA_datatypes-${example}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 + COMMAND ${CMAKE_COMMAND} -E remove + ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 ) add_test ( @@ -97,5 +98,14 @@ if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) set_tests_properties (JAVA_datatypes-${example} PROPERTIES DEPENDS JAVA_datatypes-${example}-copy-objects ) + + add_test ( + NAME JAVA_datatypes-${example}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 + ) + set_tests_properties (JAVA_datatypes-${example}-clean-objects PROPERTIES + DEPENDS JAVA_datatypes-${example} + ) endforeach () endif () diff --git a/java/examples/groups/CMakeLists.txt b/java/examples/groups/CMakeLists.txt index 9f20abf..bec095d 100644 --- a/java/examples/groups/CMakeLists.txt +++ b/java/examples/groups/CMakeLists.txt @@ -78,7 +78,8 @@ if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) else () add_test ( NAME JAVA_groups-${example}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 + COMMAND ${CMAKE_COMMAND} -E remove + ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 ) endif () else () @@ -112,5 +113,25 @@ if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) set_tests_properties (JAVA_groups-${example} PROPERTIES DEPENDS JAVA_groups-${example}-copy-objects ) + + if (NOT example STREQUAL "H5Ex_G_Iterate" AND NOT example STREQUAL "H5Ex_G_Visit") + if (example STREQUAL "H5Ex_G_Compact") + add_test ( + NAME JAVA_groups-${example}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}1.h5 + ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}2.h5 + ) + else () + add_test ( + NAME JAVA_groups-${example}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 + ) + endif () + set_tests_properties (JAVA_groups-${example}-clean-objects PROPERTIES + DEPENDS JAVA_groups-${example} + ) + endif () endforeach () endif () diff --git a/java/examples/intro/CMakeLists.txt b/java/examples/intro/CMakeLists.txt index a5e2a67..2ba15c9 100644 --- a/java/examples/intro/CMakeLists.txt +++ b/java/examples/intro/CMakeLists.txt @@ -59,7 +59,8 @@ if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) foreach (example ${HDF_JAVA_EXAMPLES}) add_test ( NAME JAVA_intro-${example}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 + COMMAND ${CMAKE_COMMAND} -E remove + ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 ) add_test ( @@ -87,6 +88,15 @@ if (BUILD_TESTING AND HDF5_TEST_EXAMPLES AND HDF5_TEST_SERIAL) set_tests_properties (JAVA_intro-${example} PROPERTIES DEPENDS JAVA_intro-${example}-copy-objects ) + + add_test ( + NAME JAVA_intro-${example}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${HDFJAVA_EXAMPLES_BINARY_DIR}/${example}.h5 + ) + set_tests_properties (JAVA_intro-${example}-clean-objects PROPERTIES + DEPENDS JAVA_intro-${example} + ) endforeach () endif () diff --git a/java/test/CMakeLists.txt b/java/test/CMakeLists.txt index 9d1ed2b..ab00a34 100644 --- a/java/test/CMakeLists.txt +++ b/java/test/CMakeLists.txt @@ -127,16 +127,32 @@ foreach (CMAKE_INCLUDE_PATH ${CMAKE_JAVA_INCLUDE_PATH}) endforeach () if (HDF5_TEST_JAVA AND HDF5_TEST_SERIAL) + add_test ( + NAME JUnit-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove + test.h5 + testF2.h5 + testPf00000.h5 + testPf00001.h5 + WORKING_DIRECTORY ${HDF5_BINARY_DIR}/java/test + ) + set_tests_properties (JUnit-clear-objects PROPERTIES FIXTURES_SETUP clear_JUnit) + + add_test ( + NAME JUnit-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + test.h5 + testF2.h5 + testPf00000.h5 + testPf00001.h5 + WORKING_DIRECTORY ${HDF5_BINARY_DIR}/java/test + ) + set_tests_properties (JUnit-clean-objects PROPERTIES FIXTURES_CLEANUP clear_JUnit) + foreach (test_file ${HDF5_JAVA_TEST_SOURCES}) set (TEST_JAVA_CLASSPATH "${CMAKE_JAVA_CLASSPATH}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${${HDF5_JAVA_TEST_LIB_TARGET}_${test_file}_JAR_FILE}") add_test ( - NAME JUnit-${test_file}-clearall-objects - COMMAND ${CMAKE_COMMAND} -E remove - JUnit-${test_file}.out - JUnit-${test_file}.out.err - ) - add_test ( NAME JUnit-${test_file} COMMAND "${CMAKE_COMMAND}" -D "TEST_TESTER=${CMAKE_Java_RUNTIME};${CMAKE_Java_RUNTIME_FLAGS}" @@ -156,7 +172,8 @@ if (HDF5_TEST_JAVA AND HDF5_TEST_SERIAL) ) set_tests_properties (JUnit-${test_file} PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/testdir2" - DEPENDS "JUnit-${test_file}-clearall-objects" + FIXTURES_REQUIRED clear_JUnit + WORKING_DIRECTORY ${HDF5_BINARY_DIR}/java/test ) endforeach () @@ -170,10 +187,12 @@ if (HDF5_TEST_JAVA AND HDF5_TEST_SERIAL) macro (DO_VOL_TEST voltest volname volinfo volclasspath) #message(STATUS "${voltest}-${volname} with ${volinfo}") add_test ( - NAME JUnit-VOL-${volname}-${voltest}-clearall-objects + NAME JUnit-VOL-${volname}-${voltest}-clean-objects COMMAND ${CMAKE_COMMAND} -E remove - JUnit-VOL-${volname}-${voltest}.out - JUnit-VOL-${volname}-${voltest}.out.err + test.h5 + testF2.h5 + testPf00000.h5 + testPf00001.h5 WORKING_DIRECTORY ${HDF5_BINARY_DIR}/java/test/${volname} ) add_test (NAME JUnit-VOL-${volname}-${voltest} @@ -196,7 +215,21 @@ if (HDF5_TEST_JAVA AND HDF5_TEST_SERIAL) ) set_tests_properties (JUnit-VOL-${volname}-${voltest} PROPERTIES ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/testdir2" - DEPENDS "JUnit-VOL-${volname}-${voltest}-clearall-objects" + DEPENDS "JUnit-VOL-${volname}-${voltest}-clear-objects" + WORKING_DIRECTORY ${HDF5_BINARY_DIR}/java/test/${volname} + ) + add_test ( + NAME JUnit-VOL-${volname}-${voltest}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + test.h5 + testF2.h5 + testPf00000.h5 + testPf00001.h5 + WORKING_DIRECTORY ${HDF5_BINARY_DIR}/java/test/${volname} + ) + set_tests_properties (JUnit-VOL-${volname}-${voltest} PROPERTIES + ENVIRONMENT "HDF5_PLUGIN_PATH=${CMAKE_BINARY_DIR}/testdir2" + DEPENDS "JUnit-VOL-${volname}-${voltest}" WORKING_DIRECTORY ${HDF5_BINARY_DIR}/java/test/${volname} ) endmacro () diff --git a/test/CMakeTests.cmake b/test/CMakeTests.cmake index a0a0b01..90ae9cd 100644 --- a/test/CMakeTests.cmake +++ b/test/CMakeTests.cmake @@ -114,7 +114,7 @@ foreach (plistfile ${HDF5_REFERENCE_PLIST_FILES}) endforeach () # -------------------------------------------------------------------- -#-- Copy all the HDF5 files from the test directory into the source directory +#-- Copy all the HDF5 files from the source directory into the test directory # -------------------------------------------------------------------- set (HDF5_REFERENCE_TEST_FILES aggr.h5 @@ -177,24 +177,24 @@ endforeach () add_custom_target(HDF5_TEST_LIB_files ALL COMMENT "Copying files needed by HDF5_TEST_LIB tests" DEPENDS ${HDF5_TEST_LIB_files_list}) set (testhdf5_CLEANFILES - coord.h5 - dtypes10.h5 - sys_file1 - tattr.h5 - tfile1.h5 - tfile2.h5 - tfile3.h5 - tfile4.h5 - tfile5.h5 - tfile6.h5 - tfile7.h5 - tfilespace.h5 - th5o_file - th5s1.h5 - tselect.h5 - tsohm.h5 - tsohm_dst.h5 - tsohm_src.h5 + coord.h5 + dtypes10.h5 + sys_file1 + tattr.h5 + tfile1.h5 + tfile2.h5 + tfile3.h5 + tfile4.h5 + tfile5.h5 + tfile6.h5 + tfile7.h5 + tfilespace.h5 + th5o_file + th5s1.h5 + tselect.h5 + tsohm.h5 + tsohm_dst.h5 + tsohm_src.h5 ) # Remove any output file left over from previous test run @@ -204,6 +204,12 @@ add_test ( WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) set_tests_properties (H5TEST-testhdf5-clear-objects PROPERTIES FIXTURES_SETUP clear_testhdf5) +add_test ( + NAME H5TEST-testhdf5-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove ${testhdf5_CLEANFILES} + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST +) +set_tests_properties (H5TEST-testhdf5-clean-objects PROPERTIES FIXTURES_CLEANUP clear_testhdf5) add_test (NAME H5TEST-testhdf5-base COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:testhdf5> -x file -x select) set_tests_properties (H5TEST-testhdf5-base PROPERTIES @@ -231,182 +237,94 @@ set_tests_properties (H5TEST-testhdf5-select PROPERTIES ############################################################################## set (test_CLEANFILES - accum.h5 - cmpd_dset.h5 - compact_dataset.h5 - dataset.h5 - dset_offset.h5 - max_compact_dataset.h5 - simple.h5 - set_local.h5 - random_chunks.h5 - huge_chunks.h5 - chunk_cache.h5 - big_chunk.h5 - chunk_fast.h5 - chunk_expand.h5 - chunk_fixed.h5 - copy_dcpl_newfile.h5 - partial_chunks.h5 - layout_extend.h5 - zero_chunk.h5 - chunk_single.h5 - swmr_non_latest.h5 - earray_hdr_fd.h5 - farray_hdr_fd.h5 - bt2_hdr_fd.h5 - storage_size.h5 - dls_01_strings.h5 - power2up.h5 - version_bounds.h5 - alloc_0sized.h5 - extend.h5 - istore.h5 - extlinks*.h5 - frspace.h5 - links*.h5 - sys_file1 - tfile*.h5 - th5s*.h5 - lheap.h5 - fheap.h5 - ohdr.h5 - ohdr_min_a.h5 - ohdr_min_b.h5 + cmpd_dtransform.h5 + direct_chunk.h5 + dt_arith1.h5 + dt_arith2.h5 + dtransform.h5 + dtypes3.h5 + dtypes4.h5 min_dset_ohdr_testfile.h5 - stab.h5 - extern_*.h5 - extern_*.raw - gheap*.h5 - dt_arith1 - dt_arith2 - links.h5 - links*.h5 - extlinks*.h5 - tmp - tmp_links - tmp2_links - tmp_links_env - tmp_vds/* - tmp_vds_env/* - big.data - big*.h5 - stdio.h5 - sec2.h5 - dtypes*.h5 - dt_arith*.h5 - tattr.h5 - tselect.h5 - mtime.h5 - unlink.h5 - unicode.h5 - coord.h5 - fillval_*.h5 - fillval.raw - mount_*.h5 - testmeta.h5 - ttime.h5 - trefer*.h5 - trefer_*.h5 - tvltypes.h5 - tvlstr.h5 - tvlstr2.h5 - twriteorder.dat - enum1.h5 - titerate.h5 - ttsafe.h5 - tarray1.h5 - tgenprop.h5 - tmisc*.h5 - set_extent*.h5 - ext*.bin - getname.h5 - getname*.h5 + ohdr_min_a.h5 sec2_file.h5 - direct_file.h5 - family_file000*.h5 - new_family_v16-000*.h5 - multi_file-*.h5 - core_file - filter_plugin.h5 - new_move_*.h5 - ntypes.h5 - dangle.h5 - error_test.h5 - err_compat.h5 - dtransform.h5 - test_filters.h5 - get_file_name.h5 - tstint*.h5 - unlink_chunked.h5 - btree2.h5 - btree2_tmp.h5 - objcopy_src.h5 - objcopy_dst.h5 + single_latest.h5 + source_file.h5 + splitter_rw_file.h5 + splitter_tmp.h5 + splitter_wo_file.h5 + stdio_file.h5 + swmr0.h5 + tfile_is_accessible_non_hdf5.h5 + tfile_is_accessible.h5 + tfile1.h5.h5 + tfile8.h5 + tfile8.h5.h5 + tmisc15.h5.h5 + tstint1.h5 + tstint2.h5 + tverbounds_dtype.h5 + virtual_file1.h5 objcopy_ext.dat - app_ref.h5 - farray.h5 - farray_tmp.h5 - earray.h5 - earray_tmp.h5 - efc*.h5 log_vfd_out.log - log_ros3_out.log - log_s3comms_out.log - new_multi_file_v16-r.h5 - new_multi_file_v16-s.h5 - split_get_file_image_test-m.h5 - split_get_file_image_test-r.h5 - file_image_core_test.h5.copy - unregister_filter_1.h5 - unregister_filter_2.h5 - vds_virt.h5 - vds_dapl.h5 - vds_src_*.h5 - swmr_data.h5 - use_use_append_chunk.h5 - use_append_mchunks.h5 - use_disable_mdc_flushes.h5 - flushrefresh.h5 - flushrefresh_VERIFICATION_START - flushrefresh_VERIFICATION_CHECKPOINT1 - flushrefresh_VERIFICATION_CHECKPOINT2 - flushrefresh_VERIFICATION_DONE - filenotclosed.h5 - del_many_dense_attrs.h5 - atomic_data - accum_swmr_big.h5 - ohdr_swmr.h5 - test_swmr*.h5 - cache_logging.h5 - cache_logging.out - vds_swmr.h5 - vds_swmr_src_*.h5 - swmr*.h5 - swmr_writer.out - swmr_writer.log.* - swmr_reader.out.* - swmr_reader.log.* - tbogus.h5.copy - cache_image_test.h5 - direct_chunk.h5 - native_vol_test.h5 - splitter*.h5 splitter.log - mirror_rw/* - mirror_wo/* - event_set_*.h5 - h5s_block.h5 - h5s_plist.h5 + tbogus.h5.copy + tmp_vds/vds_src_2.h5 +) + +set (EXTLINKS_CLEANFILES + extlinks16A-000000.h5 + extlinks16A-000001.h5 + extlinks16B-b.h5 + extlinks16B-g.h5 + extlinks16B-l.h5 + extlinks16B-r.h5 + extlinks16B-s.h5 + extlinks19B-000000.h5 + extlinks19B-000001.h5 + extlinks19B-000002.h5 + extlinks19B-000003.h5 + extlinks19B-000004.h5 + extlinks19B-000005.h5 + extlinks19B-000006.h5 + extlinks19B-000007.h5 + extlinks19B-000008.h5 + extlinks19B-000009.h5 + extlinks19B-000010.h5 + extlinks19B-000011.h5 + extlinks19B-000012.h5 + extlinks19B-000013.h5 + extlinks19B-000014.h5 + extlinks19B-000015.h5 + extlinks19B-000016.h5 + extlinks19B-000017.h5 + extlinks19B-000018.h5 + extlinks19B-000019.h5 + extlinks19B-000020.h5 + extlinks19B-000021.h5 + extlinks19B-000022.h5 + extlinks19B-000023.h5 + extlinks19B-000024.h5 + extlinks19B-000025.h5 + extlinks19B-000026.h5 + extlinks19B-000027.h5 + extlinks19B-000028.h5 ) # Remove any output file left over from previous test run add_test ( NAME H5TEST-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${test_CLEANFILES} + COMMAND ${CMAKE_COMMAND} -E rm -f ${test_CLEANFILES} ${EXTLINKS_CLEANFILES} + COMMAND_EXPAND_LISTS WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) set_tests_properties (H5TEST-clear-objects PROPERTIES FIXTURES_SETUP clear_H5TEST) +add_test ( + NAME H5TEST-clean-objects + COMMAND ${CMAKE_COMMAND} -E rm -f ${test_CLEANFILES} ${EXTLINKS_CLEANFILES} + COMMAND_EXPAND_LISTS + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST +) +set_tests_properties (H5TEST-clean-objects PROPERTIES FIXTURES_CLEANUP clear_H5TEST) set (H5TEST_SEPARATE_TESTS testhdf5 @@ -422,7 +340,7 @@ foreach (h5_test ${H5_TESTS}) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5TEST-${h5_test} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:${h5_test}>) set_tests_properties (H5TEST-${h5_test} PROPERTIES - FIXTURES_REQUIRED clear_objects + FIXTURES_REQUIRED clear_H5TEST ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) @@ -463,10 +381,18 @@ set_tests_properties (H5TEST-objcopy PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOU if (NOT CYGWIN) add_test ( NAME H5TEST-cache-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove cache_test.h5 + COMMAND ${CMAKE_COMMAND} -E remove + cache_test.h5 WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) set_tests_properties (H5TEST-cache-clear-objects PROPERTIES FIXTURES_SETUP clear_cache) + add_test ( + NAME H5TEST-cache-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + cache_test.h5 + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST + ) + set_tests_properties (H5TEST-cache-clean-objects PROPERTIES FIXTURES_CLEANUP clear_cache) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5TEST-cache COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:cache>) else () @@ -498,6 +424,12 @@ if (TEST_CACHE_IMAGE) WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) set_tests_properties (H5TEST-cache_image-clear-objects PROPERTIES FIXTURES_SETUP clear_cache_image) + add_test ( + NAME H5TEST-cache_image-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove cache_image_test.h5 + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST + ) + set_tests_properties (H5TEST-cache_image-clean-objects PROPERTIES FIXTURES_CLEANUP clear_cache_image) add_test (NAME H5TEST_cache_image COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:cache_image>) set_tests_properties (H5TEST-cache_image PROPERTIES FIXTURES_REQUIRED clear_cache_image @@ -507,21 +439,28 @@ if (TEST_CACHE_IMAGE) endif () #-- Adding test for external_env +set (H5TEST_EXTERNAL_CLEANFILES + extern_1r.raw + extern_2r.raw + extern_3r.raw + extern_4r.raw + extern_1w.raw + extern_2w.raw + extern_3w.raw + extern_4w.raw +) add_test ( NAME H5TEST-external_env-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove - extern_1r.raw - extern_2r.raw - extern_3r.raw - extern_4r.raw - extern_1w.raw - extern_2w.raw - extern_3w.raw - extern_4w.raw - WORKING_DIRECTORY - ${HDF5_TEST_BINARY_DIR}/H5TEST + COMMAND ${CMAKE_COMMAND} -E remove ${H5TEST_EXTERNAL_CLEANFILES} + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) set_tests_properties (H5TEST-external_env-clear-objects PROPERTIES FIXTURES_SETUP clear_external_env) +add_test ( + NAME H5TEST-external_env-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove ${H5TEST_EXTERNAL_CLEANFILES} + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST +) +set_tests_properties (H5TEST-external_env-clean-objects PROPERTIES FIXTURES_CLEANUP clear_external_env) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5TEST-external_env COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:external_env>) else () @@ -556,6 +495,17 @@ add_test ( ${HDF5_TEST_BINARY_DIR}/H5TEST ) set_tests_properties (H5TEST-vds_env-clear-objects PROPERTIES FIXTURES_SETUP clear_vds_env) +add_test ( + NAME H5TEST-vds_env-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + vds_virt_0.h5 + vds_virt_3.h5 + vds_src_2.h5 + tmp_vds_env/vds_env_src_2.h5 + WORKING_DIRECTORY + ${HDF5_TEST_BINARY_DIR}/H5TEST +) +set_tests_properties (H5TEST-vds_env-clean-objects PROPERTIES FIXTURES_CLEANUP clear_vds_env) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5TEST-vds_env COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:vds_env>) else () @@ -580,20 +530,26 @@ set_tests_properties (H5TEST-vds_env PROPERTIES ) #-- Adding test for flush1/2 +set (FLUSH_CLEANFILES + flush.h5 + flush-swmr.h5 + noflush.h5 + noflush-swmr.h5 + flush_extend.h5 + flush_extend-swmr.h5 + noflush_extend.h5 + noflush_extend-swmr.h5 +) add_test (NAME H5TEST-flush-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove - flush.h5 - flush-swmr.h5 - noflush.h5 - noflush-swmr.h5 - flush_extend.h5 - flush_extend-swmr.h5 - noflush_extend.h5 - noflush_extend-swmr.h5 - WORKING_DIRECTORY - ${HDF5_TEST_BINARY_DIR}/H5TEST + COMMAND ${CMAKE_COMMAND} -E remove ${FLUSH_CLEANFILES} + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) set_tests_properties (H5TEST-flush-clear-objects PROPERTIES FIXTURES_SETUP clear_flush) +add_test (NAME H5TEST-flush-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove ${FLUSH_CLEANFILES} + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST +) +set_tests_properties (H5TEST-flush-clean-objects PROPERTIES FIXTURES_CLEANUP clear_flush) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5TEST-flush1 COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:flush1>) else () @@ -689,6 +645,12 @@ add_test ( WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) set_tests_properties (H5TEST-filenotclosed-clear-objects PROPERTIES FIXTURES_SETUP clear_filenotclosed) +add_test ( + NAME H5TEST-filenotclosed-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove filenotclosed.h5 + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST +) +set_tests_properties (H5TEST-filenotclosed-clean-objects PROPERTIES FIXTURES_CLEANUP clear_filenotclosed) add_test (NAME H5TEST-filenotclosed COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:filenotclosed>) set_tests_properties (H5TEST-filenotclosed PROPERTIES FIXTURES_REQUIRED clear_filenotclosed @@ -703,6 +665,12 @@ add_test ( WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) set_tests_properties (H5TEST-del_many_dense_attrs-clear-objects PROPERTIES FIXTURES_SETUP clear_del_many_dense_attrs) +add_test ( + NAME H5TEST-del_many_dense_attrs-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove del_many_dense_attrs.h5 + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST +) +set_tests_properties (H5TEST-del_many_dense_attrs-clean-objects PROPERTIES FIXTURES_CLEANUP clear_del_many_dense_attrs) add_test (NAME H5TEST-del_many_dense_attrs COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:del_many_dense_attrs>) set_tests_properties (H5TEST-del_many_dense_attrs PROPERTIES FIXTURES_REQUIRED clear_del_many_dense_attrs @@ -782,6 +750,14 @@ else () ENVIRONMENT "srcdir=${HDF5_TEST_BINARY_DIR}/H5TEST;HDF5_PLUGIN_PRELOAD=::" WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST ) + add_test ( + NAME H5TEST-error_test-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove error_test.txt + ) + set_tests_properties (H5TEST-error_test-clean-objects PROPERTIES + DEPENDS H5TEST-error_test + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST + ) endif () #-- Adding test for links_env @@ -794,6 +770,15 @@ add_test (NAME H5TEST-links_env-clear-objects ${HDF5_TEST_BINARY_DIR}/H5TEST ) set_tests_properties (H5TEST-links_env-clear-objects PROPERTIES FIXTURES_SETUP clear_links_env) +add_test (NAME H5TEST-links_env-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + extlinks_env0.h5 + extlinks_env1.h5 + tmp_links_env/extlinks_env1.h5 + WORKING_DIRECTORY + ${HDF5_TEST_BINARY_DIR}/H5TEST +) +set_tests_properties (H5TEST-links_env-clean-objects PROPERTIES FIXTURES_CLEANUP clear_links_env) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5TEST-links_env COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:links_env>) else () @@ -869,10 +854,20 @@ if (ENABLE_EXTENDED_TESTS) if (H5_PERL_FOUND) add_test ( NAME H5TEST-testflushrefresh-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove flushrefresh.h5 + COMMAND ${CMAKE_COMMAND} -E remove + flushrefresh.h5 + flushrefresh_test/flushrefresh.h5 WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST/flushrefresh_test ) set_tests_properties (H5TEST-testflushrefresh-clear-objects PROPERTIES FIXTURES_SETUP clear_testflushrefresh) + add_test ( + NAME H5TEST-testflushrefresh-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + flushrefresh.h5 + flushrefresh_test/flushrefresh.h5 + WORKING_DIRECTORY ${HDF5_TEST_BINARY_DIR}/H5TEST/flushrefresh_test + ) + set_tests_properties (H5TEST-testflushrefresh-clean-objects PROPERTIES FIXTURES_CLEANUP clear_testflushrefresh) add_test (NAME H5TEST-testflushrefresh COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:flushrefresh>" diff --git a/testpar/CMakeTests.cmake b/testpar/CMakeTests.cmake index ee69881..1a3f409 100644 --- a/testpar/CMakeTests.cmake +++ b/testpar/CMakeTests.cmake @@ -22,6 +22,12 @@ add_test ( WORKING_DIRECTORY ${HDF5_TEST_PAR_BINARY_DIR} ) set_tests_properties (MPI_TEST-clear-testphdf5-objects PROPERTIES FIXTURES_SETUP par_clear_testphdf5) +add_test ( + NAME MPI_TEST-clean-testphdf5-objects + COMMAND ${CMAKE_COMMAND} -E remove ParaTest.h5 + WORKING_DIRECTORY ${HDF5_TEST_PAR_BINARY_DIR} +) +set_tests_properties (MPI_TEST-clean-testphdf5-objects PROPERTIES FIXTURES_CLEANUP par_clear_testphdf5) set (SKIP_tests cchunk1 @@ -101,6 +107,12 @@ add_test ( WORKING_DIRECTORY ${HDF5_TEST_PAR_BINARY_DIR} ) set_tests_properties (MPI_TEST-clear-objects PROPERTIES FIXTURES_SETUP par_clear_objects) +add_test ( + NAME MPI_TEST-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove ${test_par_CLEANFILES} + WORKING_DIRECTORY ${HDF5_TEST_PAR_BINARY_DIR} +) +set_tests_properties (MPI_TEST-clean-objects PROPERTIES FIXTURES_CLEANUP par_clear_objects) foreach (h5_testp ${H5P_TESTS}) add_test (NAME MPI_TEST_${h5_testp} COMMAND ${MPIEXEC_EXECUTABLE} ${MPIEXEC_NUMPROC_FLAG} ${MPIEXEC_MAX_NUMPROCS} ${MPIEXEC_PREFLAGS} $<TARGET_FILE:${h5_testp}> ${MPIEXEC_POSTFLAGS}) diff --git a/tools/libtest/CMakeTests.cmake b/tools/libtest/CMakeTests.cmake index 2d8e877..6863822 100644 --- a/tools/libtest/CMakeTests.cmake +++ b/tools/libtest/CMakeTests.cmake @@ -28,17 +28,22 @@ NAME H5LIBTEST-${resultfile}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove - ${resultfile}.out - ${resultfile}.out.err + ${resultfile}.out + ${resultfile}.out.err ) - if (NOT "${last_test}" STREQUAL "") - set_tests_properties (H5LIBTEST-${resultfile}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () add_test (NAME H5LIBTEST-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5tools_test_utils> ${ARGN}) if (NOT "${resultcode}" STREQUAL "0") set_tests_properties (H5LIBTEST-${resultfile} PROPERTIES WILL_FAIL "true") endif () set_tests_properties (H5LIBTEST-${resultfile} PROPERTIES DEPENDS H5LIBTEST-${resultfile}-clear-objects) + add_test ( + NAME H5LIBTEST-${resultfile}-clean-objects + COMMAND ${CMAKE_COMMAND} + -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5LIBTEST-${resultfile}-clean-objects PROPERTIES DEPENDS H5LIBTEST-${resultfile}) endmacro () ############################################################################## diff --git a/tools/test/h5copy/CMakeTests.cmake b/tools/test/h5copy/CMakeTests.cmake index 154ca15..33af1cd 100644 --- a/tools/test/h5copy/CMakeTests.cmake +++ b/tools/test/h5copy/CMakeTests.cmake @@ -55,25 +55,17 @@ # Perform h5copy according to passing parameters # macro (ADD_H5_F_TEST testname resultcode infile fparam vparam sparam srcname dparam dstname) - if (NOT HDF5_ENABLE_USING_MEMCHECKER) - # 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 - ) - endif () + # 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 + ) add_test ( NAME H5COPY_F-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_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) - set_tests_properties (H5COPY_F-${testname} PROPERTIES DEPENDS ${last_test}) - endif () - else () - set_tests_properties (H5COPY_F-${testname} PROPERTIES DEPENDS H5COPY_F-${testname}-clear-objects) - endif () + set_tests_properties (H5COPY_F-${testname} PROPERTIES DEPENDS H5COPY_F-${testname}-clear-objects) # resultcode=2 will cause the test to skip the diff test if (NOT "${resultcode}" STREQUAL "2") @@ -86,28 +78,29 @@ set_tests_properties (H5COPY_F-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () endif () + add_test ( + NAME H5COPY_F-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 + ) + if (NOT "${resultcode}" STREQUAL "2") + set_tests_properties (H5COPY_F-${testname}-clean-objects PROPERTIES DEPENDS H5COPY_F-${testname}-DIFF) + else () + set_tests_properties (H5COPY_F-${testname}-clean-objects PROPERTIES DEPENDS H5COPY_F-${testname}) + endif () endmacro () macro (ADD_H5_TEST testname resultcode infile vparam sparam srcname dparam dstname) - if (NOT HDF5_ENABLE_USING_MEMCHECKER) - # 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 - ) - endif () + # 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 + ) add_test ( NAME H5COPY-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN} ) - if (HDF5_ENABLE_USING_MEMCHECKER) - if (last_test) - set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS ${last_test}) - endif () - else () - set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) - endif () + set_tests_properties (H5COPY-${testname} PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) # resultcode=2 will cause the test to skip the diff test if (NOT "${resultcode}" STREQUAL "2") @@ -120,6 +113,15 @@ set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () endif () + add_test ( + NAME H5COPY-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 + ) + if (NOT "${resultcode}" STREQUAL "2") + set_tests_properties (H5COPY-${testname}-clean-objects PROPERTIES DEPENDS H5COPY-${testname}-DIFF) + else () + set_tests_properties (H5COPY-${testname}-clean-objects PROPERTIES DEPENDS H5COPY-${testname}) + endif () endmacro () macro (ADD_SKIP_H5_TEST testname skipresultfile) @@ -133,25 +135,17 @@ endmacro () macro (ADD_H5_TEST2 testname resultcode infile psparam pdparam vparam sparam srcname dparam dstname) - if (NOT HDF5_ENABLE_USING_MEMCHECKER) - # 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 - ) - endif () + # 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 + ) add_test ( NAME H5COPY-${testname}-prefill COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} ) - if (HDF5_ENABLE_USING_MEMCHECKER) - if (last_test) - set_tests_properties (H5COPY-${testname}-prefill PROPERTIES DEPENDS ${last_test}) - endif () - else () - set_tests_properties (H5COPY-${testname}-prefill PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) - endif () + set_tests_properties (H5COPY-${testname}-prefill PROPERTIES DEPENDS H5COPY-${testname}-clear-objects) add_test ( NAME H5COPY-${testname} @@ -169,28 +163,29 @@ set_tests_properties (H5COPY-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () endif () + add_test ( + NAME H5COPY-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 + ) + if (NOT "${resultcode}" STREQUAL "2") + set_tests_properties (H5COPY-${testname}-clean-objects PROPERTIES DEPENDS H5COPY-${testname}-DIFF) + else () + set_tests_properties (H5COPY-${testname}-clean-objects PROPERTIES DEPENDS H5COPY-${testname}) + endif () endmacro () macro (ADD_H5_TEST_SAME testname resultcode pfile psparam pdparam vparam sparam srcname dparam dstname) - if (NOT HDF5_ENABLE_USING_MEMCHECKER) - # 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 - ) - endif () + # 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 + ) add_test ( NAME H5COPY_SAME-${testname}-prefill COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -i ./testfiles/${pfile} -o ./testfiles/${testname}.out.h5 -v -s ${psparam} -d ${pdparam} ) - if (HDF5_ENABLE_USING_MEMCHECKER) - if (last_test) - set_tests_properties (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS ${last_test}) - endif () - else (HDF5_ENABLE_USING_MEMCHECKER) - set_tests_properties (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS H5COPY_SAME-${testname}-clear-objects) - endif () + set_tests_properties (H5COPY_SAME-${testname}-prefill PROPERTIES DEPENDS H5COPY_SAME-${testname}-clear-objects) add_test ( NAME H5COPY_SAME-${testname} @@ -208,6 +203,15 @@ set_tests_properties (H5COPY_SAME-${testname}-DIFF PROPERTIES WILL_FAIL "true") endif () endif () + add_test ( + NAME H5COPY_SAME-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 + ) + if (NOT "${resultcode}" STREQUAL "2") + set_tests_properties (H5COPY_SAME-${testname}-clean-objects PROPERTIES DEPENDS H5COPY_SAME-${testname}-DIFF) + else () + set_tests_properties (H5COPY_SAME-${testname}-clean-objects PROPERTIES DEPENDS H5COPY_SAME-${testname}) + endif () endmacro () # @@ -215,21 +219,19 @@ # files instead of checking with h5ls. # macro (ADD_H5_CMP_TEST testname resultcode infile vparam sparam srcname dparam dstname) + # 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 + ) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5COPY-CMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5copy${tgt_file_ext}> -i ./testfiles/${infile} -o ./testfiles/${testname}.out.h5 ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}) if ("${resultcode}" STREQUAL "1") set_tests_properties (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true") endif () - if (last_test) - set_tests_properties (H5COPY-CMP-${testname} PROPERTIES DEPENDS ${last_test}) - endif () + set_tests_properties (H5COPY-CMP-${testname} PROPERTIES DEPENDS H5COPY-CMP-${testname}-clear-objects) else () - # 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 - ) add_test ( NAME H5COPY-CMP-${testname} COMMAND "${CMAKE_COMMAND}" @@ -246,6 +248,11 @@ ) set_tests_properties (H5COPY-CMP-${testname} PROPERTIES DEPENDS H5COPY-CMP-${testname}-clear-objects) endif () + add_test ( + NAME H5COPY-CMP-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}.out.h5 + ) + set_tests_properties (H5COPY-CMP-${testname}-clean-objects PROPERTIES DEPENDS H5COPY-CMP-${testname}) endmacro () macro (ADD_H5_UD_TEST testname resultcode infile sparam srcname dparam dstname cmpfile) @@ -308,6 +315,11 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5COPY_UD-${testname}-DIFF PROPERTIES DEPENDS H5COPY_UD-${testname}) + add_test ( + NAME H5COPY_UD-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testname}.out.h5 + ) + set_tests_properties (H5COPY_UD-${testname}-clean-objects PROPERTIES DEPENDS H5COPY_UD-${testname}-DIFF) endif () endmacro () @@ -315,7 +327,7 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) # Remove any output file left over from previous test run add_test ( - NAME H5COPY_UD_ERR-${testname}-clearall-objects + NAME H5COPY_UD_ERR-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testname}_ERR.out.h5 ) if ("${resultcode}" STREQUAL "2") @@ -355,7 +367,7 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () - set_tests_properties (H5COPY_UD_ERR-${testname} PROPERTIES DEPENDS H5COPY_UD_ERR-${testname}-clearall-objects) + set_tests_properties (H5COPY_UD_ERR-${testname} PROPERTIES DEPENDS H5COPY_UD_ERR-${testname}-clear-objects) add_test ( NAME H5COPY_UD_ERR-${testname}-DIFF COMMAND "${CMAKE_COMMAND}" @@ -373,6 +385,11 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5COPY_UD_ERR-${testname}-DIFF PROPERTIES DEPENDS H5COPY_UD_ERR-${testname}) + add_test ( + NAME H5COPY_UD_ERR-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove testfiles/${testname}_ERR.out.h5 + ) + set_tests_properties (H5COPY_UD_ERR-${testname}-clean-objects PROPERTIES DEPENDS H5COPY_UD_ERR-${testname}-DIFF) endif () endmacro () @@ -390,51 +407,6 @@ set (HDF_EXT_SRC_FILE h5copy_extlinks_src) set (HDF_EXT_TRG_FILE h5copy_extlinks_trg) - if (HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - add_test ( - NAME H5COPY-clearall-objects - COMMAND ${CMAKE_COMMAND} -E remove - simple.out.h5 - chunk.out.h5 - compact.out.h5 - compound.out.h5 - compressed.out.h5 - named_vl.out.h5 - nested_vl.out.h5 - simple_top.out.h5 - dsrename.out.h5 - grp_empty.out.h5 - grp_dsets.out.h5 - grp_nested.out.h5 - simple_group.out.h5 - grp_rename.out.h5 - grp_dsets_rename.out.h5 - A_B1_simple.out.h5 - A_B2_simple2.out.h5 - C_D_simple.out.h5 - E_F_grp_dsets.out.h5 - G_H_grp_nested.out.h5 - region_ref.out.h5 - ext_link.out.h5 - ext_link_f.out.h5 - ext_dangle_noobj.out.h5 - ext_dangle_noobj_f.out.h5 - ext_dangle_nofile.out.h5 - ext_dangle_nofile_f.out.h5 - ext_link_group.out.h5 - ext_link_group_f.out.h5 - samefile1.out.h5 - samefile2.out.h5 - h5copy_misc1.out.h5 - ) - set_tests_properties (H5COPY-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - if (last_test) - set_tests_properties (H5COPY-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "H5COPY-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/h5diff/CMakeTests.cmake b/tools/test/h5diff/CMakeTests.cmake index 21761c6..8b53a39 100644 --- a/tools/test/h5diff/CMakeTests.cmake +++ b/tools/test/h5diff/CMakeTests.cmake @@ -397,13 +397,9 @@ # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DIFF-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_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") endif () - if (last_test) - set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () else () add_test ( NAME H5DIFF-${resultfile} @@ -418,10 +414,10 @@ -D "TEST_APPEND=EXIT CODE:" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - if (last_test) - set_tests_properties (H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () endif () + set_tests_properties (H5DIFF-${resultfile} PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) endmacro () macro (ADD_PH5_TEST resultfile resultcode) @@ -432,9 +428,6 @@ if (${resultcode}) set_tests_properties (MPI_TEST_H5DIFF-${resultfile} PROPERTIES WILL_FAIL "true") endif () - if (last_test) - set_tests_properties (MPI_TEST_H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () else () add_test ( NAME MPI_TEST_H5DIFF-${resultfile} @@ -451,11 +444,10 @@ -D "TEST_SORT_COMPARE=TRUE" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - if (last_test) - set_tests_properties (MPI_TEST_H5DIFF-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "MPI_TEST_H5DIFF-${resultfile}") endif () + set_tests_properties (MPI_TEST_H5DIFF-${resultfile} PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/PAR/testfiles" + ) endmacro () macro (ADD_H5_UD_TEST testname resultcode resultfile) @@ -495,9 +487,6 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () - if (last_test) - set_tests_properties (H5DIFF_UD-${testname} PROPERTIES DEPENDS ${last_test}) - endif () endif () endmacro () @@ -572,400 +561,6 @@ set (FILEV4 4_vds.h5) set (FILEV5 5_vds.h5) - if (HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - add_test ( - NAME H5DIFF-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove - h5diff_10.out - h5diff_10.out.err - h5diff_100.out - h5diff_100.out.err - h5diff_101.out - h5diff_101.out.err - h5diff_102.out - h5diff_102.out.err - h5diff_103.out - h5diff_103.out.err - h5diff_104.out - h5diff_104.out.err - h5diff_11.out - h5diff_11.out.err - h5diff_12.out - h5diff_12.out.err - h5diff_13.out - h5diff_13.out.err - h5diff_14.out - h5diff_14.out.err - h5diff_15.out - h5diff_15.out.err - h5diff_16_1.out - h5diff_16_1.out.err - h5diff_16_2.out - h5diff_16_2.out.err - h5diff_16_3.out - h5diff_16_3.out.err - h5diff_17.out - h5diff_17.out.err - h5diff_171.out - h5diff_171.out.err - h5diff_172.out - h5diff_172.out.err - h5diff_18_1.out - h5diff_18_1.out.err - h5diff_18.out - h5diff_18.out.err - h5diff_20.out - h5diff_20.out.err - h5diff_200.out - h5diff_200.out.err - h5diff_201.out - h5diff_201.out.err - h5diff_202.out - h5diff_202.out.err - h5diff_203.out - h5diff_203.out.err - h5diff_204.out - h5diff_204.out.err - h5diff_205.out - h5diff_205.out.err - h5diff_206.out - h5diff_206.out.err - h5diff_207.out - h5diff_207.out.err - h5diff_208.out - h5diff_208.out.err - h5diff_220.out - h5diff_220.out.err - h5diff_221.out - h5diff_221.out.err - h5diff_222.out - h5diff_222.out.err - h5diff_223.out - h5diff_223.out.err - h5diff_224.out - h5diff_224.out.err - h5diff_21.out - h5diff_21.out.err - h5diff_22.out - h5diff_22.out.err - h5diff_23.out - h5diff_23.out.err - h5diff_24.out - h5diff_24.out.err - h5diff_25.out - h5diff_25.out.err - h5diff_26.out - h5diff_26.out.err - h5diff_27.out - h5diff_27.out.err - h5diff_28.out - h5diff_28.out.err - h5diff_300.out - h5diff_300.out.err - h5diff_400.out - h5diff_400.out.err - h5diff_401.out - h5diff_401.out.err - h5diff_402.out - h5diff_402.out.err - h5diff_403.out - h5diff_403.out.err - h5diff_404.out - h5diff_404.out.err - h5diff_405.out - h5diff_405.out.err - h5diff_406.out - h5diff_406.out.err - h5diff_407.out - h5diff_407.out.err - h5diff_408.out - h5diff_408.out.err - h5diff_409.out - h5diff_409.out.err - h5diff_410.out - h5diff_410.out.err - h5diff_411.out - h5diff_411.out.err - h5diff_412.out - h5diff_412.out.err - h5diff_413.out - h5diff_413.out.err - h5diff_414.out - h5diff_414.out.err - h5diff_415.out - h5diff_415.out.err - h5diff_416.out - h5diff_416.out.err - h5diff_417.out - h5diff_417.out.err - h5diff_418.out - h5diff_418.out.err - h5diff_419.out - h5diff_419.out.err - h5diff_420.out - h5diff_420.out.err - h5diff_421.out - h5diff_421.out.err - h5diff_422.out - h5diff_422.out.err - h5diff_423.out - h5diff_423.out.err - h5diff_424.out - h5diff_424.out.err - h5diff_425.out - h5diff_425.out.err - h5diff_450.out - h5diff_450.out.err - h5diff_451.out - h5diff_451.out.err - h5diff_452.out - h5diff_452.out.err - h5diff_453.out - h5diff_453.out.err - h5diff_454.out - h5diff_454.out.err - h5diff_455.out - h5diff_455.out.err - h5diff_456.out - h5diff_456.out.err - h5diff_457.out - h5diff_457.out.err - h5diff_458.out - h5diff_458.out.err - h5diff_459.out - h5diff_459.out.err - h5diff_465.out - h5diff_465.out.err - h5diff_466.out - h5diff_466.out.err - h5diff_467.out - h5diff_467.out.err - h5diff_468.out - h5diff_468.out.err - h5diff_469.out - h5diff_469.out.err - h5diff_471.out - h5diff_471.out.err - h5diff_472.out - h5diff_472.out.err - h5diff_473.out - h5diff_473.out.err - h5diff_474.out - h5diff_474.out.err - h5diff_475.out - h5diff_475.out.err - h5diff_480.out - h5diff_480.out.err - h5diff_481.out - h5diff_481.out.err - h5diff_482.out - h5diff_482.out.err - h5diff_483.out - h5diff_483.out.err - h5diff_484.out - h5diff_484.out.err - h5diff_50.out - h5diff_50.out.err - h5diff_51.out - h5diff_51.out.err - h5diff_52.out - h5diff_52.out.err - h5diff_53.out - h5diff_53.out.err - h5diff_54.out - h5diff_54.out.err - h5diff_55.out - h5diff_55.out.err - h5diff_56.out - h5diff_56.out.err - h5diff_57.out - h5diff_57.out.err - h5diff_58.out - h5diff_58.out.err - h5diff_59.out - h5diff_59.out.err - h5diff_500.out - h5diff_500.out.err - h5diff_501.out - h5diff_501.out.err - h5diff_502.out - h5diff_502.out.err - h5diff_503.out - h5diff_503.out.err - h5diff_504.out - h5diff_504.out.err - h5diff_505.out - h5diff_505.out.err - h5diff_506.out - h5diff_506.out.err - h5diff_507.out - h5diff_507.out.err - h5diff_508.out - h5diff_508.out.err - h5diff_509.out - h5diff_509.out.err - h5diff_510.out - h5diff_510.out.err - h5diff_511.out - h5diff_511.out.err - h5diff_512.out - h5diff_512.out.err - h5diff_513.out - h5diff_513.out.err - h5diff_514.out - h5diff_514.out.err - h5diff_515.out - h5diff_515.out.err - h5diff_516.out - h5diff_516.out.err - h5diff_517.out - h5diff_517.out.err - h5diff_518.out - h5diff_518.out.err - h5diff_530.out - h5diff_530.out.err - h5diff_540.out - h5diff_540.out.err - h5diff_60.out - h5diff_60.out.err - h5diff_61.out - h5diff_61.out.err - h5diff_62.out - h5diff_62.out.err - h5diff_63.out - h5diff_63.out.err - h5diff_600.out - h5diff_600.out.err - h5diff_601.out - h5diff_601.out.err - h5diff_603.out - h5diff_603.out.err - h5diff_604.out - h5diff_604.out.err - h5diff_605.out - h5diff_605.out.err - h5diff_606.out - h5diff_606.out.err - h5diff_607.out - h5diff_607.out.err - h5diff_608.out - h5diff_608.out.err - h5diff_609.out - h5diff_609.out.err - h5diff_610.out - h5diff_610.out.err - h5diff_612.out - h5diff_612.out.err - h5diff_613.out - h5diff_613.out.err - h5diff_614.out - h5diff_614.out.err - h5diff_615.out - h5diff_615.out.err - h5diff_616.out - h5diff_616.out.err - h5diff_617.out - h5diff_617.out.err - h5diff_618.out - h5diff_618.out.err - h5diff_619.out - h5diff_619.out.err - h5diff_621.out - h5diff_621.out.err - h5diff_622.out - h5diff_622.out.err - h5diff_623.out - h5diff_623.out.err - h5diff_624.out - h5diff_624.out.err - h5diff_625.out - h5diff_625.out.err - h5diff_626.out - h5diff_626.out.err - h5diff_627.out - h5diff_627.out.err - h5diff_628.out - h5diff_628.out.err - h5diff_629.out - h5diff_629.out.err - h5diff_640.out - h5diff_640.out.err - h5diff_641.out - h5diff_641.out.err - h5diff_642.out - h5diff_642.out.err - h5diff_643.out - h5diff_643.out.err - h5diff_644.out - h5diff_644.out.err - h5diff_645.out - h5diff_645.out.err - h5diff_646.out - h5diff_646.out.err - h5diff_70.out - h5diff_70.out.err - h5diff_700.out - h5diff_700.out.err - h5diff_701.out - h5diff_701.out.err - h5diff_702.out - h5diff_702.out.err - h5diff_703.out - h5diff_703.out.err - h5diff_704.out - h5diff_704.out.err - h5diff_705.out - h5diff_705.out.err - h5diff_706.out - h5diff_706.out.err - h5diff_707.out - h5diff_707.out.err - h5diff_708.out - h5diff_708.out.err - h5diff_709.out - h5diff_709.out.err - h5diff_710.out - h5diff_710.out.err - h5diff_80.out - h5diff_80.out.err - h5diff_800.out - h5diff_800.out.err - h5diff_801.out - h5diff_801.out.err - h5diff_830.out - h5diff_830.out.err - h5diff_8625.out - h5diff_8625.out.err - h5diff_8639.out - h5diff_8639.out.err - h5diff_90.out - h5diff_90.out.err - h5diff_900.out - h5diff_900.out.err - h5diff_901.out - h5diff_901.out.err - h5diff_902.out - h5diff_902.out.err - h5diff_v1.out - h5diff_v1.out.err - h5diff_v2.out - h5diff_v2.out.err - h5diff_v3.out - h5diff_v3.out.err - h5diff_vlstr.out - h5diff_vlstr.out.err - h5diff_eps.out - h5diff_eps.out.err - ) - set_tests_properties (H5DIFF-clearall-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") - if (last_test) - set_tests_properties (H5DIFF-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "H5DIFF-clearall-objects") - endif () - # ############################################################################ # # Common usage # ############################################################################ diff --git a/tools/test/h5dump/CMakeTests.cmake b/tools/test/h5dump/CMakeTests.cmake index 4fa9a8f..118fac4 100644 --- a/tools/test/h5dump/CMakeTests.cmake +++ b/tools/test/h5dump/CMakeTests.cmake @@ -444,11 +444,6 @@ # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_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 () add_test ( NAME H5DUMP-${testname} @@ -462,10 +457,10 @@ -D "TEST_REFERENCE=h5dump-${testname}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - if (last_test) - set_tests_properties (H5DUMP-${testname} PROPERTIES DEPENDS ${last_test}) - endif () endif () + set_tests_properties (H5DUMP-${testname} PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) endmacro () macro (ADD_SKIP_H5_TEST skipresultfile skipresultcode testtype) @@ -486,19 +481,13 @@ # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_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") endif () - if (last_test) - set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () - else () - add_test ( - NAME H5DUMP-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.bin + set_tests_properties (H5DUMP-${resultfile} PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" ) - set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + else () add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -511,27 +500,32 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") endif () + set_tests_properties (H5DUMP-${resultfile} PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) endmacro () macro (ADD_H5_TEST_N resultfile resultcode) + add_test ( + NAME H5DUMP-N-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${resultfile}-N.bin + ) + set_tests_properties (H5DUMP-N-${resultfile}-clear-objects PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-N-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_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") endif () - if (last_test) - set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () - else () - add_test ( - NAME H5DUMP-N-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}-N.bin + set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES + DEPENDS H5DUMP-N-${resultfile}-clear-objects + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" ) - set_tests_properties (H5DUMP-N-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + else () add_test ( NAME H5DUMP-N-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -544,27 +538,41 @@ -D "TEST_REFERENCE=${resultfile}-N.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES DEPENDS "H5DUMP-N-${resultfile}-clear-objects") endif () + set_tests_properties (H5DUMP-N-${resultfile} PROPERTIES + DEPENDS H5DUMP-N-${resultfile}-clear-objects + ) + add_test ( + NAME H5DUMP-N-${resultfile}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${resultfile}-N.bin + ) + set_tests_properties (H5DUMP-N-${resultfile}-clean-objects PROPERTIES + DEPENDS H5DUMP-N-${resultfile} + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) endmacro () macro (ADD_H5_TEST_EXPORT resultfile targetfile resultcode) + add_test ( + NAME H5DUMP-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${resultfile}.txt + ) + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_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") endif () - if (last_test) - set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () - else () - add_test ( - NAME H5DUMP-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ${resultfile}.txt + set_tests_properties (H5DUMP-${resultfile} PROPERTIES + DEPENDS H5DUMP-${resultfile}-clear-objects + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" ) - set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + else () add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -577,35 +585,58 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + set_tests_properties (H5DUMP-${resultfile} PROPERTIES + DEPENDS H5DUMP-${resultfile}-clear-objects + ) add_test ( NAME H5DUMP-${resultfile}-output-cmp COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_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} + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES DEPENDS H5DUMP-${resultfile}) endif () + add_test ( + NAME H5DUMP-${resultfile}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${resultfile}.txt + ) + if (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-${resultfile}-clean-objects PROPERTIES + DEPENDS H5DUMP-${resultfile} + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) + else () + set_tests_properties (H5DUMP-${resultfile}-clean-objects PROPERTIES + DEPENDS H5DUMP-${resultfile}-output-cmp + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) + endif () endmacro () macro (ADD_H5_TEST_EXPORT_DDL resultfile targetfile resultcode ddlfile) + add_test ( + NAME H5DUMP-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${ddlfile}.txt + ${resultfile}.txt + ) + set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_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") endif () - if (last_test) - set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_test}) - endif () - else () - add_test ( - NAME H5DUMP-${resultfile}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove - ${ddlfile}.txt - ${resultfile}.txt + set_tests_properties (H5DUMP-${resultfile} PROPERTIES + DEPENDS H5DUMP-${resultfile}-clear-objects + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" ) - set_tests_properties (H5DUMP-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + else () add_test ( NAME H5DUMP-${resultfile} COMMAND "${CMAKE_COMMAND}" @@ -618,19 +649,43 @@ -D "TEST_REFERENCE=${resultfile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS "H5DUMP-${resultfile}-clear-objects") + set_tests_properties (H5DUMP-${resultfile} PROPERTIES + DEPENDS H5DUMP-${resultfile}-clear-objects + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) add_test ( NAME H5DUMP-${resultfile}-output-cmp COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_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}) + set_tests_properties (H5DUMP-${resultfile}-output-cmp PROPERTIES + DEPENDS H5DUMP-${resultfile} + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) add_test ( NAME H5DUMP-${resultfile}-output-cmp-ddl COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_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) + set_tests_properties (H5DUMP-${resultfile}-output-cmp-ddl PROPERTIES + DEPENDS H5DUMP-${resultfile}-output-cmp + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) + endif () + add_test ( + NAME H5DUMP-${resultfile}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${ddlfile}.txt + ${resultfile}.txt + ) + if (HDF5_ENABLE_USING_MEMCHECKER) + set_tests_properties (H5DUMP-${resultfile}-clean-objects PROPERTIES + DEPENDS H5DUMP-${resultfile} + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) + else () + set_tests_properties (H5DUMP-${resultfile}-clean-objects PROPERTIES + DEPENDS H5DUMP-${resultfile}-output-cmp-ddl + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) endif () endmacro () @@ -638,21 +693,37 @@ 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" ) - set_tests_properties (H5DUMP-output-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") add_test ( NAME H5DUMP-output-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_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) + set_tests_properties (H5DUMP-output-${resultfile} PROPERTIES + DEPENDS H5DUMP-output-${resultfile}-clear-objects + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) add_test ( NAME H5DUMP-output-cmp-${resultfile} COMMAND ${CMAKE_COMMAND} -E compare_files ${CMAKE_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}) + set_tests_properties (H5DUMP-output-cmp-${resultfile} PROPERTIES + DEPENDS H5DUMP-output-${resultfile} + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) + add_test ( + NAME H5DUMP-output-${resultfile}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${resultfile}.txt + ) + set_tests_properties (H5DUMP-output-${resultfile}-clean-objects PROPERTIES + DEPENDS H5DUMP-output-cmp-${resultfile} + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) endif () endmacro () @@ -671,6 +742,9 @@ -D "TEST_MASK_ERROR=true" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) endif () endmacro () @@ -688,6 +762,9 @@ -D "TEST_REFERENCE=${result_check}" -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) endif () endmacro () @@ -706,6 +783,9 @@ -D "TEST_ERRREF=${result_errcheck}" -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) endif () endmacro () @@ -726,6 +806,46 @@ -D "TEST_ENV_VALUE:STRING=${envval}" -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) + set_tests_properties (H5DUMP-${resultfile} PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) + endif () + endmacro () + + macro (ADD_H5_BIN_EXPORT conffile resultcode testfile) + if (NOT HDF5_ENABLE_USING_MEMCHECKER) + add_test ( + NAME H5DUMP-BIN_EXPORT-${conffile}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${conffile}.bin + ) + set_tests_properties (H5DUMP-BIN_EXPORT-${conffile}-clear-objects PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) + add_test ( + NAME H5DUMP-BIN_EXPORT-${conffile} + COMMAND "${CMAKE_COMMAND}" + -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" + -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" + -D "TEST_ARGS:STRING=${ARGN};-o;${conffile}.bin;${testfile}" + -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles/std" + -D "TEST_OUTPUT=${conffile}.out" + -D "TEST_EXPECT=${resultcode}" + -D "TEST_REFERENCE=${conffile}.ddl" + -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" + ) + set_tests_properties (H5DUMP-BIN_EXPORT-${conffile} PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) + add_test ( + NAME H5DUMP-BIN_EXPORT-${conffile}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${conffile}.bin + ) + set_tests_properties (H5DUMP-BIN_EXPORT-${conffile}-clean-objects PROPERTIES + DEPENDS H5DUMP-BIN_EXPORT-${conffile} + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) endif () endmacro () @@ -738,7 +858,9 @@ ${resultfile}.bin ${resultfile}.h5 ) - set_tests_properties (H5DUMP-IMPORT-${resultfile}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std") + 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}" @@ -751,20 +873,37 @@ -D "TEST_REFERENCE=${conffile}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5DUMP-IMPORT-${resultfile} PROPERTIES DEPENDS "H5DUMP-IMPORT-${resultfile}-clear-objects") + set_tests_properties (H5DUMP-IMPORT-${resultfile} PROPERTIES + DEPENDS H5DUMP-IMPORT-${resultfile}-clear-objects + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) add_test (NAME H5DUMP-IMPORT-h5import-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_file_ext}> ${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}) + set_tests_properties (H5DUMP-IMPORT-h5import-${resultfile} PROPERTIES + DEPENDS H5DUMP-IMPORT-${resultfile} + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) add_test (NAME H5DUMP-IMPORT-h5diff-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5diff${tgt_file_ext}> ${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}) + set_tests_properties (H5DUMP-IMPORT-h5diff-${resultfile} PROPERTIES + DEPENDS H5DUMP-IMPORT-h5import-${resultfile} + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) + add_test ( + NAME H5DUMP-IMPORT-${resultfile}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${resultfile}.bin + ${resultfile}.h5 + ) + set_tests_properties (H5DUMP-IMPORT-${resultfile}-clean-objects PROPERTIES + DEPENDS H5DUMP-IMPORT-h5diff-${resultfile} + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) endif () endmacro () macro (ADD_H5_UD_TEST testname resultcode resultfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5DUMP_UD-${testname} + NAME H5DUMP_UD-${testname}-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" @@ -778,6 +917,9 @@ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5DUMP_UD-${testname}-${resultfile} PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/std" + ) endif () endmacro () @@ -1113,7 +1255,7 @@ ADD_H5_TEST (tvms 0 --enable-error-stack tvms.h5) # test for binary output - ADD_H5_TEST (tbin1LE 0 --enable-error-stack -d integer -o tbin1LE.bin -b LE tbinary.h5) + ADD_H5_BIN_EXPORT (tbin1LE 0 tbinary.h5 --enable-error-stack -d integer -b LE) # test for string binary output ADD_H5_EXPORT_TEST (tstr2bin2 tstr2.h5 0 --enable-error-stack -d /g2/dset2 -b -o) @@ -1123,14 +1265,14 @@ # ADD_H5_TEST_IMPORT (tbin1 out1D tbinary.h5 0 --enable-error-stack -d integer -b) if (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_H5_TEST (tbin2 0 --enable-error-stack -b BE -d float -o tbin2.bin tbinary.h5) + ADD_H5_BIN_EXPORT (tbin2 0 tbinary.h5 --enable-error-stack -b BE -d float) endif () # the NATIVE test can be validated with h5import/h5diff # ADD_H5_TEST_IMPORT (tbin3 out3D tbinary.h5 0 --enable-error-stack -d integer -b NATIVE) if (NOT HDF5_ENABLE_USING_MEMCHECKER) - ADD_H5_TEST (tbin4 0 --enable-error-stack -d double -b FILE -o tbin4.bin tbinary.h5) + ADD_H5_BIN_EXPORT (tbin4 0 tbinary.h5 --enable-error-stack -d double -b FILE) endif () # test for dataset region references diff --git a/tools/test/h5dump/CMakeTestsPBITS.cmake b/tools/test/h5dump/CMakeTestsPBITS.cmake index 0c3297f..8bf0940 100644 --- a/tools/test/h5dump/CMakeTestsPBITS.cmake +++ b/tools/test/h5dump/CMakeTestsPBITS.cmake @@ -120,16 +120,21 @@ ############################################################################## macro (ADD_H5_PBITS_TEST resultfile resultcode) + 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" + ) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_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") endif () - if (last_pbits_test) - set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_pbits_test}) - endif () else () add_test ( NAME H5DUMP-${resultfile} @@ -144,6 +149,20 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () + set_tests_properties (H5DUMP-${resultfile} PROPERTIES + DEPENDS H5DUMP-${resultfile}-clear-objects + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits" + ) + add_test ( + NAME H5DUMP-${resultfile}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5DUMP-${resultfile}-clean-objects PROPERTIES + DEPENDS H5DUMP-${resultfile} + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/pbits" + ) endmacro () ############################################################################## diff --git a/tools/test/h5dump/CMakeTestsVDS.cmake b/tools/test/h5dump/CMakeTestsVDS.cmake index 88df9ad..017a9fe 100644 --- a/tools/test/h5dump/CMakeTestsVDS.cmake +++ b/tools/test/h5dump/CMakeTestsVDS.cmake @@ -117,15 +117,20 @@ macro (ADD_H5_VDS_TEST resultfile resultcode) # If using memchecker add tests without using scripts + 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" + ) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_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") endif () - if (last_vds_test) - set_tests_properties (H5DUMP-${resultfile} PROPERTIES DEPENDS ${last_VDS_test}) - endif () else () add_test ( NAME H5DUMP-${resultfile} @@ -140,6 +145,20 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () + set_tests_properties (H5DUMP-${resultfile} PROPERTIES + DEPENDS H5DUMP-${resultfile}-clear-objects + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds" + ) + add_test ( + NAME H5DUMP-${resultfile}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5DUMP-${resultfile}-clean-objects PROPERTIES + DEPENDS H5DUMP-${resultfile} + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/vds" + ) endmacro () macro (ADD_H5_VDS_PREFIX_TEST resultfile resultcode) diff --git a/tools/test/h5dump/CMakeTestsXML.cmake b/tools/test/h5dump/CMakeTestsXML.cmake index d735257..a09256d 100644 --- a/tools/test/h5dump/CMakeTestsXML.cmake +++ b/tools/test/h5dump/CMakeTestsXML.cmake @@ -175,15 +175,20 @@ endmacro () macro (ADD_XML_H5_TEST resultfile resultcode) + 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" + ) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5DUMP_XML-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5dump${tgt_file_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") endif () - if (last_xml_test) - set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES DEPENDS ${last_xml_test}) - endif () else () add_test ( NAME H5DUMP_XML-${resultfile} @@ -198,6 +203,20 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () + set_tests_properties (H5DUMP_XML-${resultfile} PROPERTIES + DEPENDS H5DUMP_XML-${resultfile}-clear-objects + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml" + ) + add_test ( + NAME H5DUMP_XML-${resultfile}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5DUMP_XML-${resultfile}-clean-objects PROPERTIES + DEPENDS H5DUMP_XML-${resultfile} + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles/xml" + ) endmacro () ############################################################################## diff --git a/tools/test/h5dump/CMakeVFDTests.cmake b/tools/test/h5dump/CMakeVFDTests.cmake index 7ab8c1f..bd189da 100644 --- a/tools/test/h5dump/CMakeVFDTests.cmake +++ b/tools/test/h5dump/CMakeVFDTests.cmake @@ -42,6 +42,15 @@ add_custom_target(HDF5_VFD_H5DUMP_files ALL COMMENT "Copying files needed by HDF macro (ADD_VFD_H5DUMP_TEST vfdname resultfile resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( + NAME H5DUMP_VFD-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5DUMP_VFD-${resultfile}-clear-objects PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdname}" + ) + add_test ( NAME H5DUMP_VFD-${vfdname}-${resultfile}-h5dump COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" @@ -55,6 +64,21 @@ macro (ADD_VFD_H5DUMP_TEST vfdname resultfile resultcode) -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) set_tests_properties (H5DUMP_VFD-${vfdname}-${resultfile}-h5dump PROPERTIES TIMEOUT ${CTEST_SHORT_TIMEOUT}) + set_tests_properties (H5DUMP_VFD-${resultfile} PROPERTIES + DEPENDS H5DUMP_VFD-${resultfile}-clear-objects + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdname}" + ) + add_test ( + NAME H5DUMP_VFD-${resultfile}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5DUMP_VFD-${resultfile}-clean-objects PROPERTIES + DEPENDS H5DUMP_VFD-${resultfile} + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/${vfdname}" + ) + endmacro () endif () endmacro () diff --git a/tools/test/h5format_convert/CMakeTests.cmake b/tools/test/h5format_convert/CMakeTests.cmake index 00a28bb..0f68a79 100644 --- a/tools/test/h5format_convert/CMakeTests.cmake +++ b/tools/test/h5format_convert/CMakeTests.cmake @@ -101,49 +101,58 @@ # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5FC-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/outtmp.h5 + NAME H5FC-${testname}-${testfile}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}-tmp.h5 ) - if (last_test) - set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () 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/${testname}-tmp.h5 + ) + set_tests_properties (H5FC-${testname}-${testfile}-tmpfile PROPERTIES + DEPENDS H5FC-${testname}-${testfile}-clear-objects ) - 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_file_ext}>" - -D "TEST_ARGS=${ARGN};outtmp.h5" + -D "TEST_ARGS=${ARGN};${testname}-tmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${testname}.out" + -D "TEST_OUTPUT=${testname}-${testfile}.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_REFERENCE=${resultfile}" -D "TEST_ERRREF=${resultfile}.err" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5FC-${testname}-${testfile} PROPERTIES DEPENDS "H5FC-${testname}-${testfile}-tmpfile") + set_tests_properties (H5FC-${testname}-${testfile} PROPERTIES + DEPENDS H5FC-${testname}-${testfile}-tmpfile + ) set (last_test "H5FC-${testname}-${testfile}") else () add_test ( - NAME H5FC-${testname}-NA + NAME H5FC-${testname}-${testfile}-NA COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>" -D "TEST_ARGS=${ARGN}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${testname}.out" + -D "TEST_OUTPUT=${testname}-${testfile}.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_REFERENCE=${resultfile}" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5FC-${testname}-NA PROPERTIES DEPENDS "H5FC-${testname}-clear-objects") - set (last_test "H5FC-${testname}-NA") + set_tests_properties (H5FC-${testname}-${testfile}-NA PROPERTIES + DEPENDS H5FC-${testname}-${testfile}-tmpfile + ) endif () + add_test ( + NAME H5FC-${testname}-${testfile}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}-tmp.h5 + ) + set_tests_properties (H5FC-${testname}-${testfile}-clean-objects PROPERTIES + DEPENDS H5FC-${testname}-${testfile}-NA + ) endif () endmacro () @@ -151,31 +160,38 @@ # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5FC-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/outtmp.h5 + NAME H5FC-${testname}-${testfile}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}-tmp.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/${testname}-tmp.h5 + ) + set_tests_properties (H5FC-${testname}-${testfile}-tmpfile PROPERTIES + DEPENDS H5FC-${testname}-${testfile}-clear-object ) - 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_file_ext}>" - -D "TEST_ARGS=${ARGN};outtmp.h5" + -D "TEST_ARGS=${ARGN};${testname}-tmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${testname}.out" + -D "TEST_OUTPUT=${testname}-${testfile}.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_REFERENCE=${resultfile}" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5FC-${testname}-${testfile} PROPERTIES DEPENDS "H5FC-${testname}-${testfile}-tmpfile") - set (last_test "H5FC-${testname}-${testfile}") + set_tests_properties (H5FC-${testname}-${testfile} PROPERTIES + DEPENDS H5FC-${testname}-${testfile}-tmpfile + ) + add_test ( + NAME H5FC-${testname}-${testfile}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}-tmp.h5 + ) + set_tests_properties (H5FC-${testname}-${testfile}-clean-objects PROPERTIES + DEPENDS H5FC-${testname}-${testfile} + ) endif () endmacro () @@ -183,32 +199,39 @@ # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5FC-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/outtmp.h5 + NAME H5FC-${testname}-${testfile}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}-tmp.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/${testname}-tmp.h5 + ) + set_tests_properties (H5FC-${testname}-${testfile}-tmpfile PROPERTIES + DEPENDS H5FC-${testname}-${testfile}-clear-objects ) - 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_file_ext}>" - -D "TEST_ARGS=${ARGN};outtmp.h5" + -D "TEST_ARGS=${ARGN};${testname}-tmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_OUTPUT=${testname}.out" + -D "TEST_OUTPUT=${testname}-${testfile}.out" -D "TEST_EXPECT=${resultcode}" -D "TEST_REFERENCE=${resultfile}" -D "TEST_ERRREF=${result_errcheck}" -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) - set_tests_properties (H5FC-${testname}-${testfile} PROPERTIES DEPENDS "H5FC-${testname}-${testfile}-tmpfile") - set (last_test "H5FC-${testname}-${testfile}") + set_tests_properties (H5FC-${testname}-${testfile} PROPERTIES + DEPENDS H5FC-${testname}-${testfile}-tmpfile + ) + add_test ( + NAME H5FC-${testname}-${testfile}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/${testname}-tmp.h5 + ) + set_tests_properties (H5FC-${testname}-${testfile}-clean-objects PROPERTIES + DEPENDS H5FC-${testname}-${testfile} + ) endif () endmacro () @@ -217,30 +240,44 @@ if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5FC-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/tmp.h5 + COMMAND ${CMAKE_COMMAND} -E remove + ./testfiles/${testname}-tmp.h5 ) - if (last_test) - set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES DEPENDS ${last_test}) - endif () + set_tests_properties (H5FC-${testname}-clear-objects PROPERTIES + FIXTURES_SETUP clear_H5FC-${testname} + ) + add_test ( + NAME H5FC_CHECK_IDX-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ./testfiles/${testname}-tmp.h5 + ) + set_tests_properties (H5FC_CHECK_IDX-${testname}-clean-objects PROPERTIES + FIXTURES_CLEANUP clear_H5FC-${testname} + ) + 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/${testname}-tmp.h5 + ) + set_tests_properties (H5FC-${testname}-tmpfile PROPERTIES + FIXTURES_REQUIRED clear_H5FC-${testname} ) - 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_file_ext}>" - -D "TEST_ARGS=${ARGN};./testfiles/tmp.h5" + -D "TEST_ARGS=${ARGN};./testfiles/${testname}-tmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=testfiles/${testname}.out" -D "TEST_SKIP_COMPARE=TRUE" -D "TEST_EXPECT=${resultcode}" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5FC-${testname} PROPERTIES DEPENDS "H5FC-${testname}-tmpfile") - set (last_test "H5FC-${testname}") + set_tests_properties (H5FC-${testname} PROPERTIES + DEPENDS "H5FC-${testname}-tmpfile" + FIXTURES_REQUIRED clear_H5FC-${testname} + ) endif () endmacro () @@ -248,47 +285,61 @@ # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5FC_CHECK_IDX-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5fc_chk_idx> ./testfiles/tmp.h5 ${ARGN} + NAME H5FC_CHECK_IDX-${dependtest}-${testname} + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5fc_chk_idx> ./testfiles/${dependtest}-tmp.h5 ${ARGN} ) - set_tests_properties (H5FC_CHECK_IDX-${testname} PROPERTIES DEPENDS "H5FC-${dependtest}") - endif () + set_tests_properties (H5FC_CHECK_IDX-${dependtest}-${testname} PROPERTIES + DEPENDS "H5FC-${dependtest}" + FIXTURES_REQUIRED clear_H5FC-${dependtest} + ) + endif () endmacro () macro (ADD_H5_TEST_CHECK_IDX testname resultcode testfile) # If using memchecker add tests without using scripts if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5FC-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove ./testfiles/chktmp.h5 + NAME H5FC_TEST_CHECK_IDX-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove + ./testfiles/${testname}-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/chktmp.h5 + NAME H5FC_TEST_CHECK_IDX-${testname}-tmpfile + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testfile} ./testfiles/${testname}-tmp.h5 + ) + set_tests_properties (H5FC_TEST_CHECK_IDX-${testname}-tmpfile PROPERTIES + DEPENDS "H5FC_TEST_CHECK_IDX-${testname}-clear-objects" ) - set_tests_properties (H5FC-${testname}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects") add_test ( - NAME H5FC-${testname} + NAME H5FC_TEST_CHECK_IDX-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>" - -D "TEST_ARGS=-d;${ARGN};./testfiles/chktmp.h5" + -D "TEST_ARGS=-d;${ARGN};./testfiles/${testname}-tmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=testfiles/${testname}.out" -D "TEST_SKIP_COMPARE=TRUE" -D "TEST_EXPECT=${resultcode}" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5FC-${testname} PROPERTIES DEPENDS "H5FC-${testname}-tmpfile") + set_tests_properties (H5FC_TEST_CHECK_IDX-${testname} PROPERTIES + DEPENDS "H5FC_TEST_CHECK_IDX-${testname}-tmpfile" + ) + add_test ( + NAME H5FC_TEST_CHECK_IDX-${testname}-check + COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5fc_chk_idx> ./testfiles/${testname}-tmp.h5 ${ARGN} + ) + set_tests_properties (H5FC_TEST_CHECK_IDX-${testname}-check PROPERTIES + DEPENDS "H5FC_TEST_CHECK_IDX-${testname}" + ) add_test ( - NAME H5FC_CHECK_IDX-${testname} - COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5fc_chk_idx> ./testfiles/chktmp.h5 ${ARGN} + NAME H5FC_TEST_CHECK_IDX-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ./testfiles/${testname}-tmp.h5 + ) + set_tests_properties (H5FC_TEST_CHECK_IDX-${testname}-clean-objects PROPERTIES + DEPENDS H5FC_TEST_CHECK_IDX-${testname}-check ) - set_tests_properties (H5FC_CHECK_IDX-${testname} PROPERTIES DEPENDS "H5FC-${testname}") - set (last_test "H5FC_CHECK_IDX-${testname}") endif () endmacro () @@ -296,44 +347,55 @@ # 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 + NAME H5FC_H5DUMP_CHECK-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove + ./testfiles/${testname}-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/${testname}.h5 testfiles/dmptmp.h5 + NAME H5FC_H5DUMP_CHECK-${testname}-tmpfile + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${HDF5_TOOLS_TEST_H5FC_SOURCE_DIR}/testfiles/${testname}.h5 ./testfiles/${testname}-tmp.h5 + ) + set_tests_properties (H5FC_H5DUMP_CHECK-${testname}-tmpfile PROPERTIES + DEPENDS "H5FC_H5DUMP_CHECK-${testname}-clear-objects" ) - set_tests_properties (H5FC-${testname}-tmpfile PROPERTIES DEPENDS "H5FC-${testname}-clear-objects") add_test ( - NAME H5FC-${testname} + NAME H5FC_H5DUMP_CHECK-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5format_convert${tgt_file_ext}>" - -D "TEST_ARGS=${ARGN};./testfiles/dmptmp.h5" + -D "TEST_ARGS=${ARGN};./testfiles/${testname}-tmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=testfiles/${testname}.out" -D "TEST_SKIP_COMPARE=TRUE" -D "TEST_EXPECT=0" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5FC-${testname} PROPERTIES DEPENDS "H5FC-${testname}-tmpfile") + set_tests_properties (H5FC_H5DUMP_CHECK-${testname} PROPERTIES + DEPENDS "H5FC_H5DUMP_CHECK-${testname}-tmpfile" + ) add_test ( - NAME H5FC_CHECK_DUMP-${testname} + NAME H5FC_H5DUMP_CHECK-${testname}-dump COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" - -D "TEST_ARGS:STRING=-BH;./testfiles/dmptmp.h5" + -D "TEST_ARGS:STRING=-BH;./testfiles/${testname}-tmp.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=testfiles/${testname}_chk.out" -D "TEST_EXPECT=0" -D "TEST_REFERENCE=testfiles/${testname}.ddl" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) - set_tests_properties (H5FC_CHECK_DUMP-${testname} PROPERTIES DEPENDS "H5FC-${testname}") - set (last_test "H5FC_CHECK_DUMP-${testname}") + set_tests_properties (H5FC_H5DUMP_CHECK-${testname}-dump PROPERTIES + DEPENDS "H5FC_H5DUMP_CHECK-${testname}" + ) + add_test ( + NAME H5FC_H5DUMP_CHECK-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ./testfiles/${testname}-tmp.h5 + ) + set_tests_properties (H5FC_H5DUMP_CHECK-${testname}-clean-objects PROPERTIES + DEPENDS H5FC_H5DUMP_CHECK-${testname}-dump + ) endif () endmacro () @@ -343,22 +405,6 @@ ############################################################################## ############################################################################## - if (HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - add_test ( - NAME H5FC-clearall-objects - COMMAND ${CMAKE_COMMAND} -E remove - outtmp.h5 - tmp.h5 - chktmp.h5 - dmptmp.h5 - ) - if (last_test) - set_tests_properties (H5FC-clearall-objects PROPERTIES DEPENDS ${last_test}) - endif () - set (last_test "H5FC-clearall-objects") - endif () - # h5format_convert --help # h5format_convert (no options) # h5format_convert nonexist.h5 (no options, file does not exist) diff --git a/tools/test/h5format_convert/testfiles/h5fc_ext1_f.ddl b/tools/test/h5format_convert/testfiles/h5fc_ext1_f.ddl index db00a99..f788913 100644 --- a/tools/test/h5format_convert/testfiles/h5fc_ext1_f.ddl +++ b/tools/test/h5format_convert/testfiles/h5fc_ext1_f.ddl @@ -1,4 +1,4 @@ -HDF5 "./testfiles/dmptmp.h5" { +HDF5 "./testfiles/h5fc_ext1_f-tmp.h5" { SUPER_BLOCK { SUPERBLOCK_VERSION 2 FREELIST_VERSION 0 diff --git a/tools/test/h5format_convert/testfiles/h5fc_ext1_i.ddl b/tools/test/h5format_convert/testfiles/h5fc_ext1_i.ddl index 4be6d90..6564031 100644 --- a/tools/test/h5format_convert/testfiles/h5fc_ext1_i.ddl +++ b/tools/test/h5format_convert/testfiles/h5fc_ext1_i.ddl @@ -1,4 +1,4 @@ -HDF5 "./testfiles/dmptmp.h5" { +HDF5 "./testfiles/h5fc_ext1_i-tmp.h5" { SUPER_BLOCK { SUPERBLOCK_VERSION 2 FREELIST_VERSION 0 diff --git a/tools/test/h5format_convert/testfiles/h5fc_ext1_s.ddl b/tools/test/h5format_convert/testfiles/h5fc_ext1_s.ddl index db00a99..746de2b 100644 --- a/tools/test/h5format_convert/testfiles/h5fc_ext1_s.ddl +++ b/tools/test/h5format_convert/testfiles/h5fc_ext1_s.ddl @@ -1,4 +1,4 @@ -HDF5 "./testfiles/dmptmp.h5" { +HDF5 "./testfiles/h5fc_ext1_s-tmp.h5" { SUPER_BLOCK { SUPERBLOCK_VERSION 2 FREELIST_VERSION 0 diff --git a/tools/test/h5format_convert/testfiles/h5fc_ext2_if.ddl b/tools/test/h5format_convert/testfiles/h5fc_ext2_if.ddl index 4be6d90..57781ec 100644 --- a/tools/test/h5format_convert/testfiles/h5fc_ext2_if.ddl +++ b/tools/test/h5format_convert/testfiles/h5fc_ext2_if.ddl @@ -1,4 +1,4 @@ -HDF5 "./testfiles/dmptmp.h5" { +HDF5 "./testfiles/h5fc_ext2_if-tmp.h5" { SUPER_BLOCK { SUPERBLOCK_VERSION 2 FREELIST_VERSION 0 diff --git a/tools/test/h5format_convert/testfiles/h5fc_ext2_is.ddl b/tools/test/h5format_convert/testfiles/h5fc_ext2_is.ddl index 4be6d90..8fd061d 100644 --- a/tools/test/h5format_convert/testfiles/h5fc_ext2_is.ddl +++ b/tools/test/h5format_convert/testfiles/h5fc_ext2_is.ddl @@ -1,4 +1,4 @@ -HDF5 "./testfiles/dmptmp.h5" { +HDF5 "./testfiles/h5fc_ext2_is-tmp.h5" { SUPER_BLOCK { SUPERBLOCK_VERSION 2 FREELIST_VERSION 0 diff --git a/tools/test/h5format_convert/testfiles/h5fc_ext2_sf.ddl b/tools/test/h5format_convert/testfiles/h5fc_ext2_sf.ddl index db00a99..435ed46 100644 --- a/tools/test/h5format_convert/testfiles/h5fc_ext2_sf.ddl +++ b/tools/test/h5format_convert/testfiles/h5fc_ext2_sf.ddl @@ -1,4 +1,4 @@ -HDF5 "./testfiles/dmptmp.h5" { +HDF5 "./testfiles/h5fc_ext2_sf-tmp.h5" { SUPER_BLOCK { SUPERBLOCK_VERSION 2 FREELIST_VERSION 0 diff --git a/tools/test/h5format_convert/testfiles/h5fc_ext3_isf.ddl b/tools/test/h5format_convert/testfiles/h5fc_ext3_isf.ddl index 4be6d90..57a78d3 100644 --- a/tools/test/h5format_convert/testfiles/h5fc_ext3_isf.ddl +++ b/tools/test/h5format_convert/testfiles/h5fc_ext3_isf.ddl @@ -1,4 +1,4 @@ -HDF5 "./testfiles/dmptmp.h5" { +HDF5 "./testfiles/h5fc_ext3_isf-tmp.h5" { SUPER_BLOCK { SUPERBLOCK_VERSION 2 FREELIST_VERSION 0 diff --git a/tools/test/h5format_convert/testfiles/h5fc_v_all.ddl b/tools/test/h5format_convert/testfiles/h5fc_v_all.ddl index a1af831..c5e55c7 100644 --- a/tools/test/h5format_convert/testfiles/h5fc_v_all.ddl +++ b/tools/test/h5format_convert/testfiles/h5fc_v_all.ddl @@ -1,5 +1,5 @@ Process command line options -Open the file outtmp.h5 +Open the file h5fc_v_all-tmp.h5 Processing all datasets in the file... Going to process dataset:/DSET_CONTIGUOUS... Open the dataset diff --git a/tools/test/h5format_convert/testfiles/h5fc_v_bt1.ddl b/tools/test/h5format_convert/testfiles/h5fc_v_bt1.ddl index 31de12a..23f775d 100644 --- a/tools/test/h5format_convert/testfiles/h5fc_v_bt1.ddl +++ b/tools/test/h5format_convert/testfiles/h5fc_v_bt1.ddl @@ -1,5 +1,5 @@ Process command line options -Open the file outtmp.h5 +Open the file h5fc_v_bt1-tmp.h5 Going to process dataset: /GROUP/DSET_BT2... Open the dataset Retrieve the dataset's layout diff --git a/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl b/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl index 0b7d0ac..066f2d5 100644 --- a/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl +++ b/tools/test/h5format_convert/testfiles/h5fc_v_err.ddl @@ -1,5 +1,5 @@ Process command line options -Open the file outtmp.h5 +Open the file h5fc_v_err-tmp.h5 Processing all datasets in the file... Going to process dataset:/DSET_ERR... Open the dataset diff --git a/tools/test/h5format_convert/testfiles/h5fc_v_n_1d.ddl b/tools/test/h5format_convert/testfiles/h5fc_v_n_1d.ddl index fcdadd8..1c6d7fb 100644 --- a/tools/test/h5format_convert/testfiles/h5fc_v_n_1d.ddl +++ b/tools/test/h5format_convert/testfiles/h5fc_v_n_1d.ddl @@ -1,6 +1,6 @@ Process command line options It is noop... -Open the file outtmp.h5 +Open the file h5fc_v_n_1d-tmp.h5 Going to process dataset: /DSET_EA... Open the dataset Retrieve the dataset's layout diff --git a/tools/test/h5format_convert/testfiles/h5fc_v_n_all.ddl b/tools/test/h5format_convert/testfiles/h5fc_v_n_all.ddl index 074ce6f..ad00d92 100644 --- a/tools/test/h5format_convert/testfiles/h5fc_v_n_all.ddl +++ b/tools/test/h5format_convert/testfiles/h5fc_v_n_all.ddl @@ -1,6 +1,6 @@ Process command line options It is noop... -Open the file outtmp.h5 +Open the file h5fc_v_n_all-tmp.h5 Processing all datasets in the file... Going to process dataset:/DSET_CONTIGUOUS... Open the dataset diff --git a/tools/test/h5format_convert/testfiles/h5fc_v_ndata_bt1.ddl b/tools/test/h5format_convert/testfiles/h5fc_v_ndata_bt1.ddl index c75699a..e79b11a 100644 --- a/tools/test/h5format_convert/testfiles/h5fc_v_ndata_bt1.ddl +++ b/tools/test/h5format_convert/testfiles/h5fc_v_ndata_bt1.ddl @@ -1,6 +1,6 @@ Process command line options It is noop... -Open the file outtmp.h5 +Open the file h5fc_v_ndata_bt1-tmp.h5 Going to process dataset: /DSET_NDATA_BT2... Open the dataset Retrieve the dataset's layout diff --git a/tools/test/h5format_convert/testfiles/h5fc_v_non_chunked.ddl b/tools/test/h5format_convert/testfiles/h5fc_v_non_chunked.ddl index 5945389..50575c0 100644 --- a/tools/test/h5format_convert/testfiles/h5fc_v_non_chunked.ddl +++ b/tools/test/h5format_convert/testfiles/h5fc_v_non_chunked.ddl @@ -1,5 +1,5 @@ Process command line options -Open the file outtmp.h5 +Open the file h5fc_v_non_chunked-tmp.h5 Going to process dataset: /DSET_CONTIGUOUS... Open the dataset Retrieve the dataset's layout diff --git a/tools/test/h5format_convert/testfiles/old_h5fc_ext1_f.ddl b/tools/test/h5format_convert/testfiles/old_h5fc_ext1_f.ddl index db00a99..45fa3fb 100644 --- a/tools/test/h5format_convert/testfiles/old_h5fc_ext1_f.ddl +++ b/tools/test/h5format_convert/testfiles/old_h5fc_ext1_f.ddl @@ -1,4 +1,4 @@ -HDF5 "./testfiles/dmptmp.h5" { +HDF5 "./testfiles/old_h5fc_ext1_f-tmp.h5" { SUPER_BLOCK { SUPERBLOCK_VERSION 2 FREELIST_VERSION 0 diff --git a/tools/test/h5format_convert/testfiles/old_h5fc_ext1_i.ddl b/tools/test/h5format_convert/testfiles/old_h5fc_ext1_i.ddl index d9cc0b7..67a7116 100644 --- a/tools/test/h5format_convert/testfiles/old_h5fc_ext1_i.ddl +++ b/tools/test/h5format_convert/testfiles/old_h5fc_ext1_i.ddl @@ -1,4 +1,4 @@ -HDF5 "./testfiles/dmptmp.h5" { +HDF5 "./testfiles/old_h5fc_ext1_i-tmp.h5" { SUPER_BLOCK { SUPERBLOCK_VERSION 1 FREELIST_VERSION 0 diff --git a/tools/test/h5format_convert/testfiles/old_h5fc_ext1_s.ddl b/tools/test/h5format_convert/testfiles/old_h5fc_ext1_s.ddl index db00a99..7f67d9f 100644 --- a/tools/test/h5format_convert/testfiles/old_h5fc_ext1_s.ddl +++ b/tools/test/h5format_convert/testfiles/old_h5fc_ext1_s.ddl @@ -1,4 +1,4 @@ -HDF5 "./testfiles/dmptmp.h5" { +HDF5 "./testfiles/old_h5fc_ext1_s-tmp.h5" { SUPER_BLOCK { SUPERBLOCK_VERSION 2 FREELIST_VERSION 0 diff --git a/tools/test/h5format_convert/testfiles/old_h5fc_ext2_if.ddl b/tools/test/h5format_convert/testfiles/old_h5fc_ext2_if.ddl index 4be6d90..350d3ba 100644 --- a/tools/test/h5format_convert/testfiles/old_h5fc_ext2_if.ddl +++ b/tools/test/h5format_convert/testfiles/old_h5fc_ext2_if.ddl @@ -1,4 +1,4 @@ -HDF5 "./testfiles/dmptmp.h5" { +HDF5 "./testfiles/old_h5fc_ext2_if-tmp.h5" { SUPER_BLOCK { SUPERBLOCK_VERSION 2 FREELIST_VERSION 0 diff --git a/tools/test/h5format_convert/testfiles/old_h5fc_ext2_is.ddl b/tools/test/h5format_convert/testfiles/old_h5fc_ext2_is.ddl index 4be6d90..6b2b2c3 100644 --- a/tools/test/h5format_convert/testfiles/old_h5fc_ext2_is.ddl +++ b/tools/test/h5format_convert/testfiles/old_h5fc_ext2_is.ddl @@ -1,4 +1,4 @@ -HDF5 "./testfiles/dmptmp.h5" { +HDF5 "./testfiles/old_h5fc_ext2_is-tmp.h5" { SUPER_BLOCK { SUPERBLOCK_VERSION 2 FREELIST_VERSION 0 diff --git a/tools/test/h5format_convert/testfiles/old_h5fc_ext2_sf.ddl b/tools/test/h5format_convert/testfiles/old_h5fc_ext2_sf.ddl index db00a99..4a038e3 100644 --- a/tools/test/h5format_convert/testfiles/old_h5fc_ext2_sf.ddl +++ b/tools/test/h5format_convert/testfiles/old_h5fc_ext2_sf.ddl @@ -1,4 +1,4 @@ -HDF5 "./testfiles/dmptmp.h5" { +HDF5 "./testfiles/old_h5fc_ext2_sf-tmp.h5" { SUPER_BLOCK { SUPERBLOCK_VERSION 2 FREELIST_VERSION 0 diff --git a/tools/test/h5format_convert/testfiles/old_h5fc_ext3_isf.ddl b/tools/test/h5format_convert/testfiles/old_h5fc_ext3_isf.ddl index 4be6d90..602627f 100644 --- a/tools/test/h5format_convert/testfiles/old_h5fc_ext3_isf.ddl +++ b/tools/test/h5format_convert/testfiles/old_h5fc_ext3_isf.ddl @@ -1,4 +1,4 @@ -HDF5 "./testfiles/dmptmp.h5" { +HDF5 "./testfiles/old_h5fc_ext3_isf-tmp.h5" { SUPER_BLOCK { SUPERBLOCK_VERSION 2 FREELIST_VERSION 0 diff --git a/tools/test/h5format_convert/testh5fc.sh.in b/tools/test/h5format_convert/testh5fc.sh.in index df083d1..87ceb9f 100644 --- a/tools/test/h5format_convert/testh5fc.sh.in +++ b/tools/test/h5format_convert/testh5fc.sh.in @@ -67,10 +67,10 @@ TESTDIR=./testfiles test -d $TESTDIR || mkdir $TESTDIR # Copy the testfile to a temporary file for testing as h5format_convert is changing the file in place -TMPOUTFILE=outtmp.h5 +TMPOUTFILE=tmp.h5 TMPFILE=tmp.h5 -TMPCHKFILE=chktmp.h5 -TMPDMPFILE=dmptmp.h5 +TMPCHKFILE=tmp.h5 +TMPDMPFILE=tmp.h5 ###################################################################### # test files @@ -183,10 +183,10 @@ CLEAN_TESTFILES_AND_TESTDIR() if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then $RM $TESTDIR else - $RM $TESTDIR/$TMPFILE + $RM $TESTDIR/$TMPFILE $RM $TESTDIR/$TMPOUTFILE $RM $TESTDIR/$TMPCHKFILE - $RM $TESTDIR/$TMPDMPFILE + $RM $TESTDIR/*-$TMPDMPFILE fi } @@ -225,13 +225,14 @@ TOOLTEST_OUT() { actual_err="$TESTDIR/`basename $1 .ddl`.out.err" actual_sav=${actual}-sav actual_err_sav=${actual_err}-sav + testfile="`basename $1 .ddl`-tmp.h5" # Prepare the test file - $RM $TESTDIR/$TMPOUTFILE + $RM $TESTDIR/$testfile TFILE=$2 if [ ! -z "$2" ] && [ -e $TESTDIR/$2 ] ; then - $CP $TESTDIR/$2 $TESTDIR/$TMPOUTFILE - TFILE=$TMPOUTFILE + $CP $TESTDIR/$2 $TESTDIR/$testfile + TFILE=$testfile fi # Run test. @@ -262,13 +263,14 @@ TOOLTEST_MASK_OUT() { actual_err="$TESTDIR/`basename $1 .ddl`.out.err" actual_sav=${actual}-sav actual_err_sav=${actual_err}-sav + testfile="`basename $1 .ddl`-tmp.h5" # Prepare the test file - $RM $TESTDIR/$TMPOUTFILE + $RM $TESTDIR/$testfile TFILE=$2 if [ ! -z "$2" ] && [ -e $TESTDIR/$2 ] ; then - $CP $TESTDIR/$2 $TESTDIR/$TMPOUTFILE - TFILE=$TMPOUTFILE + $CP $TESTDIR/$2 $TESTDIR/$testfile + TFILE=$testfile fi # Run test. @@ -322,13 +324,14 @@ TOOLTEST_ERR() { actual_err="$TESTDIR/`basename $1 .ddl`.out.err" actual_sav=${actual}-sav actual_err_sav=${actual_err}-sav + testfile="`basename $1 .ddl`-tmp.h5" # Prepare the test file - $RM $TESTDIR/$TMPOUTFILE + $RM $TESTDIR/$testfile TFILE=$2 if [ ! -z "$2" ] && [ -e $TESTDIR/$2 ] ; then - $CP $TESTDIR/$2 $TESTDIR/$TMPOUTFILE - TFILE=$TMPOUTFILE + $CP $TESTDIR/$2 $TESTDIR/$testfile + TFILE=$testfile fi # Run test. @@ -361,9 +364,10 @@ TOOLTEST_ERR() { # -n TOOLTEST() { TESTING $FORMCONV $3 $4 $5 $1 - $RM $TESTDIR/$2 - $CP $TESTDIR/$1 $TESTDIR/$2 - $RUNSERIAL $FORMCONV_BIN $3 $4 $5 $TESTDIR/$2 + testfile="`basename $1 .h5`-tmp.h5" + $RM $TESTDIR/$testfile + $CP $TESTDIR/$1 $TESTDIR/$testfile + $RUNSERIAL $FORMCONV_BIN $3 $4 $5 $TESTDIR/$testfile exitcode=$? if [ $exitcode -ne 0 ]; then echo "*FAILED*" @@ -383,7 +387,7 @@ CHECKING() { # $1 dataset name IDX_CHECK() { CHECKING $1 - $RUNSERIAL $CHK_IDX_BIN $TESTDIR/$TMPCHKFILE $1 + $RUNSERIAL $CHK_IDX_BIN $TESTDIR/$2 $1 ret=$? if [ $ret -eq 0 ]; then echo " PASSED" @@ -415,7 +419,8 @@ H5DUMP_CHECK() { expect="$TESTDIR/$2" actual="$TESTDIR/`basename $2 .ddl`.out" actual_err="$TESTDIR/`basename $2 .ddl`.err" - $RUNSERIAL $H5DUMP_BIN -BH $TESTDIR/$TMPDMPFILE > $actual 2>$actual_err + testfile="`basename $2 .ddl`-tmp.h5" + $RUNSERIAL $H5DUMP_BIN -BH $TESTDIR/$testfile > $actual 2>$actual_err cat $actual_err >> $actual # Compare output @@ -498,45 +503,45 @@ TOOLTEST_MASK_OUT h5fc_v_err.ddl h5fc_err_level.h5 -v # h5format_convert -d /GROUP/DSET_FA h5fc_ext_none.h5 # h5format_convert -d /DSET_NONE h5fc_ext_none.h5 # h5format_convert -d /GROUP/DSET_NDATA_NONE h5fc_ext_none.h5 -TOOLTEST h5fc_ext_none.h5 $TMPCHKFILE -d /DSET_EA -IDX_CHECK /DSET_EA +TOOLTEST h5fc_ext_none.h5 h5fc_ext_none-tmp.h5 -d /DSET_EA +IDX_CHECK /DSET_EA h5fc_ext_none-tmp.h5 # -TOOLTEST h5fc_ext_none.h5 $TMPCHKFILE -d /GROUP/DSET_NDATA_EA -IDX_CHECK /GROUP/DSET_NDATA_EA +TOOLTEST h5fc_ext_none.h5 h5fc_ext_none-tmp.h5 -d /GROUP/DSET_NDATA_EA +IDX_CHECK /GROUP/DSET_NDATA_EA h5fc_ext_none-tmp.h5 # -TOOLTEST h5fc_ext_none.h5 $TMPCHKFILE -d /GROUP/DSET_BT2 -IDX_CHECK /GROUP/DSET_BT2 +TOOLTEST h5fc_ext_none.h5 h5fc_ext_none-tmp.h5 -d /GROUP/DSET_BT2 +IDX_CHECK /GROUP/DSET_BT2 h5fc_ext_none-tmp.h5 # -TOOLTEST h5fc_ext_none.h5 $TMPCHKFILE -d /DSET_NDATA_BT2 -IDX_CHECK /DSET_NDATA_BT2 +TOOLTEST h5fc_ext_none.h5 h5fc_ext_none-tmp.h5 -d /DSET_NDATA_BT2 +IDX_CHECK /DSET_NDATA_BT2 h5fc_ext_none-tmp.h5 # -TOOLTEST h5fc_ext_none.h5 $TMPCHKFILE -d /DSET_FA -IDX_CHECK /DSET_FA +TOOLTEST h5fc_ext_none.h5 h5fc_ext_none-tmp.h5 -d /DSET_FA +IDX_CHECK /DSET_FA h5fc_ext_none-tmp.h5 # -TOOLTEST h5fc_ext_none.h5 $TMPCHKFILE -d /GROUP/DSET_NDATA_FA -IDX_CHECK /GROUP/DSET_NDATA_FA +TOOLTEST h5fc_ext_none.h5 h5fc_ext_none-tmp.h5 -d /GROUP/DSET_NDATA_FA +IDX_CHECK /GROUP/DSET_NDATA_FA h5fc_ext_none-tmp.h5 # -TOOLTEST h5fc_ext_none.h5 $TMPCHKFILE -d /DSET_NONE -IDX_CHECK /DSET_NONE +TOOLTEST h5fc_ext_none.h5 h5fc_ext_none-tmp.h5 -d /DSET_NONE +IDX_CHECK /DSET_NONE h5fc_ext_none-tmp.h5 # -TOOLTEST h5fc_ext_none.h5 $TMPCHKFILE -d /GROUP/DSET_NDATA_NONE -IDX_CHECK /GROUP/DSET_NDATA_NONE +TOOLTEST h5fc_ext_none.h5 h5fc_ext_none-tmp.h5 -d /GROUP/DSET_NDATA_NONE +IDX_CHECK /GROUP/DSET_NDATA_NONE h5fc_ext_none-tmp.h5 # # # # No output from tests: just check exit code # h5format_convert -d /DSET_NDATA_BT2 old_h5fc_ext_none.h5 (v1-btree dataset) # h5format_convert -d /DSET_CONTIGUOUS h5fc_non_v3.h5 (non-chunked dataset) -TOOLTEST old_h5fc_ext_none.h5 $TMPFILE -d /DSET_NDATA_BT2 -TOOLTEST h5fc_non_v3.h5 $TMPFILE -d /DSET_CONTIGUOUS +TOOLTEST old_h5fc_ext_none.h5 old_h5fc_ext_none-tmp.h5 -d /DSET_NDATA_BT2 +TOOLTEST h5fc_non_v3.h5 h5fc_non_v3-tmp.h5 -d /DSET_CONTIGUOUS # # # # No output from tests: just check exit code # h5format_convert -d /GROUP/DSET_BT2 -n h5fc_non_v3.h5 (noop, one dataset) # h5format_convert -n h5fc_non_v3.h5 (noop, all datasets) -TOOLTEST h5fc_non_v3.h5 $TMPFILE -d /GROUP/DSET_BT2 -n -TOOLTEST h5fc_non_v3.h5 $TMPFILE -n +TOOLTEST h5fc_non_v3.h5 h5fc_non_v3-tmp.h5 -d /GROUP/DSET_BT2 -n +TOOLTEST h5fc_non_v3.h5 h5fc_non_v3-tmp.h5 -n # # # @@ -544,11 +549,11 @@ TOOLTEST h5fc_non_v3.h5 $TMPFILE -n # h5format_convert h5fc_non_v3.h5 # 1) convert all datasets # 2) verify indexing types -TOOLTEST h5fc_non_v3.h5 $TMPCHKFILE -IDX_CHECK /DSET_NDATA_EA -IDX_CHECK /DSET_NDATA_BT2 -IDX_CHECK /GROUP/DSET_BT2 -IDX_CHECK /GROUP/DSET_EA +TOOLTEST h5fc_non_v3.h5 h5fc_non_v3-tmp.h5 +IDX_CHECK /DSET_NDATA_EA h5fc_non_v3-tmp.h5 +IDX_CHECK /DSET_NDATA_BT2 h5fc_non_v3-tmp.h5 +IDX_CHECK /GROUP/DSET_BT2 h5fc_non_v3-tmp.h5 +IDX_CHECK /GROUP/DSET_EA h5fc_non_v3-tmp.h5 # # # @@ -556,47 +561,47 @@ IDX_CHECK /GROUP/DSET_EA # h5format_convert h5fc_edge_v3.h5 # 1) convert the chunked dataset (filter, no-filter-edge-chunk) # 2) verify the indexing type -TOOLTEST h5fc_edge_v3.h5 $TMPCHKFILE -IDX_CHECK /DSET_EDGE +TOOLTEST h5fc_edge_v3.h5 h5fc_edge_v3-tmp.h5 +IDX_CHECK /DSET_EDGE h5fc_edge_v3-tmp.h5 # # # The following test files have messages in the superblock extension. # Verify h5dump output for correctness after conversion -TOOLTEST h5fc_ext1_i.h5 $TMPDMPFILE +TOOLTEST h5fc_ext1_i.h5 h5fc_ext1_i-tmp.h5 H5DUMP_CHECK h5fc_ext1_i.h5 h5fc_ext1_i.ddl -TOOLTEST h5fc_ext1_s.h5 $TMPDMPFILE +TOOLTEST h5fc_ext1_s.h5 h5fc_ext1_s-tmp.h5 H5DUMP_CHECK h5fc_ext1_s.h5 h5fc_ext1_s.ddl -TOOLTEST h5fc_ext1_f.h5 $TMPDMPFILE +TOOLTEST h5fc_ext1_f.h5 h5fc_ext1_f-tmp.h5 H5DUMP_CHECK h5fc_ext1_f.h5 h5fc_ext1_f.ddl # -TOOLTEST h5fc_ext2_if.h5 $TMPDMPFILE +TOOLTEST h5fc_ext2_if.h5 h5fc_ext2_if-tmp.h5 H5DUMP_CHECK h5fc_ext2_if.h5 h5fc_ext2_if.ddl -TOOLTEST h5fc_ext2_is.h5 $TMPDMPFILE +TOOLTEST h5fc_ext2_is.h5 h5fc_ext2_is-tmp.h5 H5DUMP_CHECK h5fc_ext2_is.h5 h5fc_ext2_is.ddl -TOOLTEST h5fc_ext2_sf.h5 $TMPDMPFILE +TOOLTEST h5fc_ext2_sf.h5 h5fc_ext2_sf-tmp.h5 H5DUMP_CHECK h5fc_ext2_sf.h5 h5fc_ext2_sf.ddl # -TOOLTEST h5fc_ext3_isf.h5 $TMPDMPFILE +TOOLTEST h5fc_ext3_isf.h5 h5fc_ext3_isf-tmp.h5 H5DUMP_CHECK h5fc_ext3_isf.h5 h5fc_ext3_isf.ddl # # # -TOOLTEST old_h5fc_ext1_i.h5 $TMPDMPFILE +TOOLTEST old_h5fc_ext1_i.h5 old_h5fc_ext1_i-tmp.h5 H5DUMP_CHECK old_h5fc_ext1_i.h5 old_h5fc_ext1_i.ddl -TOOLTEST old_h5fc_ext1_s.h5 $TMPDMPFILE +TOOLTEST old_h5fc_ext1_s.h5 old_h5fc_ext1_s-tmp.h5 H5DUMP_CHECK old_h5fc_ext1_s.h5 old_h5fc_ext1_s.ddl -TOOLTEST old_h5fc_ext1_f.h5 $TMPDMPFILE +TOOLTEST old_h5fc_ext1_f.h5 old_h5fc_ext1_f-tmp.h5 H5DUMP_CHECK old_h5fc_ext1_f.h5 old_h5fc_ext1_f.ddl # -TOOLTEST old_h5fc_ext2_if.h5 $TMPDMPFILE +TOOLTEST old_h5fc_ext2_if.h5 old_h5fc_ext2_if-tmp.h5 H5DUMP_CHECK old_h5fc_ext2_if.h5 old_h5fc_ext2_if.ddl -TOOLTEST old_h5fc_ext2_is.h5 $TMPDMPFILE +TOOLTEST old_h5fc_ext2_is.h5 old_h5fc_ext2_is-tmp.h5 H5DUMP_CHECK old_h5fc_ext2_is.h5 old_h5fc_ext2_is.ddl -TOOLTEST old_h5fc_ext2_sf.h5 $TMPDMPFILE +TOOLTEST old_h5fc_ext2_sf.h5 old_h5fc_ext2_sf-tmp.h5 H5DUMP_CHECK old_h5fc_ext2_sf.h5 old_h5fc_ext2_sf.ddl # -TOOLTEST old_h5fc_ext3_isf.h5 $TMPDMPFILE +TOOLTEST old_h5fc_ext3_isf.h5 old_h5fc_ext3_isf-tmp.h5 H5DUMP_CHECK old_h5fc_ext3_isf.h5 old_h5fc_ext3_isf.ddl # # Clean up temporary files/directories diff --git a/tools/test/h5import/CMakeTests.cmake b/tools/test/h5import/CMakeTests.cmake index ee1d401..2e6105a 100644 --- a/tools/test/h5import/CMakeTests.cmake +++ b/tools/test/h5import/CMakeTests.cmake @@ -97,26 +97,23 @@ ############################################################################## 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 ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_file_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} - ) - set_tests_properties (H5IMPORT-${testname}-clear-objects PROPERTIES - FIXTURES_REQUIRED set_h5importtest - ) - - add_test (NAME H5IMPORT-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_file_ext}> ${importfile} -c ${conffile} -o ${testfile}) - set_tests_properties (H5IMPORT-${testname} PROPERTIES - DEPENDS H5IMPORT-${testname}-clear-objects - ) + add_test ( + NAME H5IMPORT-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${testfile} + ${testfile}.new + ) + set_tests_properties (H5IMPORT-${testname}-clear-objects PROPERTIES + FIXTURES_REQUIRED set_h5importtest + ) + add_test (NAME H5IMPORT-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5import${tgt_file_ext}> ${importfile} -c ${conffile} -o ${testfile}) + set_tests_properties (H5IMPORT-${testname} PROPERTIES + DEPENDS H5IMPORT-${testname}-clear-objects + FIXTURES_REQUIRED set_h5importtest + ) + # If using memchecker skip macro based tests + if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5IMPORT-${testname}-H5DMP COMMAND "${CMAKE_COMMAND}" @@ -125,6 +122,7 @@ -D "TEST_ARGS:STRING=${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=${testfile}.new" + -D "TEST_SAVE=1" -D "TEST_EXPECT=0" -D "TEST_FILTER=(^(HDF5)[^\n]*)" -D "TEST_SKIP_COMPARE=TRUE" @@ -132,6 +130,7 @@ ) set_tests_properties (H5IMPORT-${testname}-H5DMP PROPERTIES DEPENDS H5IMPORT-${testname} + FIXTURES_REQUIRED set_h5importtest ) add_test ( NAME H5IMPORT-${testname}-H5DMP_CMP @@ -148,8 +147,20 @@ ) set_tests_properties (H5IMPORT-${testname}-H5DMP_CMP PROPERTIES DEPENDS H5IMPORT-${testname}-H5DMP + FIXTURES_REQUIRED set_h5importtest ) endif () + + add_test ( + NAME H5IMPORT-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${testfile} + ${testfile}.new + ) + set_tests_properties (H5IMPORT-${testname}-clean-objects PROPERTIES + DEPENDS H5IMPORT-${testname}-H5DMP_CMP + FIXTURES_REQUIRED set_h5importtest + ) endmacro () macro (ADD_H5_DUMPTEST testname datasetname testfile) @@ -160,9 +171,11 @@ COMMAND ${CMAKE_COMMAND} -E remove d${testfile} d${testfile}.bin + d${testfile}.dmp ) set_tests_properties (H5IMPORT-DUMP-${testname}-clear-objects PROPERTIES DEPENDS H5IMPORT-${testname}-H5DMP_CMP + FIXTURES_REQUIRED set_h5importtest ) if ("${ARGN}" STREQUAL "BINARY") @@ -174,6 +187,7 @@ -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-b;NATIVE;testfiles/${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=d${testfile}.dmp" + -D "TEST_SAVE=1" -D "TEST_EXPECT=0" -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" @@ -187,6 +201,7 @@ -D "TEST_ARGS:STRING=-p;-d;${datasetname};-o;d${testfile}.bin;-y;--width=1;testfiles/${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" -D "TEST_OUTPUT=d${testfile}.dmp" + -D "TEST_SAVE=1" -D "TEST_EXPECT=0" -D "TEST_SKIP_COMPARE=TRUE" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" @@ -194,6 +209,7 @@ endif () set_tests_properties (H5IMPORT-DUMP-${testname}-H5DMP PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-clear-objects" + FIXTURES_REQUIRED set_h5importtest ) add_test ( @@ -210,6 +226,7 @@ ) set_tests_properties (H5IMPORT-DUMP-${testname} PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}-H5DMP" + FIXTURES_REQUIRED set_h5importtest ) add_test ( @@ -222,13 +239,26 @@ -D "TEST_OUTPUT=d${testfile}.dff" -D "TEST_EXPECT=0" -D "TEST_FILTER=(^(Warning)[^\n]*)" - -D "TEST_REFERENCE=testfiles/d${testfile}.txt" + -D "TEST_REFERENCE=testfiles/${testfile}.txt" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5IMPORT-DUMP-${testname}-H5DFF PROPERTIES DEPENDS "H5IMPORT-DUMP-${testname}" + FIXTURES_REQUIRED set_h5importtest ) endif () + + add_test ( + NAME H5IMPORT-DUMP-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + d${testfile} + d${testfile}.bin + d${testfile}.dmp + ) + set_tests_properties (H5IMPORT-DUMP-${testname}-clean-objects PROPERTIES + DEPENDS H5IMPORT-DUMP-${testname}-H5DFF + FIXTURES_REQUIRED set_h5importtest + ) endmacro () macro (ADD_H5_DUMPSUBTEST testname testfile datasetname) @@ -237,8 +267,9 @@ add_test ( NAME H5IMPORT_SUB-DUMP-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove - d-${testname}.h5 - ${testname}.bin + ds${testname}.h5 + ds${testname}.bin + ds${testname}.dmp ) set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-clear-objects PROPERTIES FIXTURES_REQUIRED set_h5importtest @@ -249,15 +280,17 @@ COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" - -D "TEST_ARGS:STRING=-p;-d;${datasetname};${ARGN};-o;${testname}.bin;-b;NATIVE;testfiles/${testfile}" + -D "TEST_ARGS:STRING=-p;-d;${datasetname};${ARGN};-o;ds${testname}.bin;-b;NATIVE;testfiles/${testfile}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${testname}.dmp" + -D "TEST_OUTPUT=ds${testname}.dmp" + -D "TEST_SAVE=1" -D "TEST_EXPECT=0" -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" + FIXTURES_REQUIRED set_h5importtest ) add_test ( @@ -265,32 +298,46 @@ COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5import${tgt_file_ext}>" - -D "TEST_ARGS:STRING=${testname}.bin;-c;${testname}.dmp;-o;d-${testname}.h5" + -D "TEST_ARGS:STRING=ds${testname}.bin;-c;ds${testname}.dmp;-o;ds${testname}.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=${testname}.imp" + -D "TEST_OUTPUT=ds${testname}.imp" -D "TEST_EXPECT=0" -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" + FIXTURES_REQUIRED set_h5importtest ) add_test ( NAME H5IMPORT_SUB-DUMP-${testname}-CMP COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>" - -D "TEST_ARGS:STRING=-p;d-${testname}.h5" + -D "TEST_ARGS:STRING=-p;ds${testname}.h5" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}" - -D "TEST_OUTPUT=d-${testname}.dmp" + -D "TEST_OUTPUT=ds${testname}.dmp" -D "TEST_EXPECT=0" -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" + DEPENDS "H5IMPORT_SUB-DUMP-${testname}-H5IMP" + FIXTURES_REQUIRED set_h5importtest ) endif () + + add_test ( + NAME H5IMPORT_SUB-DUMP-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ds${testname}.h5 + ds${testname}.bin + ds${testname}.dmp + ) + set_tests_properties (H5IMPORT_SUB-DUMP-${testname}-clean-objects PROPERTIES + DEPENDS "H5IMPORT_SUB-DUMP-${testname}-CMP" + FIXTURES_REQUIRED set_h5importtest + ) endmacro () macro (ADD_H5_SKIP_DUMPTEST testname datasetname testfile) @@ -368,23 +415,55 @@ set (last_test "H5IMPORT-clear-objects") endif () - add_test ( - NAME H5IMPORT-h5importtest-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove + set (H5IMPORTTEST_CLEANFILES binfp64.bin binfp64.conf + binfp64.h5 + binfp64.h5.new binin8.bin binin8.conf + binin8.h5 + binin8.h5.new binin8w.bin binin8w.conf + binin8w.h5 + binin8w.h5.new binin16.bin binin16.conf + binin16.h5 + binin16.h5.new binin32.bin binin32.conf + binin32.h5 + binin32.h5.new binuin16.bin binuin16.conf + binuin16.h5 + binuin16.h5.new binuin32.bin binuin32.conf + binuin32.h5 + binuin32.h5.new + txtfp32.h5 + txtfp32.h5.new + txtfp64.h5 + txtfp64.h5.new + txtin8.h5 + txtin8.h5.new + txtin8w.h5 + txtin8w.h5.new + txtin16.h5 + txtin16.h5.new + txtin32.h5 + txtin32.h5.new + txtuin16.h5 + txtuin16.h5.new + txtuin32.h5 + txtuin32.h5.new + ) + add_test ( + NAME H5IMPORT-h5importtest-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove ${H5IMPORTTEST_CLEANFILES} ) add_test (NAME H5IMPORT-h5importtest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5importtest>) @@ -392,6 +471,13 @@ FIXTURES_SETUP set_h5importtest DEPENDS H5IMPORT-h5importtest-clear-objects ) + add_test ( + NAME H5IMPORT-h5importtest-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove ${H5IMPORTTEST_CLEANFILES} + ) + set_tests_properties (H5IMPORT-h5importtest-clean-objects PROPERTIES + FIXTURES_CLEANUP set_h5importtest + ) # ----- 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/h5importtestutil.sh.in b/tools/test/h5import/h5importtestutil.sh.in index 0cbc8f1..2be6d50 100644 --- a/tools/test/h5import/h5importtestutil.sh.in +++ b/tools/test/h5import/h5importtestutil.sh.in @@ -268,9 +268,9 @@ fi TOOLTEST5() { err=0 -$RUNSERIAL $DUMPER_BIN -p -d $3 $4 -o d-$1.bin -b NATIVE tmp_testfiles/$2 > d-$1.dmp -$RUNSERIAL $H5IMPORT_BIN d-$1.bin -c d-$1.dmp -o d-$1.h5 > d-$1.imp -$RUNSERIAL $DUMPER_BIN -p d-$1.h5 > log2 +$RUNSERIAL $DUMPER_BIN -p -d $3 $4 -o ds$1.bin -b NATIVE tmp_testfiles/$2 > ds$1.dmp +$RUNSERIAL $H5IMPORT_BIN ds$1.bin -c ds$1.dmp -o ds$1.h5 > ds$1.imp +$RUNSERIAL $DUMPER_BIN -p ds$1.h5 > log2 $CP -f $SRC_H5IMPORT_TESTFILES/$1.ddl log1 cmp -s log1 log2 || err=1 diff --git a/tools/test/h5import/testfiles/tall_fp32.ddl b/tools/test/h5import/testfiles/tall_fp32.ddl index 2a0dc1b..53f24bf 100644 --- a/tools/test/h5import/testfiles/tall_fp32.ddl +++ b/tools/test/h5import/testfiles/tall_fp32.ddl @@ -1,4 +1,4 @@ -HDF5 "d-tall_fp32.h5" { +HDF5 "dstall_fp32.h5" { GROUP "/" { GROUP "g2" { DATASET "dset2.2" { diff --git a/tools/test/h5import/testfiles/tall_i32.ddl b/tools/test/h5import/testfiles/tall_i32.ddl index d9280bc..b05dd53 100644 --- a/tools/test/h5import/testfiles/tall_i32.ddl +++ b/tools/test/h5import/testfiles/tall_i32.ddl @@ -1,4 +1,4 @@ -HDF5 "d-tall_i32.h5" { +HDF5 "dstall_i32.h5" { GROUP "/" { GROUP "g1" { GROUP "g1.1" { diff --git a/tools/test/h5import/testfiles/tintsattrs_u32.ddl b/tools/test/h5import/testfiles/tintsattrs_u32.ddl index cf8889c..a53217a 100644 --- a/tools/test/h5import/testfiles/tintsattrs_u32.ddl +++ b/tools/test/h5import/testfiles/tintsattrs_u32.ddl @@ -1,4 +1,4 @@ -HDF5 "d-tintsattrs_u32.h5" { +HDF5 "dstintsattrs_u32.h5" { GROUP "/" { DATASET "DU32BITS" { DATATYPE H5T_STD_U32LE diff --git a/tools/test/h5ls/CMakeTests.cmake b/tools/test/h5ls/CMakeTests.cmake index cd2f764..0c493dd 100644 --- a/tools/test/h5ls/CMakeTests.cmake +++ b/tools/test/h5ls/CMakeTests.cmake @@ -135,10 +135,21 @@ ############################################################################## macro (ADD_H5_TEST resultfile resultcode) + 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" + ) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_file_ext}> ${ARGN}) - set_tests_properties (H5LS-${resultfile} PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles") + set_tests_properties (H5LS-${resultfile} PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) if ("${resultcode}" STREQUAL "1") set_tests_properties (H5LS-${resultfile} PROPERTIES WILL_FAIL "true") endif () @@ -157,9 +168,32 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () + set_tests_properties (H5LS-${resultfile} PROPERTIES + DEPENDS "H5LS-${resultfile}-clear-objects" + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) + add_test ( + NAME H5LS-${resultfile}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5LS-${resultfile}-clean-objects PROPERTIES + DEPENDS "H5LS-${resultfile}" + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) endmacro () macro (ADD_H5_ERR_TEST resultfile resultcode) + 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" + ) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5LS-${resultfile} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5ls${tgt_file_ext}> ${ARGN}) @@ -182,12 +216,35 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () + set_tests_properties (H5LS-${resultfile} PROPERTIES + DEPENDS "H5LS-${resultfile}-clear-objects" + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) + add_test ( + NAME H5LS-${resultfile}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5LS-${resultfile}-clean-objects PROPERTIES + DEPENDS "H5LS-${resultfile}" + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) endmacro () macro (ADD_H5_UD_TEST testname resultcode resultfile) if (NOT HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5LS_UD-${testname} + NAME H5LS_UD-${testname}-${resultfile}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5LS_UD-${testname}-${resultfile}-clear-objects PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) + add_test ( + NAME H5LS_UD-${testname}-${resultfile} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" -D "TEST_PROGRAM=$<TARGET_FILE:h5ls${tgt_file_ext}>" @@ -201,6 +258,20 @@ -D "TEST_LIBRARY_DIRECTORY=${CMAKE_TEST_OUTPUT_DIRECTORY}" -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) + set_tests_properties (H5LS_UD-${testname}-${resultfile} PROPERTIES + DEPENDS "H5LS_UD-${testname}-${resultfile}-clear-objects" + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) + add_test ( + NAME H5LS_UD-${testname}-${resultfile}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${resultfile}.out + ${resultfile}.out.err + ) + set_tests_properties (H5LS_UD-${testname}-${resultfile}-clean-objects PROPERTIES + DEPENDS "H5LS_UD-${testname}-${resultfile}" + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + ) endif () endmacro () diff --git a/tools/test/h5repack/CMakeTests.cmake b/tools/test/h5repack/CMakeTests.cmake index 163bd00..7638af7 100644 --- a/tools/test/h5repack/CMakeTests.cmake +++ b/tools/test/h5repack/CMakeTests.cmake @@ -229,9 +229,6 @@ # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME H5REPACK-h5repack-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN}) - set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES - WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - ) else () add_test ( NAME H5REPACK-h5repack-${testname} @@ -247,7 +244,7 @@ ) endif () set_tests_properties (H5REPACK-h5repack-${testname} PROPERTIES - FIXTURES_REQUIRED clear_h5repack + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" ) endmacro () @@ -264,9 +261,6 @@ 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_file_ext}> ${ARGN} -i ${PROJECT_BINARY_DIR}/testfiles/${testfile} -o ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} @@ -281,6 +275,13 @@ set_tests_properties (H5REPACK_OLD-${testname}_DFF PROPERTIES DEPENDS H5REPACK_OLD-${testname} ) + add_test ( + NAME H5REPACK_OLD-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_OLD-${testname}-clean-objects PROPERTIES + DEPENDS H5REPACK_OLD-${testname}_DFF + ) endif () endif () endmacro () @@ -299,9 +300,6 @@ NAME H5REPACK-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile} ) - set_tests_properties (H5REPACK-${testname}-clear-objects PROPERTIES - FIXTURES_REQUIRED clear_h5repack - ) add_test ( NAME H5REPACK-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} @@ -316,6 +314,13 @@ set_tests_properties (H5REPACK-${testname}_DFF PROPERTIES DEPENDS H5REPACK-${testname} ) + add_test ( + NAME H5REPACK-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK-${testname}-clean-objects PROPERTIES + DEPENDS H5REPACK-${testname}_DFF + ) endif () endmacro () @@ -329,20 +334,20 @@ set_property(TEST H5REPACK_CMP-${testname} PROPERTY DISABLED) endif () else () + add_test ( + NAME H5REPACK_CMP-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile} + ) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_CMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} ) - else () - add_test ( - NAME H5REPACK_CMP-${testname}-clear-objects - COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile} - ) - set_tests_properties (H5REPACK_CMP-${testname}-clear-objects PROPERTIES - FIXTURES_REQUIRED clear_h5repack + set_tests_properties (H5REPACK_CMP-${testname} PROPERTIES + DEPENDS H5REPACK_CMP-${testname}-clear-objects ) + else () add_test ( NAME H5REPACK_CMP-${testname} COMMAND "${CMAKE_COMMAND}" @@ -360,6 +365,13 @@ DEPENDS H5REPACK_CMP-${testname}-clear-objects ) endif () + add_test ( + NAME H5REPACK_CMP-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile} + ) + set_tests_properties (H5REPACK_CMP-${testname}-clean-objects PROPERTIES + DEPENDS H5REPACK_CMP-${testname} + ) endif () endmacro () @@ -373,24 +385,18 @@ set_property(TEST H5REPACK_MASK-${testname} PROPERTY DISABLED) endif () else () + add_test ( + NAME H5REPACK_MASK-${testname}-clear-objects + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile} + ) # If using memchecker add tests without using scripts if (HDF5_ENABLE_USING_MEMCHECKER) add_test ( NAME H5REPACK_MASK-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_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 - ) else (HDF5_ENABLE_USING_MEMCHECKER) add_test ( - NAME H5REPACK_MASK-${testname}-clear-objects - 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 - ) - add_test ( NAME H5REPACK_MASK-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}" @@ -404,8 +410,17 @@ -D "TEST_ERRREF=${result_errcheck}" -P "${HDF_RESOURCES_EXT_DIR}/grepTest.cmake" ) - set_tests_properties (H5REPACK_MASK-${testname} PROPERTIES DEPENDS H5REPACK_MASK-${testname}-clear-objects) endif () + set_tests_properties (H5REPACK_MASK-${testname} PROPERTIES + DEPENDS H5REPACK_MASK-${testname}-clear-objects + ) + add_test ( + NAME H5REPACK_MASK-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile} + ) + set_tests_properties (H5REPACK_MASK-${testname}-clean-objects PROPERTIES + DEPENDS H5REPACK_MASK-${testname} + ) endif () endmacro () @@ -423,9 +438,6 @@ NAME H5REPACK_DMP-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile} ) - set_tests_properties (H5REPACK_DMP-${testname}-clear-objects PROPERTIES - FIXTURES_REQUIRED clear_h5repack - ) add_test ( NAME H5REPACK_DMP-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${resultfile} @@ -447,7 +459,22 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5REPACK_DMP-h5dump-${testname} PROPERTIES - DEPENDS "H5REPACK_DMP-${testname}" + DEPENDS H5REPACK_DMP-${testname} + ) + add_test ( + NAME H5REPACK_DMP-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile} + ) + set_tests_properties (H5REPACK_DMP-${testname}-clean-objects PROPERTIES + DEPENDS H5REPACK_DMP-h5dump-${testname} + ) + else () + add_test ( + NAME H5REPACK_DMP-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile} + ) + set_tests_properties (H5REPACK_DMP-${testname}-clean-objects PROPERTIES + DEPENDS H5REPACK_DMP-${testname} ) endif () endif () @@ -511,9 +538,6 @@ NAME H5REPACK_DIFF-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile} ) - set_tests_properties (H5REPACK_DIFF-${testname}-clear-objects PROPERTIES - FIXTURES_REQUIRED clear_h5repack - ) add_test ( NAME H5REPACK_DIFF-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> --enable-error-stack ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} @@ -536,6 +560,13 @@ set_tests_properties (H5REPACK_DIFF-${testname}_DFF PROPERTIES DEPENDS H5REPACK_DIFF-${testname} ) + add_test ( + NAME H5REPACK_DIFF-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_DIFF-${testname}-clean-objects PROPERTIES + DEPENDS H5REPACK_DIFF-${testname}_DFF + ) endif () endmacro () @@ -553,9 +584,6 @@ NAME H5REPACK_STAT-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${statarg}.${resultfile} ) - set_tests_properties (H5REPACK_STAT-${testname}-clear-objects PROPERTIES - FIXTURES_REQUIRED clear_h5repack - ) add_test ( NAME H5REPACK_STAT-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${resultfile} ${PROJECT_BINARY_DIR}/testfiles/out-${statarg}.${resultfile} @@ -577,7 +605,22 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5REPACK_STAT-h5stat-${testname} PROPERTIES - DEPENDS "H5REPACK_STAT-${testname}" + DEPENDS H5REPACK_STAT-${testname} + ) + add_test ( + NAME H5REPACK_STAT-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${statarg}.${resultfile} + ) + set_tests_properties (H5REPACK_STAT-${testname}-clean-objects PROPERTIES + DEPENDS H5REPACK_STAT-h5stat-${testname} + ) + else () + add_test ( + NAME H5REPACK_STAT-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${statarg}.${resultfile} + ) + set_tests_properties (H5REPACK_STAT-${testname}-clean-objects PROPERTIES + DEPENDS H5REPACK_STAT-${testname} ) endif () endif () @@ -598,9 +641,6 @@ NAME H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile} ) - set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}-clear-objects PROPERTIES - FIXTURES_REQUIRED clear_h5repack - ) add_test ( NAME H5REPACK_VERIFY_LAYOUT-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} @@ -659,6 +699,13 @@ DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DFF ) endif () + add_test ( + NAME H5REPACK_VERIFY_LAYOUT-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_VERIFY_LAYOUT-${testname}-clean-objects PROPERTIES + DEPENDS H5REPACK_VERIFY_LAYOUT-${testname}_DMP + ) endif () endif () endmacro () @@ -679,9 +726,6 @@ NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile} ) - set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clear-objects PROPERTIES - FIXTURES_REQUIRED clear_h5repack - ) add_test ( NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> ${ARGN} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} @@ -706,6 +750,13 @@ WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" DEPENDS H5REPACK_VERIFY_LAYOUT_VDS-${testname} ) + add_test ( + NAME H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_VERIFY_LAYOUT_VDS-${testname}-clean-objects PROPERTIES + DEPENDS H5REPACK_VERIFY_LAYOUT_VDS-${testname}_DMP + ) endif () endif () endmacro () @@ -717,9 +768,6 @@ NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile} ) - set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}-clear-objects PROPERTIES - FIXTURES_REQUIRED clear_h5repack - ) add_test ( NAME H5REPACK_VERIFY_SUPERBLOCK-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} @@ -743,6 +791,13 @@ set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP PROPERTIES DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname} ) + add_test ( + NAME H5REPACK_VERIFY_SUPERBLOCK-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile} + ) + set_tests_properties (H5REPACK_VERIFY_SUPERBLOCK-${testname}-clean-objects PROPERTIES + DEPENDS H5REPACK_VERIFY_SUPERBLOCK-${testname}_DMP + ) endif () endmacro () @@ -751,9 +806,6 @@ NAME ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects 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 - ) add_test ( NAME ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repack${tgt_file_ext}> -j;${lowbound};-k;${highbound} ${PROJECT_BINARY_DIR}/testfiles/${testfile} ${PROJECT_BINARY_DIR}/testfiles/out-${testname}.${testfile} @@ -762,6 +814,13 @@ DEPENDS ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clear-objects WILL_FAIL "true" ) + add_test ( + NAME ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${testfile} + ) + set_tests_properties (ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname}-clean-objects PROPERTIES + DEPENDS ADD_H5_VERIFY_INVALIDBOUNDS-h5repack-${testname} + ) endmacro () macro (ADD_H5_TEST_META testname testfile) @@ -770,14 +829,7 @@ NAME H5REPACK_META-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}_N.${testname}.h5 - testfiles/out-${testname}_N.${testname}.out - testfiles/out-${testname}_N.${testname}.out.err testfiles/out-${testname}_M.${testname}.h5 - testfiles/out-${testname}_M.${testname}.out - testfiles/out-${testname}_M.${testname}.out.err - ) - set_tests_properties (H5REPACK_META-${testname}-clear-objects PROPERTIES - FIXTURES_REQUIRED clear_h5repack ) add_test ( NAME H5REPACK_META-${testname}_N @@ -826,7 +878,7 @@ add_test (NAME H5REPACK_META-${testname} COMMAND "${CMAKE_COMMAND}" -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles" - -D "TEST_ONEFILE=out-${testname}_N.${testname}.out" + -D "TEST_ONEFILE=out-${testname}_N.${testname}.h5" -D "TEST_TWOFILE=out-${testname}_M.${testname}.h5" -D "TEST_FUNCTION=LTEQ" -P "${HDF_RESOURCES_DIR}/fileCompareTest.cmake" @@ -839,6 +891,15 @@ set_tests_properties (H5REPACK_META-${testname} PROPERTIES DEPENDS H5REPACK_META-${testname}_M_DFF ) + add_test ( + NAME H5REPACK_META-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + testfiles/out-${testname}_N.${testname}.h5 + testfiles/out-${testname}_M.${testname}.h5 + ) + set_tests_properties (H5REPACK_META-${testname}-clean-objects PROPERTIES + DEPENDS H5REPACK_META-${testname} + ) endmacro () macro (ADD_H5_UD_TEST testname resultcode resultfile) @@ -848,9 +909,6 @@ NAME H5REPACK_UD-${testname}-clear-objects COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile} ) - set_tests_properties (H5REPACK_UD-${testname}-clear-objects PROPERTIES - FIXTURES_REQUIRED clear_h5repack - ) add_test ( NAME H5REPACK_UD-${testname} COMMAND "${CMAKE_COMMAND}" @@ -886,7 +944,14 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) set_tests_properties (H5REPACK_UD-${testname}-h5dump PROPERTIES - DEPENDS "H5REPACK_UD-${testname}" + DEPENDS H5REPACK_UD-${testname} + ) + add_test ( + NAME H5REPACK_UD-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove testfiles/out-${testname}.${resultfile} + ) + set_tests_properties (H5REPACK_UD-${testname}-clean-objects PROPERTIES + DEPENDS H5REPACK_UD-${testname}-h5dump ) endif () endmacro () @@ -910,7 +975,6 @@ ) set_tests_properties (H5REPACK_EXTERNAL-${testname}-clear-objects PROPERTIES WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" - FIXTURES_REQUIRED clear_h5repack ) # make sure external data file 0 is available add_test ( @@ -985,6 +1049,14 @@ DEPENDS H5REPACK_EXTERNAL-${testname}_DFF4 WILL_FAIL "true" ) + add_test ( + NAME H5REPACK_EXTERNAL-${testname}-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove h5repack_${testfile}_rp.h5 + ) + set_tests_properties (H5REPACK_EXTERNAL-${testname}-clean-objects PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles" + DEPENDS H5REPACK_EXTERNAL-${testname}_DFF_FAIL + ) endif () endif () endmacro () @@ -1027,123 +1099,6 @@ set (FILEV4 4_vds.h5) set (FILEV5 5_vds.h5) - if (HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - set (LIST_TO_CLEAR - out-family.tfamily%05d.h5 - out-HDFFV-7840.h5diff_attr1.h5 - out-attr.h5repack_attr.h5 - out-native_attr.h5repack_attr.h5 - out-HDFFV-5932.h5repack_attr_refs.h5 - out-deflate_copy.h5repack_deflate.h5 - out-deflate_remove.h5repack_deflate.h5 - out-early.h5repack_early.h5 - out-fill.h5repack_fill.h5 - out-native_fill.h5repack_fill.h5 - out-gzip_verbose_filters.h5repack_filters.h5 - out-fletcher_copy.h5repack_fletcher.h5 - out-fletcher_remove.h5repack_fletcher.h5 - out-hlink.h5repack_hlink.h5 - out-chunk_18x13.h5repack_layout.h5 - out-chunk_20x10.h5repack_layout.h5 - out-chunk_compa.h5repack_layout.h5 - out-chunk_conti.h5repack_layout.h5 - out-compa.h5repack_layout.h5 - out-conti.h5repack_layout.h5 - out-deflate_file.h5repack_layout.h5 - out-deflate_limit.h5repack_layout.h5 - out-dset2_chunk_20x10.h5repack_layout.h5 - out-dset2_compa.h5repack_layout.h5 - out-dset2_conti.h5repack_layout.h5 - out-dset_compa_chunk.h5repack_layout.h5 - out-dset_compa_compa.h5repack_layout.h5 - out-dset_compa_conti.h5repack_layout.h5 - out-dset_conti_chunk.h5repack_layout.h5 - out-dset_conti_compa.h5repack_layout.h5 - out-dset_conti_conti.h5repack_layout.h5 - out-fletcher_all.h5repack_layout.h5 - out-fletcher_individual.h5repack_layout.h5 - out-global_filters.h5repack_layout.h5 - out-gzip_all.h5repack_layout.h5 - out-gzip_individual.h5repack_layout.h5 - out-layout.h5repack_layout.h5 - out-layout_long_switches.h5repack_layout.h5 - out-layout_short_switches.h5repack_layout.h5 - out-old_style_layout_short_switches.h5repack_layout.h5 - out-plugin_test.h5repack_layout.h5 - out-shuffle_all.h5repack_layout.h5 - out-shuffle_individual.h5repack_layout.h5 - out-upgrade_layout.h5repack_layouto.h5 - out-contig_small_compa.h5repack_layout2.h5 - out-contig_small_fixed_compa.h5repack_layout2.h5 - out-ckdim_biger.h5repack_layout3.h5 - out-ckdim_smaller.h5repack_layout3.h5 - out-chunk2chunk.h5repack_layout3.h5 - out-chunk2compa.h5repack_layout3.h5 - out-chunk2conti.h5repack_layout3.h5 - out-error1.h5repack_layout3.h5 - out-error2.h5repack_layout3.h5 - out-error3.h5repack_layout3.h5 - out-error4.h5repack_layout3.h5 - out-committed_dt.h5repack_named_dtypes.h5 - out-nbit_add.h5repack_nbit.h5 - out-nbit_copy.h5repack_nbit.h5 - out-nbit_remove.h5repack_nbit.h5 - out-add_alignment.h5repack_objs.h5 - out-add_userblock.h5repack_objs.h5 - out-objs.h5repack_objs.h5 - out-gt_mallocsize.h5repack_objs.h5 - out-bug1814.h5repack_refs.h5 - out-shuffle_copy.h5repack_shuffle.h5 - out-shuffle_remove.h5repack_shuffle.h5 - out-scale_add.h5repack_soffset.h5 - out-scale_copy.h5repack_soffset.h5 - out-scale_remove.h5repack_soffset.h5 - out-meta_short_M.meta_short.h5 - out-meta_short_N.meta_short.h5 - out-meta_long_M.meta_long.h5 - out-meta_long_N.meta_long.h5 - out-vds_compa.4_vds.h5 - out-vds_conti.4_vds.h5 - out-vds_chunk2x5x8.3_1_vds.h5 - out-vds_chunk3x6x9.2_vds.h5 - out-vds_dset_chunk20x10x5.1_vds.h5 - ) - - set (LIST_TO_CLEAR ${LIST_TO_CLEAR} ${LIST_OTHER_TEST_FILES}) - - foreach (h5_file ${LIST_HDF5_TEST_FILES}) - get_filename_component(fname "${h5_file}" NAME) - set (LIST_TO_CLEAR ${LIST_TO_CLEAR} - ${h5_file}.h5 - ) - endforeach () - - foreach (h5_file ${LIST_TST_TEST_FILES}) - get_filename_component(fname "${h5_file}" NAME) - set (LIST_TO_CLEAR ${LIST_TO_CLEAR} - ${h5_file}.tst.out - ${h5_file}.tst.out.err - ) - endforeach () - - foreach (h5_file ${LIST_DDL_TEST_FILES}) - get_filename_component(fname "${h5_file}" NAME) - set (LIST_TO_CLEAR ${LIST_TO_CLEAR} - ${h5_file}.ddl.out - ${h5_file}.ddl.out.err - ) - endforeach () - add_test ( - NAME H5REPACK-clearall-objects - COMMAND ${CMAKE_COMMAND} -E remove ${LIST_TO_CLEAR} - ) - 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 ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:testh5repack_detect_szip>) @@ -1159,7 +1114,7 @@ set (passRegex "no") 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_tests_properties (H5REPACK-testh5repack_detect_szip PROPERTIES DEPENDS H5REPACK-h5repack-${testname}) set (last_test "H5REPACK-testh5repack_detect_szip") # add_test (NAME H5REPACK-h5repacktest COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5repacktest>) diff --git a/tools/test/h5repack/CMakeVFDTests.cmake b/tools/test/h5repack/CMakeVFDTests.cmake index 0514bfb..b746d88 100644 --- a/tools/test/h5repack/CMakeVFDTests.cmake +++ b/tools/test/h5repack/CMakeVFDTests.cmake @@ -26,43 +26,44 @@ set (H5REPACK_VFD_subfiling_SKIP_TESTS ### T H E T E S T S M A C R O S ### ############################################################################## ############################################################################## - +set (H5REPACK_CLEANFILES + 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 +) macro (ADD_VFD_TEST vfdname resultcode) if (NOT HDF5_ENABLE_USING_MEMCHECKER) 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 + COMMAND ${CMAKE_COMMAND} -E remove ${H5REPACK_CLEANFILES} WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${vfdname} ) if (NOT "h5repacktest" IN_LIST H5REPACK_VFD_${vfdname}_SKIP_TESTS) @@ -78,8 +79,19 @@ macro (ADD_VFD_TEST vfdname resultcode) -D "TEST_FOLDER=${PROJECT_BINARY_DIR}/${vfdname}" -P "${HDF_RESOURCES_DIR}/vfdTest.cmake" ) - 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}) + set_tests_properties (H5REPACK_VFD-${vfdname}-h5repacktest PROPERTIES + DEPENDS H5REPACK_VFD-${vfdname}-h5repacktest-clear-objects + TIMEOUT ${CTEST_SHORT_TIMEOUT} + ) + add_test ( + NAME H5REPACK_VFD-${vfdname}-h5repacktest-clean-objects + COMMAND ${CMAKE_COMMAND} -E remove + ${H5REPACK_CLEANFILES} + ) + set_tests_properties (H5REPACK_VFD-${vfdname}-h5repacktest-clean-objects PROPERTIES + DEPENDS H5REPACK_VFD-${vfdname}-h5repacktest + WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/${vfdname} + ) endif () endif () endmacro () diff --git a/tools/test/h5stat/CMakeTests.cmake b/tools/test/h5stat/CMakeTests.cmake index d4238b5..0ad7001 100644 --- a/tools/test/h5stat/CMakeTests.cmake +++ b/tools/test/h5stat/CMakeTests.cmake @@ -114,6 +114,9 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () + set_tests_properties (H5STAT-${resultfile} PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}" + ) endmacro () macro (ADD_H5_ERR_TEST resultfile resultcode) @@ -138,6 +141,9 @@ -P "${HDF_RESOURCES_EXT_DIR}/runTest.cmake" ) endif () + set_tests_properties (H5STAT-${resultfile} PROPERTIES + WORKING_DIRECTORY "${PROJECT_BINARY_DIR}" + ) endmacro () ############################################################################## @@ -146,17 +152,6 @@ ############################################################################## ############################################################################## - if (HDF5_ENABLE_USING_MEMCHECKER) - # Remove any output file left over from previous test run - foreach (ddl_file ${HDF5_REFERENCE_FILES}) - set (CLEAR_LIST ${CLEAR_LIST} ${ddl_file}.out ${ddl_file}.out.err) - endforeach () - add_test ( - NAME H5STAT-clearall-objects - COMMAND ${CMAKE_COMMAND} -E remove ${CLEAR_LIST} - ) - endif () - # Test for help flag ADD_H5_TEST (h5stat_help1 0 -h) ADD_H5_TEST (h5stat_help2 0 --help) diff --git a/tools/test/misc/CMakeTestsRepart.cmake b/tools/test/misc/CMakeTestsRepart.cmake index 20ae263..04c74ec 100644 --- a/tools/test/misc/CMakeTestsRepart.cmake +++ b/tools/test/misc/CMakeTestsRepart.cmake @@ -72,6 +72,19 @@ family_to_sec2.h5 ) set_tests_properties (H5REPART-clearall-objects PROPERTIES FIXTURES_SETUP clear_testrepart) + add_test ( + NAME H5REPART-clean-objects + COMMAND ${CMAKE_COMMAND} + -E remove + fst_family00000.h5 + scd_family00000.h5 + scd_family00001.h5 + scd_family00002.h5 + scd_family00003.h5 + family_to_single.h5 + family_to_sec2.h5 + ) + set_tests_properties (H5REPART-clean-objects PROPERTIES FIXTURES_CLEANUP clear_testrepart) # repartition family member size to 20,000 bytes. add_test ( @@ -116,6 +129,7 @@ ) set_tests_properties (H5REPART-h5repart_test PROPERTIES DEPENDS "H5REPART-h5repart_20K;H5REPART-h5repart_5K;H5REPART-h5repart_single;H5REPART-h5repart_sec2" + FIXTURES_REQUIRED clear_testrepart ) set (H5_DEP_EXECUTABLES ${H5_DEP_EXECUTABLES} diff --git a/tools/test/perform/CMakeTests.cmake b/tools/test/perform/CMakeTests.cmake index c91edca..0b32f9b 100644 --- a/tools/test/perform/CMakeTests.cmake +++ b/tools/test/perform/CMakeTests.cmake @@ -23,12 +23,10 @@ add_custom_target(zip_perf_files ALL COMMENT "Copying files needed by zip_perf t # Add Tests #----------------------------------------------------------------------------- if (HDF5_TEST_SERIAL) - # Remove any output file left over from previous test run - add_test ( - NAME PERFORM_h5perform-clearall-objects - COMMAND ${CMAKE_COMMAND} - -E remove + set (PERFORM_CLEANFILES chunk.h5 + direct_write.h5 + unix.raw iopipe.h5 iopipe.raw x-diag-rd.dat @@ -36,21 +34,21 @@ if (HDF5_TEST_SERIAL) x-rowmaj-rd.dat x-rowmaj-wr.dat x-gnuplot - h5perf_serial.txt - h5perf_serial.txt.err - chunk.txt - chunk.txt.err - iopipe.txt - iopipe.txt.err - overhead.txt - overhead.txt.err - perf_meta.txt - perf_meta.txt.err - zip_perf-h.txt - zip_perf-h.txt.err - zip_perf.txt - zip_perf.txt.err ) + # Remove any output file left over from previous test run + add_test ( + NAME PERFORM_h5perform-clear-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${PERFORM_CLEANFILES} + ) + set_tests_properties (PERFORM_h5perform-clear-objects PROPERTIES FIXTURES_SETUP clear_perform) + + add_test ( + NAME PERFORM_h5perform-clean-objects + COMMAND ${CMAKE_COMMAND} + -E remove ${PERFORM_CLEANFILES} + ) + set_tests_properties (PERFORM_h5perform-clean-objects PROPERTIES FIXTURES_CLEANUP clear_perform) if (HDF5_ENABLE_USING_MEMCHECKER) add_test (NAME PERFORM_h5perf_serial COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:h5perf_serial>) @@ -69,7 +67,7 @@ if (HDF5_TEST_SERIAL) endif () set_tests_properties (PERFORM_h5perf_serial PROPERTIES TIMEOUT ${CTEST_VERY_LONG_TIMEOUT} - DEPENDS "PERFORM_h5perform-clearall-objects" + FIXTURES_REQUIRED clear_perform ) if (HDF5_ENABLE_USING_MEMCHECKER) @@ -88,7 +86,7 @@ if (HDF5_TEST_SERIAL) ) endif () set_tests_properties (PERFORM_chunk PROPERTIES - DEPENDS "PERFORM_h5perform-clearall-objects" + FIXTURES_REQUIRED clear_perform ) if (HDF5_ENABLE_USING_MEMCHECKER) @@ -107,7 +105,7 @@ if (HDF5_TEST_SERIAL) ) endif () set_tests_properties (PERFORM_iopipe PROPERTIES - DEPENDS "PERFORM_h5perform-clearall-objects" + FIXTURES_REQUIRED clear_perform ) if (HDF5_ENABLE_USING_MEMCHECKER) @@ -126,7 +124,7 @@ if (HDF5_TEST_SERIAL) ) endif () set_tests_properties (PERFORM_overhead PROPERTIES - DEPENDS "PERFORM_h5perform-clearall-objects" + FIXTURES_REQUIRED clear_perform ) if (HDF5_ENABLE_USING_MEMCHECKER) @@ -145,7 +143,7 @@ if (HDF5_TEST_SERIAL) ) endif () set_tests_properties (PERFORM_perf_meta PROPERTIES - DEPENDS "PERFORM_h5perform-clearall-objects" + FIXTURES_REQUIRED clear_perform ) if (HDF5_ENABLE_USING_MEMCHECKER) @@ -164,7 +162,7 @@ if (HDF5_TEST_SERIAL) ) endif () set_tests_properties (PERFORM_zip_perf_help PROPERTIES - DEPENDS "PERFORM_h5perform-clearall-objects" + FIXTURES_REQUIRED clear_perform ) if (HDF5_ENABLE_USING_MEMCHECKER) @@ -183,7 +181,8 @@ if (HDF5_TEST_SERIAL) ) endif () set_tests_properties (PERFORM_zip_perf PROPERTIES - DEPENDS "PERFORM_zip_perf_help;PERFORM_h5perform-clearall-objects" + DEPENDS "PERFORM_zip_perf_help" + FIXTURES_REQUIRED clear_perform ) endif () |