summaryrefslogtreecommitdiffstats
path: root/tools/h5copy
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2007-02-14 14:44:42 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2007-02-14 14:44:42 (GMT)
commit847f01442b20cbe7132a1533e493e06975b48bdc (patch)
treec3939e0da50f811dc126d719ac6aa17e7103e590 /tools/h5copy
parentbb392083b2a81aa942678e06a537a3c0ab5c08aa (diff)
downloadhdf5-847f01442b20cbe7132a1533e493e06975b48bdc.zip
hdf5-847f01442b20cbe7132a1533e493e06975b48bdc.tar.gz
hdf5-847f01442b20cbe7132a1533e493e06975b48bdc.tar.bz2
[svn-r13299] Description:
Put paths to testfile input & output directories in one place, making it easier to modify them if we choose to re-arrange our testfile locations in the future (this should probably be carried over to other test scripts). Make h5copy exit more cleanly if no command line parameters are given. Tested on: Linux/32 2.6 (chicago) Linux/64 2.6 (chicago2)
Diffstat (limited to 'tools/h5copy')
-rw-r--r--tools/h5copy/h5copy.c6
-rw-r--r--tools/h5copy/testh5copy.sh22
2 files changed, 18 insertions, 10 deletions
diff --git a/tools/h5copy/h5copy.c b/tools/h5copy/h5copy.c
index 926be0f..cbbb738 100644
--- a/tools/h5copy/h5copy.c
+++ b/tools/h5copy/h5copy.c
@@ -183,6 +183,12 @@ main (int argc, const char *argv[])
/* initialize h5tools lib */
h5tools_init();
+ /* Check for no command line parameters */
+ if(argc == 1) {
+ usage();
+ leave(EXIT_SUCCESS);
+ } /* end if */
+
/* parse command line options */
while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF)
{
diff --git a/tools/h5copy/testh5copy.sh b/tools/h5copy/testh5copy.sh
index 4106fe0..b8fbb79 100644
--- a/tools/h5copy/testh5copy.sh
+++ b/tools/h5copy/testh5copy.sh
@@ -31,6 +31,8 @@ nerrors=0
verbose=yes
SRCFILE=h5copytst.h5
+INDIR=$srcdir/../testfiles
+OUTDIR=../testfiles
CMP='cmp -s'
DIFF='diff -c'
@@ -38,7 +40,7 @@ DIFF='diff -c'
if test -z "$srcdir"; then
srcdir=.
fi
-test -d ../testfiles || mkdir ../testfiles
+test -d $OUTDIR || mkdir $OUTDIR
# Print a line-line message left justified in a field of 70 characters
# beginning with the word "Testing".
@@ -135,8 +137,8 @@ H5DIFFTEST()
#
H5LSTEST()
{
- expect="$srcdir/../testfiles/`basename $1 .h5`.ls"
- actual="../testfiles/`basename $1 .h5`.out"
+ expect="$INDIR/`basename $1 .h5`.ls"
+ actual="$OUTDIR/`basename $1 .h5`.out"
# Stderr is included in stdout so that the diff can detect
# any unexpected output from that stream too.
@@ -172,8 +174,8 @@ H5LSTEST()
# $3 is group within destination file
COPYOBJECTS()
{
- TESTFILE=$srcdir/../testfiles/$SRCFILE
- FILEOUT="../testfiles/`basename $SRCFILE .h5`.$1.out.h5"
+ TESTFILE="$INDIR/$SRCFILE"
+ FILEOUT="$OUTDIR/`basename $SRCFILE .h5`.$1.out.h5"
# Remove any output file left over from previous test run
rm -f $FILEOUT
@@ -202,7 +204,7 @@ COPYOBJECTS()
# Remove output file created, if the "no cleanup" environment variable is
# not defined
- if [ x$HDF5_NOCLEANUP = "x" ]; then
+ if test -z "$HDF5_NOCLEANUP"; then
rm -f $FILEOUT
fi
}
@@ -211,12 +213,12 @@ COPYOBJECTS()
### T H E T E S T S ###
##############################################################################
-# Copy objects from root group of source file to root of destination file
-# (with implicit root group paths)
+echo "Copy objects from root group of source file to root of destination file"
+echo "(with implicit root group paths)"
COPYOBJECTS a "" ""
-# Copy objects from root group of source file to root of destination file
-# (with explicit root group paths)
+echo "Copy objects from root group of source file to root of destination file"
+echo "(with explicit root group paths)"
COPYOBJECTS b "/" "/"