mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-18 15:15:56 +08:00
Test scripts now execute in-source with creation of tmp dir (#3723)
Fixes a few issues created in #3580: * Fixes a problem where committed tools test files were deleted when cleaning after an in-source build * Fixes issues with test file paths in Autotools tools test scripts
This commit is contained in:
parent
630d6e27c9
commit
b5c63fb3fe
@ -151,9 +151,9 @@ if (HDF5_PACK_EXAMPLES)
|
||||
COMPONENT hdfdocuments
|
||||
)
|
||||
|
||||
option (EXAMPLES_USE_RELEASE_NAME "Use the released examples artifact name" OFF)
|
||||
option (EXAMPLES_DOWNLOAD "Download to use released examples files" OFF)
|
||||
if (EXAMPLES_DOWNLOAD)
|
||||
option (EXAMPLES_USE_RELEASE_NAME "Use the released examples artifact name" OFF)
|
||||
if (EXAMPLES_USE_RELEASE_NAME)
|
||||
set (EXAMPLES_NAME ${EXAMPLES_TGZ_ORIGNAME})
|
||||
else ()
|
||||
|
@ -91,7 +91,7 @@
|
||||
"HDF5_EXAMPLES_COMPRESSED": {"type": "STRING", "value": "hdf5-examples-master.tar.gz"},
|
||||
"HDF5_EXAMPLES_COMPRESSED_DIR": {"type": "PATH", "value": "${sourceParentDir}/temp"},
|
||||
"EXAMPLES_TGZ_ORIGPATH": {"type": "STRING", "value": "https://github.com/HDFGroup/hdf5-examples/releases/download/snapshot"},
|
||||
"EXAMPLES_TGZ_ORIGNAME": {"type": "STRING", "value": "snapshot.tar.gz"}
|
||||
"EXAMPLES_TGZ_ORIGNAME": {"type": "STRING", "value": "hdf5-examples-2.0.4.tar.gz"}
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -84,7 +84,7 @@ nerrors=0
|
||||
verbose=yes
|
||||
h5haveexitcode=yes # default is yes
|
||||
|
||||
TESTDIR=./testfiles
|
||||
TESTDIR=./tmp
|
||||
test -d $TESTDIR || mkdir $TESTDIR
|
||||
|
||||
# RUNSERIAL is used. Check if it can return exit code from executalbe correctly.
|
||||
|
@ -47,7 +47,7 @@ SRC_TOOLS="$srcdir/../.."
|
||||
SRC_H5DIFF_TESTFILES="$SRC_TOOLS/test/h5diff/testfiles"
|
||||
SRC_H5DIFF_OUTFILES="$SRC_TOOLS/test/h5diff/expected"
|
||||
|
||||
TESTDIR=./testplug
|
||||
TESTDIR=./tmppl
|
||||
test -d $TESTDIR || mkdir $TESTDIR
|
||||
|
||||
######################################################################
|
||||
|
@ -49,7 +49,7 @@ SRC_H5STAT_TESTFILES="$SRC_TOOLS/test/h5stat/testfiles"
|
||||
SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/test/h5import/testfiles"
|
||||
SRC_H5DIFF_OUTFILES="$SRC_TOOLS/test/h5diff/expected"
|
||||
|
||||
TESTDIR=./testfiles
|
||||
TESTDIR=./tmp
|
||||
test -d $TESTDIR || mkdir $TESTDIR
|
||||
|
||||
######################################################################
|
||||
|
@ -48,7 +48,7 @@ SRC_TOOLS="$srcdir/../.."
|
||||
SRC_H5DUMP_TESTFILES="$SRC_TOOLS/test/h5dump/testfiles"
|
||||
SRC_H5DUMP_OUTFILES="$SRC_TOOLS/test/h5dump/expected"
|
||||
|
||||
TESTDIR=./testplug
|
||||
TESTDIR=./tmppl
|
||||
test -d $TESTDIR || mkdir $TESTDIR
|
||||
|
||||
######################################################################
|
||||
|
@ -66,7 +66,7 @@ SRC_H5STAT_TESTFILES="$SRC_TOOLS/test/h5stat/testfiles"
|
||||
SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/test/h5import/testfiles"
|
||||
|
||||
TEST_P_DIR=./testfiles
|
||||
TESTDIR=./testfiles/std
|
||||
TESTDIR=./tmp
|
||||
test -d $TEST_P_DIR || mkdir -p $TEST_P_DIR
|
||||
test -d $TESTDIR || mkdir -p $TESTDIR
|
||||
|
||||
|
@ -58,7 +58,7 @@ SRC_H5STAT_TESTFILES="$SRC_TOOLS/test/h5stat/testfiles"
|
||||
SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/test/h5import/testfiles"
|
||||
|
||||
TEST_P_DIR=./testfiles
|
||||
TESTDIR=./testfiles/pbits
|
||||
TESTDIR=./tmpbits
|
||||
test -d $TEST_P_DIR || mkdir -p $TEST_P_DIR
|
||||
test -d $TESTDIR || mkdir -p $TESTDIR
|
||||
|
||||
@ -187,7 +187,7 @@ CLEAN_TESTFILES_AND_TESTDIR()
|
||||
# skip rm if srcdir is same as destdir
|
||||
# this occurs when build/test performed in source dir and
|
||||
# make cp fail
|
||||
SDIR=$SRC_H5DUMP_TESTFILES/pbits
|
||||
SDIR=$SRC_H5DUMP_TESTFILES
|
||||
INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
|
||||
INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
|
||||
if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
|
||||
|
@ -58,7 +58,7 @@ SRC_H5STAT_TESTFILES="$SRC_TOOLS/test/h5stat/testfiles"
|
||||
SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/test/h5import/testfiles"
|
||||
|
||||
TEST_P_DIR=./testfiles
|
||||
TESTDIR=./testfiles/vds
|
||||
TESTDIR=./tmpvds
|
||||
test -d $TEST_P_DIR || mkdir -p $TEST_P_DIR
|
||||
test -d $TESTDIR || mkdir -p $TESTDIR
|
||||
|
||||
@ -166,7 +166,7 @@ CLEAN_TESTFILES_AND_TESTDIR()
|
||||
# skip rm if srcdir is same as destdir
|
||||
# this occurs when build/test performed in source dir and
|
||||
# make cp fail
|
||||
SDIR=$SRC_H5DUMP_TESTFILES/vds
|
||||
SDIR=$SRC_H5DUMP_TESTFILES
|
||||
INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
|
||||
INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
|
||||
if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
|
||||
|
@ -49,7 +49,7 @@ SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/test/h5import/testfiles"
|
||||
SRC_H5DUMP_OUTFILES="$SRC_TOOLS/test/h5dump/expected"
|
||||
|
||||
TEST_P_DIR=./testfiles
|
||||
TESTDIR=./testfiles/xml
|
||||
TESTDIR=./tmpxml
|
||||
test -d $TEST_P_DIR || mkdir -p $TEST_P_DIR
|
||||
test -d $TESTDIR || mkdir -p $TESTDIR
|
||||
|
||||
|
@ -378,11 +378,11 @@
|
||||
COMMAND "${CMAKE_COMMAND}"
|
||||
-D "TEST_EMULATOR=${CMAKE_CROSSCOMPILING_EMULATOR}"
|
||||
-D "TEST_PROGRAM=$<TARGET_FILE:h5dump${tgt_file_ext}>"
|
||||
-D "TEST_ARGS:STRING=-BH;./testfiles/${testname}-tmp.h5"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}"
|
||||
-D "TEST_OUTPUT=testfiles/${testname}_chk.out"
|
||||
-D "TEST_ARGS:STRING=-BH;${testname}-tmp.h5"
|
||||
-D "TEST_FOLDER=${PROJECT_BINARY_DIR}/testfiles"
|
||||
-D "TEST_OUTPUT=${testname}_chk.out"
|
||||
-D "TEST_EXPECT=0"
|
||||
-D "TEST_REFERENCE=testfiles/${testname}.ddl"
|
||||
-D "TEST_REFERENCE=${testname}.ddl"
|
||||
-P "${HDF_RESOURCES_DIR}/runTest.cmake"
|
||||
)
|
||||
set_tests_properties (H5FC_H5DUMP_CHECK-${testname}-dump PROPERTIES
|
||||
|
@ -1,4 +1,4 @@
|
||||
HDF5 "./testfiles/h5fc_ext1_f-tmp.h5" {
|
||||
HDF5 "h5fc_ext1_f-tmp.h5" {
|
||||
SUPER_BLOCK {
|
||||
SUPERBLOCK_VERSION 2
|
||||
FREELIST_VERSION 0
|
||||
|
@ -1,4 +1,4 @@
|
||||
HDF5 "./testfiles/h5fc_ext1_i-tmp.h5" {
|
||||
HDF5 "h5fc_ext1_i-tmp.h5" {
|
||||
SUPER_BLOCK {
|
||||
SUPERBLOCK_VERSION 2
|
||||
FREELIST_VERSION 0
|
||||
|
@ -1,4 +1,4 @@
|
||||
HDF5 "./testfiles/h5fc_ext1_s-tmp.h5" {
|
||||
HDF5 "h5fc_ext1_s-tmp.h5" {
|
||||
SUPER_BLOCK {
|
||||
SUPERBLOCK_VERSION 2
|
||||
FREELIST_VERSION 0
|
||||
|
@ -1,4 +1,4 @@
|
||||
HDF5 "./testfiles/h5fc_ext2_if-tmp.h5" {
|
||||
HDF5 "h5fc_ext2_if-tmp.h5" {
|
||||
SUPER_BLOCK {
|
||||
SUPERBLOCK_VERSION 2
|
||||
FREELIST_VERSION 0
|
||||
|
@ -1,4 +1,4 @@
|
||||
HDF5 "./testfiles/h5fc_ext2_is-tmp.h5" {
|
||||
HDF5 "h5fc_ext2_is-tmp.h5" {
|
||||
SUPER_BLOCK {
|
||||
SUPERBLOCK_VERSION 2
|
||||
FREELIST_VERSION 0
|
||||
|
@ -1,4 +1,4 @@
|
||||
HDF5 "./testfiles/h5fc_ext2_sf-tmp.h5" {
|
||||
HDF5 "h5fc_ext2_sf-tmp.h5" {
|
||||
SUPER_BLOCK {
|
||||
SUPERBLOCK_VERSION 2
|
||||
FREELIST_VERSION 0
|
||||
|
@ -1,4 +1,4 @@
|
||||
HDF5 "./testfiles/h5fc_ext3_isf-tmp.h5" {
|
||||
HDF5 "h5fc_ext3_isf-tmp.h5" {
|
||||
SUPER_BLOCK {
|
||||
SUPERBLOCK_VERSION 2
|
||||
FREELIST_VERSION 0
|
||||
|
@ -1,4 +1,4 @@
|
||||
HDF5 "./testfiles/old_h5fc_ext1_f-tmp.h5" {
|
||||
HDF5 "old_h5fc_ext1_f-tmp.h5" {
|
||||
SUPER_BLOCK {
|
||||
SUPERBLOCK_VERSION 2
|
||||
FREELIST_VERSION 0
|
||||
|
@ -1,4 +1,4 @@
|
||||
HDF5 "./testfiles/old_h5fc_ext1_i-tmp.h5" {
|
||||
HDF5 "old_h5fc_ext1_i-tmp.h5" {
|
||||
SUPER_BLOCK {
|
||||
SUPERBLOCK_VERSION 1
|
||||
FREELIST_VERSION 0
|
||||
|
@ -1,4 +1,4 @@
|
||||
HDF5 "./testfiles/old_h5fc_ext1_s-tmp.h5" {
|
||||
HDF5 "old_h5fc_ext1_s-tmp.h5" {
|
||||
SUPER_BLOCK {
|
||||
SUPERBLOCK_VERSION 2
|
||||
FREELIST_VERSION 0
|
||||
|
@ -1,4 +1,4 @@
|
||||
HDF5 "./testfiles/old_h5fc_ext2_if-tmp.h5" {
|
||||
HDF5 "old_h5fc_ext2_if-tmp.h5" {
|
||||
SUPER_BLOCK {
|
||||
SUPERBLOCK_VERSION 2
|
||||
FREELIST_VERSION 0
|
||||
|
@ -1,4 +1,4 @@
|
||||
HDF5 "./testfiles/old_h5fc_ext2_is-tmp.h5" {
|
||||
HDF5 "old_h5fc_ext2_is-tmp.h5" {
|
||||
SUPER_BLOCK {
|
||||
SUPERBLOCK_VERSION 2
|
||||
FREELIST_VERSION 0
|
||||
|
@ -1,4 +1,4 @@
|
||||
HDF5 "./testfiles/old_h5fc_ext2_sf-tmp.h5" {
|
||||
HDF5 "old_h5fc_ext2_sf-tmp.h5" {
|
||||
SUPER_BLOCK {
|
||||
SUPERBLOCK_VERSION 2
|
||||
FREELIST_VERSION 0
|
||||
|
@ -1,4 +1,4 @@
|
||||
HDF5 "./testfiles/old_h5fc_ext3_isf-tmp.h5" {
|
||||
HDF5 "old_h5fc_ext3_isf-tmp.h5" {
|
||||
SUPER_BLOCK {
|
||||
SUPERBLOCK_VERSION 2
|
||||
FREELIST_VERSION 0
|
||||
|
@ -62,7 +62,7 @@ SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/test/h5import/testfiles"
|
||||
SRC_H5FORMCONV_TESTFILES="$SRC_TOOLS/test/h5format_convert/testfiles"
|
||||
SRC_H5FORMCONV_OUTFILES="$SRC_TOOLS/test/h5format_convert/expected"
|
||||
|
||||
TESTDIR=./testfiles
|
||||
TESTDIR=./tmp
|
||||
test -d $TESTDIR || mkdir $TESTDIR
|
||||
|
||||
# Copy the testfile to a temporary file for testing as h5format_convert is changing the file in place
|
||||
@ -419,8 +419,15 @@ H5DUMP_CHECK() {
|
||||
actual="$TESTDIR/`basename $2 .ddl`.out"
|
||||
actual_err="$TESTDIR/`basename $2 .ddl`.err"
|
||||
testfile="`basename $2 .ddl`-tmp.h5"
|
||||
$RUNSERIAL $H5DUMP_BIN -BH $TESTDIR/$testfile > $actual 2>$actual_err
|
||||
# Run test.
|
||||
(
|
||||
cd $TESTDIR
|
||||
$RUNSERIAL $H5DUMP_BIN -BH $testfile
|
||||
) >$actual 2>$actual_err
|
||||
cat $actual_err >> $actual
|
||||
cp $actual $actual_sav
|
||||
cp $actual_err $actual_err_sav
|
||||
STDERR_FILTER $actual_err
|
||||
|
||||
# Compare output
|
||||
COMPARE_OUT $expect $actual
|
||||
|
@ -52,7 +52,7 @@ SRC_H5JAM_TESTFILES="$SRC_TOOLS/test/h5jam/testfiles"
|
||||
SRC_H5STAT_TESTFILES="$SRC_TOOLS/test/h5stat/testfiles"
|
||||
SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/test/h5import/testfiles"
|
||||
|
||||
TESTDIR=./testfiles
|
||||
TESTDIR=./tmp
|
||||
test -d $TESTDIR || mkdir $TESTDIR
|
||||
|
||||
######################################################################
|
||||
|
@ -55,7 +55,7 @@ SRC_H5STAT_TESTFILES="$SRC_TOOLS/test/h5stat/testfiles"
|
||||
SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/test/h5import/testfiles"
|
||||
SRC_H5JAM_OUTFILES="$SRC_TOOLS/test/h5jam/expected"
|
||||
|
||||
TESTDIR=./testfiles
|
||||
TESTDIR=./tmp
|
||||
test -d $TESTDIR || mkdir $TESTDIR
|
||||
|
||||
######################################################################
|
||||
|
@ -49,7 +49,7 @@ SRC_H5LS_TESTFILES="$SRC_TOOLS/test/h5ls/testfiles"
|
||||
SRC_H5DUMP_TESTFILES="$SRC_TOOLS/test/h5dump/testfiles"
|
||||
SRC_H5LS_OUTFILES="$SRC_TOOLS/test/h5ls/expected"
|
||||
|
||||
TESTDIR=./testplug
|
||||
TESTDIR=./tmppl
|
||||
test -d $TESTDIR || mkdir $TESTDIR
|
||||
|
||||
######################################################################
|
||||
|
@ -54,7 +54,7 @@ SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/test/h5import/testfiles"
|
||||
SRC_H5LS_ERRFILES="$SRC_TOOLS/test/h5ls/errfiles"
|
||||
SRC_H5LS_OUTFILES="$SRC_TOOLS/test/h5ls/expected"
|
||||
|
||||
TESTDIR=./testfiles
|
||||
TESTDIR=./tmp
|
||||
test -d $TESTDIR || mkdir $TESTDIR
|
||||
|
||||
######################################################################
|
||||
|
@ -51,7 +51,7 @@ SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/test/h5import/testfiles"
|
||||
SRC_H5LS_OUTFILES="$SRC_TOOLS/test/h5ls/expected"
|
||||
|
||||
TEST_P_DIR=./testfiles
|
||||
TESTDIR=./testfiles/vds
|
||||
TESTDIR=./tmpvds
|
||||
test -d $TEST_P_DIR || mkdir -p $TEST_P_DIR
|
||||
test -d $TESTDIR || mkdir $TESTDIR
|
||||
|
||||
@ -145,7 +145,7 @@ CLEAN_TESTFILES_AND_TESTDIR()
|
||||
# skip rm if srcdir is same as destdir
|
||||
# this occurs when build/test performed in source dir and
|
||||
# make cp fail
|
||||
SDIR=$SRC_H5LS_TESTFILES/vds
|
||||
SDIR=$SRC_H5LS_TESTFILES
|
||||
INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
|
||||
INODE_DDIR=`$LS -i -d $TESTDIR | $AWK -F' ' '{print $1}'`
|
||||
if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
|
||||
|
@ -68,7 +68,7 @@ SRC_H5STAT_TESTFILES="$SRC_TOOLS/test/h5stat/testfiles"
|
||||
SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/test/h5import/testfiles"
|
||||
SRC_H5REPACK_OUTFILES="$SRC_TOOLS/test/h5repack/expected"
|
||||
|
||||
TESTDIR=./testpack
|
||||
TESTDIR=./tmp
|
||||
test -d $TESTDIR || mkdir $TESTDIR
|
||||
|
||||
######################################################################
|
||||
|
@ -49,7 +49,7 @@ SRC_TOOLS="$srcdir/../.."
|
||||
SRC_H5REPACK_TESTFILES="$SRC_TOOLS/test/h5repack/testfiles"
|
||||
SRC_H5REPACK_OUTFILES="$SRC_TOOLS/test/h5repack/expected"
|
||||
|
||||
TESTDIR=testplug
|
||||
TESTDIR=./tmppl
|
||||
test -d $TESTDIR || mkdir $TESTDIR
|
||||
|
||||
######################################################################
|
||||
|
@ -51,7 +51,7 @@ SRC_H5STAT_TESTFILES="$SRC_TOOLS/test/h5stat/testfiles"
|
||||
SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/test/h5import/testfiles"
|
||||
SRC_H5STAT_OUTFILES="$SRC_TOOLS/test/h5stat/expected"
|
||||
|
||||
TESTDIR=./testfiles
|
||||
TESTDIR=./tmp
|
||||
test -d $TESTDIR || mkdir $TESTDIR
|
||||
|
||||
######################################################################
|
||||
|
@ -44,7 +44,7 @@ SRC_TOOLS="$srcdir/../.."
|
||||
SRC_H5CLEAR_TESTFILES="$SRC_TOOLS/test/misc/testfiles"
|
||||
SRC_H5CLEAR_OUTFILES="$SRC_TOOLS/test/misc/expected"
|
||||
|
||||
TESTDIR=./testh5clear
|
||||
TESTDIR=./tmpclr
|
||||
test -d $TESTDIR || mkdir -p $TESTDIR
|
||||
|
||||
######################################################################
|
||||
|
@ -43,7 +43,7 @@ SRC_TOOLS="$srcdir/../.."
|
||||
SRC_H5MKGRP_TESTFILES="$SRC_TOOLS/test/misc/testfiles"
|
||||
SRC_H5MKGRP_OUTFILES="$SRC_TOOLS/test/misc/expected"
|
||||
|
||||
TESTDIR=./testgrp
|
||||
TESTDIR=./tmpmkg
|
||||
test -d $TESTDIR || mkdir -p $TESTDIR
|
||||
|
||||
######################################################################
|
||||
|
@ -40,7 +40,7 @@ SRC_TOOLS="$srcdir/../.."
|
||||
|
||||
SRC_H5REPART_TESTFILES="$SRC_TOOLS/test/misc/testfiles"
|
||||
|
||||
TESTDIR=./testrepart
|
||||
TESTDIR=./tmprp
|
||||
test -d $TESTDIR || mkdir -p $TESTDIR
|
||||
|
||||
#
|
||||
|
@ -30,7 +30,7 @@ exit_code=$EXIT_SUCCESS
|
||||
|
||||
|
||||
# Add Testing files into the local testfiles directory::
|
||||
TESTDIR=./testfiles
|
||||
TESTDIR=./tmp
|
||||
test -d $TESTDIR || mkdir $TESTDIR
|
||||
|
||||
echo "HDF5 \"$THIS_DIR/testfiles/h5diff_basic1.h5\" {" > "$THIS_DIR"/testfiles/h5diff_basic1.h5_h5dump.txt
|
||||
|
@ -68,7 +68,7 @@ SRC_H5JAM_TESTFILES="$SRC_TOOLS/h5jam/testfiles"
|
||||
SRC_H5DWALK_TESTFILES="$SRC_TOOLS/h5dwalk/testfiles"
|
||||
SRC_H5IMPORT_TESTFILES="$SRC_TOOLS/h5import/testfiles"
|
||||
|
||||
TESTDIR=./testfiles
|
||||
TESTDIR=./tmpdw
|
||||
test -d $TESTDIR || mkdir $TESTDIR
|
||||
|
||||
echo "SRC_H5DIFF_TESTFILES = $SRC_H5DIFF_TESTFILES"
|
||||
|
Loading…
Reference in New Issue
Block a user