2011-12-06 00:19:09 +08:00
|
|
|
cmake_minimum_required (VERSION 2.8.6)
|
2010-05-14 00:01:50 +08:00
|
|
|
PROJECT (HDF5_TOOLS_H5COPY)
|
|
|
|
|
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Setup include Directories
|
|
|
|
#-----------------------------------------------------------------------------
|
2010-09-01 04:15:13 +08:00
|
|
|
INCLUDE_DIRECTORIES (${HDF5_TOOLS_SRC_DIR}/lib)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
# --------------------------------------------------------------------
|
|
|
|
# Add the h5copy and test executables
|
|
|
|
# --------------------------------------------------------------------
|
|
|
|
ADD_EXECUTABLE (h5copy ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copy.c)
|
2011-02-25 03:43:07 +08:00
|
|
|
TARGET_NAMING (h5copy ${LIB_TYPE})
|
2010-05-14 00:01:50 +08:00
|
|
|
TARGET_LINK_LIBRARIES (h5copy ${HDF5_TOOLS_LIB_TARGET} ${HDF5_LIB_TARGET})
|
2011-10-26 00:52:58 +08:00
|
|
|
SET_TARGET_PROPERTIES (h5copy PROPERTIES FOLDER tools)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
SET (H5_DEP_EXECUTABLES h5copy)
|
|
|
|
|
2010-08-26 06:33:59 +08:00
|
|
|
##############################################################################
|
|
|
|
##############################################################################
|
|
|
|
### T E S T I N G ###
|
|
|
|
##############################################################################
|
|
|
|
##############################################################################
|
|
|
|
|
2010-05-14 00:01:50 +08:00
|
|
|
IF (BUILD_TESTING)
|
2010-09-01 04:15:13 +08:00
|
|
|
IF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
|
2010-05-14 00:01:50 +08:00
|
|
|
ADD_EXECUTABLE (h5copygentest ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/h5copygentest.c)
|
2011-02-25 03:43:07 +08:00
|
|
|
TARGET_NAMING (h5copygentest ${LIB_TYPE})
|
2012-02-27 22:42:48 +08:00
|
|
|
TARGET_LINK_LIBRARIES (h5copygentest ${HDF5_LIB_TARGET})
|
2011-10-26 00:52:58 +08:00
|
|
|
SET_TARGET_PROPERTIES (h5copygentest PROPERTIES FOLDER generator/tools)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
#ADD_TEST (NAME h5copygentest COMMAND $<TARGET_FILE:h5copygentest>)
|
2010-09-01 04:15:13 +08:00
|
|
|
ENDIF (HDF5_BUILD_GENERATORS AND NOT BUILD_SHARED_LIBS)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2010-08-26 06:33:59 +08:00
|
|
|
# --------------------------------------------------------------------
|
2012-01-12 06:46:31 +08:00
|
|
|
# Copy all the HDF5 files from the source directory into the test directory
|
2010-08-26 06:33:59 +08:00
|
|
|
# --------------------------------------------------------------------
|
2012-01-12 06:46:31 +08:00
|
|
|
SET (LIST_HDF5_TEST_FILES
|
|
|
|
${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_src.h5
|
|
|
|
${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_trg.h5
|
|
|
|
${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_ref.h5
|
|
|
|
${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copytst.h5
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|
2012-01-12 06:46:31 +08:00
|
|
|
|
|
|
|
SET (LIST_OTHER_TEST_FILES
|
|
|
|
${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_misc1.out
|
|
|
|
${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_extlinks_src.out.ls
|
|
|
|
${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copy_ref.out.ls
|
|
|
|
${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/h5copytst.out.ls
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
FILE (MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/testfiles")
|
|
|
|
|
2012-01-12 06:46:31 +08:00
|
|
|
FOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES})
|
|
|
|
GET_FILENAME_COMPONENT(fname "${listfiles}" NAME)
|
|
|
|
SET (dest "${PROJECT_BINARY_DIR}/testfiles/${fname}")
|
|
|
|
#MESSAGE (STATUS " Copying ${listfiles}")
|
2010-05-14 00:01:50 +08:00
|
|
|
ADD_CUSTOM_COMMAND (
|
|
|
|
TARGET h5copy
|
|
|
|
POST_BUILD
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
2012-01-12 06:46:31 +08:00
|
|
|
ARGS -E copy_if_different ${listfiles} ${dest}
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|
2012-01-12 06:46:31 +08:00
|
|
|
ENDFOREACH (listfiles ${LIST_HDF5_TEST_FILES} ${LIST_OTHER_TEST_FILES})
|
|
|
|
|
|
|
|
#
|
|
|
|
# This section can be removed, but leave here for a reference later.
|
|
|
|
# Purpose: '-l3' ignores top 3 lines when copy text file.
|
|
|
|
#
|
|
|
|
#FOREACH (listfiles ${LIST_OTHER_TEST_FILES})
|
|
|
|
# SET (lsdest "${PROJECT_BINARY_DIR}/testfiles/${listfiles}")
|
|
|
|
# ADD_CUSTOM_COMMAND (
|
|
|
|
# TARGET h5copy
|
|
|
|
# POST_BUILD
|
|
|
|
# COMMAND ${XLATE_UTILITY}
|
|
|
|
# ARGS ${HDF5_TOOLS_H5COPY_SOURCE_DIR}/testfiles/${listfiles} ${lsdest} -l3
|
|
|
|
# )
|
|
|
|
#ENDFOREACH (listfiles ${LIST_OTHER_TEST_FILES})
|
2010-08-26 06:33:59 +08:00
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
##############################################################################
|
|
|
|
### T H E T E S T S M A C R O S ###
|
|
|
|
##############################################################################
|
|
|
|
##############################################################################
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2011-03-09 04:17:17 +08:00
|
|
|
#
|
|
|
|
# Perform h5copy according to passing parmeters
|
|
|
|
#
|
2011-04-07 22:03:08 +08:00
|
|
|
MACRO (ADD_H5_F_TEST testname resultcode infile outfile fparam vparam sparam srcname dparam dstname)
|
|
|
|
ADD_TEST (
|
|
|
|
NAME H5COPY_F-${testname}
|
|
|
|
COMMAND $<TARGET_FILE:h5copy> -f ${fparam} -i ./testfiles/${infile} -o ./testfiles/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
|
|
|
|
)
|
|
|
|
IF (NOT "${last_test}" STREQUAL "")
|
|
|
|
SET_TESTS_PROPERTIES (H5COPY_F-${testname} PROPERTIES DEPENDS ${last_test})
|
|
|
|
ENDIF (NOT "${last_test}" STREQUAL "")
|
|
|
|
SET (last_test "H5COPY_F-${testname}")
|
2011-04-09 04:01:10 +08:00
|
|
|
ADD_H5_DIFF_TEST (${testname} ${resultcode} ${last_test} ${infile} ${outfile} ${srcname} ${dstname})
|
2011-04-07 22:03:08 +08:00
|
|
|
ENDMACRO (ADD_H5_F_TEST)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2011-04-07 22:03:08 +08:00
|
|
|
MACRO (ADD_H5_TEST testname resultcode infile outfile vparam sparam srcname dparam dstname)
|
|
|
|
ADD_TEST (
|
|
|
|
NAME H5COPY-${testname}
|
|
|
|
COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN}
|
|
|
|
)
|
2011-03-25 03:37:41 +08:00
|
|
|
IF (NOT "${last_test}" STREQUAL "")
|
|
|
|
SET_TESTS_PROPERTIES (H5COPY-${testname} PROPERTIES DEPENDS ${last_test})
|
|
|
|
ENDIF (NOT "${last_test}" STREQUAL "")
|
|
|
|
SET (last_test "H5COPY-${testname}")
|
2011-04-09 04:01:10 +08:00
|
|
|
ADD_H5_DIFF_TEST (${testname} ${resultcode} ${last_test} ${infile} ${outfile} ${srcname} ${dstname})
|
2011-04-07 22:03:08 +08:00
|
|
|
ENDMACRO (ADD_H5_TEST)
|
|
|
|
|
2011-04-09 04:01:10 +08:00
|
|
|
MACRO (ADD_H5_DIFF_TEST testname resultcode testdepends infile outfile srcname dstname)
|
2011-03-16 02:42:13 +08:00
|
|
|
# resultcode=2 will cause the test to skip the diff test
|
2010-05-14 00:01:50 +08:00
|
|
|
IF (NOT ${resultcode} STREQUAL "2")
|
|
|
|
ADD_TEST (
|
|
|
|
NAME H5COPY-DIFF_${testname}
|
2011-03-08 23:11:02 +08:00
|
|
|
COMMAND $<TARGET_FILE:h5diff> -q ./testfiles/${infile} ./testfiles/${outfile} ${srcname} ${dstname}
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|
2011-04-09 04:01:10 +08:00
|
|
|
SET_TESTS_PROPERTIES(H5COPY-DIFF_${testname} PROPERTIES DEPENDS ${testdepends})
|
2011-03-25 03:37:41 +08:00
|
|
|
SET (last_test "H5COPY-DIFF_${testname}")
|
2010-05-14 00:01:50 +08:00
|
|
|
IF (${resultcode} STREQUAL "1")
|
|
|
|
SET_TESTS_PROPERTIES (H5COPY-DIFF_${testname} PROPERTIES WILL_FAIL "true")
|
|
|
|
ENDIF (${resultcode} STREQUAL "1")
|
|
|
|
ENDIF (NOT ${resultcode} STREQUAL "2")
|
2011-04-07 22:03:08 +08:00
|
|
|
ENDMACRO (ADD_H5_DIFF_TEST)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2011-03-09 04:17:17 +08:00
|
|
|
#
|
|
|
|
# Test result with h5ls
|
|
|
|
#
|
2010-10-29 00:10:18 +08:00
|
|
|
MACRO (ADD_H5LS_TEST file filetest)
|
2011-03-02 03:20:20 +08:00
|
|
|
# If using memchecker add tests without using scripts
|
|
|
|
IF (HDF5_ENABLE_USING_MEMCHECKER)
|
2011-05-05 00:18:22 +08:00
|
|
|
ADD_TEST (NAME H5COPY-h5ls_${file}-${filetest} COMMAND $<TARGET_FILE:h5ls> -Svr ./testfiles/${file}.out.h5)
|
2011-03-02 03:20:20 +08:00
|
|
|
ELSE (HDF5_ENABLE_USING_MEMCHECKER)
|
|
|
|
ADD_TEST (
|
2011-05-05 00:18:22 +08:00
|
|
|
NAME H5COPY-h5ls_${file}-${filetest}
|
2011-03-02 03:20:20 +08:00
|
|
|
COMMAND "${CMAKE_COMMAND}"
|
|
|
|
-D "TEST_PROGRAM=$<TARGET_FILE:h5ls>"
|
|
|
|
-D "TEST_ARGS=-Svr;./testfiles/${file}.out.h5"
|
|
|
|
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
|
|
|
|
-D "TEST_OUTPUT=./testfiles/${file}.out.out"
|
|
|
|
-D "TEST_EXPECT=0"
|
|
|
|
-D "TEST_REFERENCE=./testfiles/${file}.out.ls"
|
|
|
|
-D "TEST_MASK=true"
|
|
|
|
-P "${HDF5_RESOURCES_DIR}/runTest.cmake"
|
|
|
|
)
|
|
|
|
ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
|
2011-02-22 22:55:04 +08:00
|
|
|
IF (NOT "${last_test}" STREQUAL "")
|
2011-05-05 00:18:22 +08:00
|
|
|
SET_TESTS_PROPERTIES (H5COPY-h5ls_${file}-${filetest} PROPERTIES DEPENDS ${last_test})
|
2011-02-22 22:55:04 +08:00
|
|
|
ENDIF (NOT "${last_test}" STREQUAL "")
|
2011-05-05 00:18:22 +08:00
|
|
|
SET (last_test "H5COPY-h5ls_${file}-${filetest}")
|
2011-04-07 22:03:08 +08:00
|
|
|
ENDMACRO (ADD_H5LS_TEST)
|
2010-10-29 00:10:18 +08:00
|
|
|
|
2011-03-09 04:17:17 +08:00
|
|
|
#
|
|
|
|
# Similiar to ADD_H5_TEST macro. Compare to outputs from source & target
|
|
|
|
# files instead of checking with h5ls.
|
|
|
|
#
|
2011-04-07 22:03:08 +08:00
|
|
|
MACRO (ADD_H5_CMP_TEST testname resultcode infile outfile vparam sparam srcname dparam dstname)
|
2011-03-02 03:20:20 +08:00
|
|
|
# If using memchecker add tests without using scripts
|
|
|
|
IF (HDF5_ENABLE_USING_MEMCHECKER)
|
2011-07-01 05:36:34 +08:00
|
|
|
ADD_TEST (NAME H5COPY-CMP-${testname} COMMAND $<TARGET_FILE:h5copy> -i ./testfiles/${infile} -o ./testfiles/${outfile} ${vparam} ${sparam} ${srcname} ${dparam} ${dstname} ${ARGN})
|
2011-03-19 23:54:12 +08:00
|
|
|
IF (${resultcode} STREQUAL "1")
|
|
|
|
SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES WILL_FAIL "true")
|
|
|
|
ENDIF (${resultcode} STREQUAL "1")
|
2011-03-02 03:20:20 +08:00
|
|
|
ELSE (HDF5_ENABLE_USING_MEMCHECKER)
|
|
|
|
ADD_TEST (
|
|
|
|
NAME H5COPY-CMP-${testname}
|
|
|
|
COMMAND "${CMAKE_COMMAND}"
|
|
|
|
-D "TEST_PROGRAM=$<TARGET_FILE:h5copy>"
|
2011-07-01 05:36:34 +08:00
|
|
|
-D "TEST_ARGS=-i;./testfiles/${infile};-o;./testfiles/${outfile};${vparam};${sparam};${srcname};${dparam};${dstname}"
|
2011-03-02 03:20:20 +08:00
|
|
|
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
|
|
|
|
-D "TEST_OUTPUT=./testfiles/${testname}.out.out"
|
|
|
|
-D "TEST_EXPECT=${resultcode}"
|
|
|
|
-D "TEST_REFERENCE=./testfiles/${testname}.out"
|
|
|
|
-D "TEST_MASK=true"
|
|
|
|
-P "${HDF5_RESOURCES_DIR}/runTest.cmake"
|
|
|
|
)
|
|
|
|
ENDIF (HDF5_ENABLE_USING_MEMCHECKER)
|
2011-02-22 22:55:04 +08:00
|
|
|
IF (NOT "${last_test}" STREQUAL "")
|
|
|
|
SET_TESTS_PROPERTIES (H5COPY-CMP-${testname} PROPERTIES DEPENDS ${last_test})
|
|
|
|
ENDIF (NOT "${last_test}" STREQUAL "")
|
|
|
|
SET (last_test "H5COPY-CMP-${testname}")
|
2011-04-07 22:03:08 +08:00
|
|
|
ENDMACRO (ADD_H5_CMP_TEST)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2010-08-26 06:33:59 +08:00
|
|
|
##############################################################################
|
|
|
|
##############################################################################
|
|
|
|
### T H E T E S T S ###
|
|
|
|
##############################################################################
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
# --------------------------------------------------------------------
|
|
|
|
# test file names
|
|
|
|
# --------------------------------------------------------------------
|
|
|
|
SET (HDF_FILE1 h5copytst)
|
|
|
|
SET (HDF_FILE2 h5copy_ref)
|
|
|
|
SET (HDF_EXT_SRC_FILE h5copy_extlinks_src)
|
|
|
|
SET (HDF_EXT_TRG_FILE h5copy_extlinks_trg)
|
|
|
|
|
2010-05-14 00:01:50 +08:00
|
|
|
# Remove any output file left over from previous test run
|
|
|
|
ADD_TEST (
|
2010-10-07 04:49:54 +08:00
|
|
|
NAME H5COPY-clearall-objects
|
2010-05-14 00:01:50 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND}
|
|
|
|
-E remove
|
|
|
|
./testfiles/${HDF_FILE1}.out.h5
|
|
|
|
./testfiles/${HDF_FILE1}.out.out
|
2010-10-07 04:49:54 +08:00
|
|
|
./testfiles/${HDF_FILE1}.out.out.err
|
|
|
|
./testfiles/${HDF_FILE2}.out.h5
|
|
|
|
./testfiles/${HDF_FILE2}.out.out
|
|
|
|
./testfiles/${HDF_FILE2}.out.out.err
|
|
|
|
./testfiles/${HDF_EXT_SRC_FILE}.out.h5
|
|
|
|
./testfiles/${HDF_EXT_SRC_FILE}.out.out
|
|
|
|
./testfiles/${HDF_EXT_SRC_FILE}.out.out.err
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|
2011-02-22 22:55:04 +08:00
|
|
|
IF (NOT "${last_test}" STREQUAL "")
|
|
|
|
SET_TESTS_PROPERTIES (H5COPY-clearall-objects PROPERTIES DEPENDS ${last_test})
|
|
|
|
ENDIF (NOT "${last_test}" STREQUAL "")
|
|
|
|
SET (last_test "H5COPY-clearall-objects")
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
# "Test copying various forms of datasets"
|
2011-04-07 22:03:08 +08:00
|
|
|
ADD_H5_TEST (simple 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s simple -d simple)
|
|
|
|
ADD_H5_TEST (chunk 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s chunk -d chunk)
|
|
|
|
ADD_H5_TEST (compact 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s compact -d compact)
|
|
|
|
ADD_H5_TEST (compound 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s compound -d compound)
|
|
|
|
ADD_H5_TEST (compressed 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s compressed -d compressed)
|
|
|
|
ADD_H5_TEST (named_vl 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s named_vl -d named_vl)
|
|
|
|
ADD_H5_TEST (nested_vl 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s nested_vl -d nested_vl)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
# "Test copying dataset within group in source file to root of destination"
|
2011-04-07 22:03:08 +08:00
|
|
|
ADD_H5_TEST (simple_top 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_dsets/simple -d simple_top)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
# "Test copying & renaming dataset"
|
2011-04-07 22:03:08 +08:00
|
|
|
ADD_H5_TEST (rename 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s compound -d rename)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
# "Test copying empty, 'full' & 'nested' groups"
|
2011-04-07 22:03:08 +08:00
|
|
|
ADD_H5_TEST (grp_empty 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_empty -d grp_empty)
|
|
|
|
ADD_H5_TEST (grp_dsets 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_dsets -d grp_dsets)
|
|
|
|
ADD_H5_TEST (grp_nested 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_nested -d grp_nested)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
# "Test copying dataset within group in source file to group in destination"
|
2011-04-07 22:03:08 +08:00
|
|
|
ADD_H5_TEST (simple_group 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s /grp_dsets/simple -d /grp_dsets/simple_group)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
# "Test copying & renaming group"
|
2011-04-07 22:03:08 +08:00
|
|
|
ADD_H5_TEST (grp_rename 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_dsets -d grp_rename)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
# "Test copying 'full' group hierarchy into group in destination file"
|
2011-04-07 22:03:08 +08:00
|
|
|
ADD_H5_TEST (grp_dsets_rename 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s grp_dsets -d /grp_rename/grp_dsets)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
# "Test copying objects into group hier. that doesn't exist yet in destination file"
|
2011-04-07 22:03:08 +08:00
|
|
|
ADD_H5_TEST (A_B1_simple 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -vp -s simple -d /A/B1/simple)
|
|
|
|
ADD_H5_TEST (A_B2_simple2 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -vp -s simple -d /A/B2/simple2)
|
|
|
|
ADD_H5_TEST (C_D_simple 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -vp -s /grp_dsets/simple -d /C/D/simple)
|
|
|
|
ADD_H5_TEST (E_F_grp_dsets 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -vp -s /grp_dsets -d /E/F/grp_dsets)
|
|
|
|
ADD_H5_TEST (G_H_grp_nested 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -vp -s /grp_nested -d /G/H/grp_nested)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
# Verify that the file created above is correct
|
2010-10-29 00:10:18 +08:00
|
|
|
ADD_H5LS_TEST (${HDF_FILE1} basic)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
############# COPY REFERENCES ##############
|
|
|
|
|
|
|
|
# Remove any output file left over from previous test run
|
|
|
|
ADD_TEST (
|
|
|
|
NAME H5COPY-clear-refs
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
|
|
|
-E remove
|
|
|
|
./testfiles/${HDF_FILE2}.out.h5
|
|
|
|
./testfiles/${HDF_FILE2}.out.out
|
2010-10-07 04:49:54 +08:00
|
|
|
./testfiles/${HDF_FILE2}.out.out.err
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|
2011-02-22 22:55:04 +08:00
|
|
|
IF (NOT "${last_test}" STREQUAL "")
|
|
|
|
SET_TESTS_PROPERTIES (H5COPY-clear-refs PROPERTIES DEPENDS ${last_test})
|
|
|
|
ENDIF (NOT "${last_test}" STREQUAL "")
|
|
|
|
SET (last_test "H5COPY-clear-refs")
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
# "Test copying object and region references"
|
2011-04-07 22:03:08 +08:00
|
|
|
ADD_H5_F_TEST (region_ref 2 ${HDF_FILE2}.h5 ${HDF_FILE2}.out.h5 ref -v -s / -d /COPY)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
# Verify that the file created above is correct
|
2010-10-29 00:10:18 +08:00
|
|
|
ADD_H5LS_TEST (${HDF_FILE2} refs)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
############# COPY EXT LINKS ##############
|
|
|
|
|
|
|
|
# Remove any output file left over from previous test run
|
|
|
|
ADD_TEST (
|
|
|
|
NAME H5COPY-clear-ext-links
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
|
|
|
-E remove
|
|
|
|
./testfiles/${HDF_EXT_SRC_FILE}.out.h5
|
|
|
|
./testfiles/${HDF_EXT_SRC_FILE}.out.out
|
2010-10-07 04:49:54 +08:00
|
|
|
./testfiles/${HDF_EXT_SRC_FILE}.out.out.err
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|
2011-02-22 22:55:04 +08:00
|
|
|
IF (NOT "${last_test}" STREQUAL "")
|
|
|
|
SET_TESTS_PROPERTIES (H5COPY-clear-ext-links PROPERTIES DEPENDS ${last_test})
|
|
|
|
ENDIF (NOT "${last_test}" STREQUAL "")
|
|
|
|
SET (last_test "H5COPY-clear-ext-links")
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
# "Test copying external link directly without -f ext"
|
2011-04-07 22:03:08 +08:00
|
|
|
ADD_H5_TEST (ext_link 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 -v -s /group_ext/extlink_dset -d /copy1_dset)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
# "Test copying external link directly with -f ext"
|
2011-04-07 22:03:08 +08:00
|
|
|
ADD_H5_F_TEST (ext_link_f 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 ext -v -s /group_ext/extlink_dset -d /copy2_dset)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
# "Test copying dangling external link (no obj) directly without -f ext"
|
2011-04-07 22:03:08 +08:00
|
|
|
ADD_H5_TEST (ext_dangle_noobj 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_1)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
# "Test copying dangling external link (no obj) directly with -f ext"
|
2011-04-07 22:03:08 +08:00
|
|
|
ADD_H5_F_TEST (ext_dangle_noobj_f 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 ext -v -s /group_ext/extlink_notyet1 -d /copy_dangle1_2)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
# "Test copying dangling external link (no file) directly without -f ext"
|
2011-04-07 22:03:08 +08:00
|
|
|
ADD_H5_TEST (ext_dangle_nofile 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_1)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
# "Test copying dangling external link (no file) directly with -f ext"
|
2011-04-07 22:03:08 +08:00
|
|
|
ADD_H5_F_TEST (ext_dangle_nofile_f 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 ext -v -s /group_ext/extlink_notyet2 -d /copy_dangle2_2)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
# "Test copying a group contains external links without -f ext"
|
2011-04-07 22:03:08 +08:00
|
|
|
ADD_H5_TEST (ext_link_group 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 -v -s /group_ext -d /copy1_group)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
# "Test copying a group contains external links with -f ext"
|
2011-04-07 22:03:08 +08:00
|
|
|
ADD_H5_F_TEST (ext_link_group_f 2 ${HDF_EXT_SRC_FILE}.h5 ${HDF_EXT_SRC_FILE}.out.h5 ext -v -s /group_ext -d /copy2_group)
|
2010-05-14 00:01:50 +08:00
|
|
|
|
|
|
|
# Verify that the file created above is correct
|
2010-10-29 00:10:18 +08:00
|
|
|
ADD_H5LS_TEST (${HDF_EXT_SRC_FILE} links)
|
|
|
|
|
|
|
|
############# Test misc. ##############
|
|
|
|
# Remove any output file left over from previous test run
|
|
|
|
ADD_TEST (
|
|
|
|
NAME H5COPY-clear-misc
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
|
|
|
-E remove
|
2011-03-25 22:47:22 +08:00
|
|
|
./testfiles/h5copy_misc1.out.out
|
|
|
|
./testfiles/h5copy_misc1.out.out.err
|
2011-04-07 22:03:08 +08:00
|
|
|
./testfiles/${HDF_FILE1}.out.h5
|
2010-10-29 00:10:18 +08:00
|
|
|
)
|
2011-02-22 22:55:04 +08:00
|
|
|
IF (NOT "${last_test}" STREQUAL "")
|
|
|
|
SET_TESTS_PROPERTIES (H5COPY-clear-misc PROPERTIES DEPENDS ${last_test})
|
|
|
|
ENDIF (NOT "${last_test}" STREQUAL "")
|
|
|
|
SET (last_test "H5COPY-clear-misc")
|
2010-10-29 00:10:18 +08:00
|
|
|
|
2011-03-09 04:17:17 +08:00
|
|
|
#-----------------------------------------------------------------
|
2010-10-29 00:10:18 +08:00
|
|
|
# "Test copying object into group which doesn't exist, without -p"
|
2011-03-09 04:17:17 +08:00
|
|
|
#
|
2011-04-07 22:03:08 +08:00
|
|
|
ADD_H5_CMP_TEST (h5copy_misc1 1 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s /simple -d /g1/g2/simple)
|
|
|
|
# Remove any output file left over from previous test run
|
|
|
|
ADD_TEST (
|
|
|
|
NAME H5COPY-clear-samefile
|
|
|
|
COMMAND ${CMAKE_COMMAND}
|
|
|
|
-E remove
|
|
|
|
./testfiles/${HDF_FILE1}.out.h5
|
|
|
|
)
|
|
|
|
IF (NOT "${last_test}" STREQUAL "")
|
|
|
|
SET_TESTS_PROPERTIES (H5COPY-clear-samefile PROPERTIES DEPENDS ${last_test})
|
|
|
|
ENDIF (NOT "${last_test}" STREQUAL "")
|
|
|
|
SET (last_test "H5COPY-clear-samefile")
|
2010-05-14 00:01:50 +08:00
|
|
|
|
2011-03-09 04:17:17 +08:00
|
|
|
#-------------------------------------------
|
|
|
|
# "Test copying objects to the same file "
|
|
|
|
#
|
|
|
|
# create temporary test file with some objects
|
2011-04-07 22:03:08 +08:00
|
|
|
ADD_H5_TEST (samefile1_pre 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s /simple -d /simple)
|
|
|
|
ADD_H5_TEST (samefile2_pre 0 ${HDF_FILE1}.h5 ${HDF_FILE1}.out.h5 -v -s /grp_dsets -d /grp_dsets)
|
2011-03-09 04:17:17 +08:00
|
|
|
# actual test cases
|
|
|
|
# - dataset
|
2011-04-07 22:03:08 +08:00
|
|
|
ADD_H5_TEST (samefile1 0 ${HDF_FILE1}.out.h5 ${HDF_FILE1}.out.h5 -v -s /simple -d /simple_cp)
|
2011-03-09 04:17:17 +08:00
|
|
|
# - group with some datasets
|
2011-04-07 22:03:08 +08:00
|
|
|
ADD_H5_TEST (samefile2 0 ${HDF_FILE1}.out.h5 ${HDF_FILE1}.out.h5 -v -s /grp_dsets -d /grp_dsets_cp)
|
2010-05-14 00:01:50 +08:00
|
|
|
ENDIF (BUILD_TESTING)
|
|
|
|
|
2010-08-26 06:33:59 +08:00
|
|
|
##############################################################################
|
|
|
|
##############################################################################
|
|
|
|
### I N S T A L L A T I O N ###
|
|
|
|
##############################################################################
|
|
|
|
##############################################################################
|
|
|
|
|
2010-05-14 00:01:50 +08:00
|
|
|
#-----------------------------------------------------------------------------
|
|
|
|
# Rules for Installation of tools using make Install target
|
|
|
|
#-----------------------------------------------------------------------------
|
2012-05-25 05:50:06 +08:00
|
|
|
|
2012-08-29 01:39:30 +08:00
|
|
|
#INSTALL_PROGRAM_PDB (h5copy ${HDF5_INSTALL_BIN_DIR} toolsapplications)
|
2012-05-25 05:50:06 +08:00
|
|
|
|
2010-05-14 00:01:50 +08:00
|
|
|
INSTALL (
|
|
|
|
TARGETS
|
|
|
|
h5copy
|
|
|
|
RUNTIME DESTINATION
|
2012-06-20 22:43:02 +08:00
|
|
|
${HDF5_INSTALL_BIN_DIR}
|
2010-05-20 04:11:00 +08:00
|
|
|
COMPONENT
|
|
|
|
toolsapplications
|
2010-05-14 00:01:50 +08:00
|
|
|
)
|