diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2008-10-17 23:45:32 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2008-10-17 23:45:32 (GMT) |
commit | 1e1bcb801cb2b569ffa2a94cce2433da2917d919 (patch) | |
tree | e39ca49188f0f01382a881349ddd2c3cd58d3d1d /tools | |
parent | 6c262bfc9359e274c6a2b8234c34e4415d8146ed (diff) | |
download | hdf5-1e1bcb801cb2b569ffa2a94cce2433da2917d919.zip hdf5-1e1bcb801cb2b569ffa2a94cce2433da2917d919.tar.gz hdf5-1e1bcb801cb2b569ffa2a94cce2433da2917d919.tar.bz2 |
[svn-r15900] Make the h5copy test that renames a group to return 1 on the h5diff call and assume 1 is the correct result
Drop the -c flag for h5diff
Tested: linux
Diffstat (limited to 'tools')
-rw-r--r-- | tools/h5copy/testh5copy.sh | 73 | ||||
-rw-r--r-- | tools/h5diff/h5diff_common.c | 13 | ||||
-rw-r--r-- | tools/h5diff/h5diff_common.h | 2 | ||||
-rw-r--r-- | tools/h5diff/h5diff_main.c | 6 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_10.txt | 1 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_600.txt | 1 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_603.txt | 1 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_604.txt | 1 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_605.txt | 1 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_606.txt | 1 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_612.txt | 1 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_613.txt | 1 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_614.txt | 1 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_615.txt | 1 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_621.txt | 1 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_622.txt | 1 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_623.txt | 1 | ||||
-rw-r--r-- | tools/h5diff/testfiles/h5diff_624.txt | 1 | ||||
-rw-r--r-- | tools/lib/h5diff.c | 4 | ||||
-rw-r--r-- | tools/lib/h5diff.h | 1 |
20 files changed, 71 insertions, 42 deletions
diff --git a/tools/h5copy/testh5copy.sh b/tools/h5copy/testh5copy.sh index 5337e74..ddb37ee 100644 --- a/tools/h5copy/testh5copy.sh +++ b/tools/h5copy/testh5copy.sh @@ -115,10 +115,53 @@ TOOLTEST() fi if [ $runh5diff != no ]; then - H5DIFFTEST -c $inputfile $outputfile + H5DIFFTEST $inputfile $outputfile $7 $9 fi } + +TOOLTEST_FAIL() +{ + runh5diff=yes + if [ "$1" = -i ]; then + inputfile=$2 + else + runh5diff=no + fi + if [ "$3" = -o ]; then + outputfile=$4 + else + runh5diff=no + fi + + TESTING $H5COPY $@ + ( + echo "#############################" + echo " output for '$H5COPY $@'" + echo "#############################" + $RUNSERIAL $H5COPY_BIN $@ + ) > output.out + RET=$? + if [ $RET != 0 ]; then + echo "*FAILED*" + echo "failed result is:" + cat output.out + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + + # Clean up output file + if test -z "$HDF5_NOCLEANUP"; then + rm -f output.out + fi + fi + + if [ $runh5diff != no ]; then + H5DIFFTEST_FAIL $inputfile $outputfile $7 $9 + fi +} + + # Call the h5diff tool # H5DIFFTEST() @@ -139,6 +182,26 @@ H5DIFFTEST() fi } +# Call the h5diff tool with a call that is expected to fail +# +H5DIFFTEST_FAIL() +{ + VERIFY $@ + if [ "`uname -s`" = "TFLOPS O/S" ]; then + $RUNSERIAL $H5DIFF_BIN -q $@ + else + $RUNSERIAL $H5DIFF_BIN -q "$@" + fi + RET=$? + + if [ $RET != 1 ] ; then + echo "*FAILED*" + nerrors="`expr $nerrors + 1`" + else + echo " PASSED" + fi +} + # Call the h5ls tool to verify the correct output data in the destination file # H5LSTEST() @@ -216,17 +279,17 @@ COPYOBJECTS() TOOLTEST -i $TESTFILE -o $FILEOUT -v -s /grp_dsets/simple -d /grp_dsets/simple_group echo "Test copying & renaming group" - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_rename + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d grp_rename echo "Test copying 'full' group hierarchy into group in destination file" - TOOLTEST -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d /grp_rename/grp_dsets + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -v -s grp_dsets -d /grp_rename/grp_dsets echo "Test copying objects into group hier. that doesn't exist yet in destination file" TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s simple -d /A/B1/simple TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s simple -d /A/B2/simple2 TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets/simple -d /C/D/simple - TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets -d /E/F/grp_dsets - TOOLTEST -i $TESTFILE -o $FILEOUT -vp -s /grp_nested -d /G/H/grp_nested + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_dsets -d /E/F/grp_dsets + TOOLTEST_FAIL -i $TESTFILE -o $FILEOUT -vp -s /grp_nested -d /G/H/grp_nested # Verify that the file created above is correct H5LSTEST $FILEOUT diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c index cfe61f5..a698921 100644 --- a/tools/h5diff/h5diff_common.c +++ b/tools/h5diff/h5diff_common.c @@ -31,7 +31,7 @@ const char *progname = "h5diff"; * Command-line options: The user can specify short or long-named * parameters. */ -static const char *s_opts = "hVrvqn:d:p:c"; +static const char *s_opts = "hVrvqn:d:p:"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, { "version", no_arg, 'V' }, @@ -41,7 +41,6 @@ static struct long_options l_opts[] = { { "count", require_arg, 'n' }, { "delta", require_arg, 'd' }, { "relative", require_arg, 'p' }, - { "contents", no_arg, 'c' }, { NULL, 0, '\0' } }; @@ -56,10 +55,6 @@ static struct long_options l_opts[] = { void parse_command_line(int argc, const char* argv[], - const char** fname1, - const char** fname2, - const char** objname1, - const char** objname2, diff_opt_t* options) { @@ -90,10 +85,6 @@ void parse_command_line(int argc, case 'r': options->m_report = 1; break; - case 'c': - /* ignore graph comparison in return value */ - options->m_no_contents = 1; - break; case 'd': options->d=1; @@ -304,8 +295,6 @@ void usage(void) printf(" -r, --report Report mode. Print differences\n"); printf(" -v, --verbose Verbose mode. Print differences, list of objects\n"); printf(" -q, --quiet Quiet mode. Do not do output\n"); - printf(" -c, --contents Ignore graph contents differences in return value\n"); - printf(" -n C, --count=C Print differences up to C number\n"); printf(" -d D, --delta=D Print difference when greater than limit D\n"); diff --git a/tools/h5diff/h5diff_common.h b/tools/h5diff/h5diff_common.h index 2796bd5..b5d83e2 100644 --- a/tools/h5diff/h5diff_common.h +++ b/tools/h5diff/h5diff_common.h @@ -17,7 +17,7 @@ extern unsigned char g_Parallel; extern int g_nTasks; void usage(void); -void parse_command_line(int argc, const char* argv[], const char** fname1, const char** fname2, const char** objname1, const char** objname2, diff_opt_t* options); +void parse_command_line(int argc, const char* argv[], diff_opt_t* options); void h5diff_exit(int status); void print_info(diff_opt_t* options); diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c index f009651..7de3c0c 100644 --- a/tools/h5diff/h5diff_main.c +++ b/tools/h5diff/h5diff_main.c @@ -94,7 +94,7 @@ int main(int argc, const char *argv[]) *------------------------------------------------------------------------- */ - parse_command_line(argc, argv, &fname1, &fname2, &objname1, &objname2, &options); + parse_command_line(argc, argv, &options); /*------------------------------------------------------------------------- * file and object names @@ -140,10 +140,6 @@ int main(int argc, const char *argv[]) if ( options.contents == 0 ) ret = 1; - /* but return 0 for no differences if graph comparison not required */ - if ( options.m_no_contents == 1 ) - ret = 0; - /* and return 2 for error */ if (options.err_stat) ret = 2; diff --git a/tools/h5diff/testfiles/h5diff_10.txt b/tools/h5diff/testfiles/h5diff_10.txt index 57d9882..a74a37c 100644 --- a/tools/h5diff/testfiles/h5diff_10.txt +++ b/tools/h5diff/testfiles/h5diff_10.txt @@ -9,7 +9,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences -v, --verbose Verbose mode. Print differences, list of objects -q, --quiet Quiet mode. Do not do output - -c, --contents Ignore graph contents differences in return value -n C, --count=C Print differences up to C number -d D, --delta=D Print difference when greater than limit D -p R, --relative=R Print difference when greater than relative limit R diff --git a/tools/h5diff/testfiles/h5diff_600.txt b/tools/h5diff/testfiles/h5diff_600.txt index 33ba01f..dcf14f7 100644 --- a/tools/h5diff/testfiles/h5diff_600.txt +++ b/tools/h5diff/testfiles/h5diff_600.txt @@ -9,7 +9,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences -v, --verbose Verbose mode. Print differences, list of objects -q, --quiet Quiet mode. Do not do output - -c, --contents Ignore graph contents differences in return value -n C, --count=C Print differences up to C number -d D, --delta=D Print difference when greater than limit D -p R, --relative=R Print difference when greater than relative limit R diff --git a/tools/h5diff/testfiles/h5diff_603.txt b/tools/h5diff/testfiles/h5diff_603.txt index a50cb54..e274d88 100644 --- a/tools/h5diff/testfiles/h5diff_603.txt +++ b/tools/h5diff/testfiles/h5diff_603.txt @@ -10,7 +10,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences -v, --verbose Verbose mode. Print differences, list of objects -q, --quiet Quiet mode. Do not do output - -c, --contents Ignore graph contents differences in return value -n C, --count=C Print differences up to C number -d D, --delta=D Print difference when greater than limit D -p R, --relative=R Print difference when greater than relative limit R diff --git a/tools/h5diff/testfiles/h5diff_604.txt b/tools/h5diff/testfiles/h5diff_604.txt index 517d0b6..8232c38 100644 --- a/tools/h5diff/testfiles/h5diff_604.txt +++ b/tools/h5diff/testfiles/h5diff_604.txt @@ -10,7 +10,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences -v, --verbose Verbose mode. Print differences, list of objects -q, --quiet Quiet mode. Do not do output - -c, --contents Ignore graph contents differences in return value -n C, --count=C Print differences up to C number -d D, --delta=D Print difference when greater than limit D -p R, --relative=R Print difference when greater than relative limit R diff --git a/tools/h5diff/testfiles/h5diff_605.txt b/tools/h5diff/testfiles/h5diff_605.txt index 3d887d7..bce2118 100644 --- a/tools/h5diff/testfiles/h5diff_605.txt +++ b/tools/h5diff/testfiles/h5diff_605.txt @@ -10,7 +10,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences -v, --verbose Verbose mode. Print differences, list of objects -q, --quiet Quiet mode. Do not do output - -c, --contents Ignore graph contents differences in return value -n C, --count=C Print differences up to C number -d D, --delta=D Print difference when greater than limit D -p R, --relative=R Print difference when greater than relative limit R diff --git a/tools/h5diff/testfiles/h5diff_606.txt b/tools/h5diff/testfiles/h5diff_606.txt index a1e46c1..9a0a8cd 100644 --- a/tools/h5diff/testfiles/h5diff_606.txt +++ b/tools/h5diff/testfiles/h5diff_606.txt @@ -10,7 +10,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences -v, --verbose Verbose mode. Print differences, list of objects -q, --quiet Quiet mode. Do not do output - -c, --contents Ignore graph contents differences in return value -n C, --count=C Print differences up to C number -d D, --delta=D Print difference when greater than limit D -p R, --relative=R Print difference when greater than relative limit R diff --git a/tools/h5diff/testfiles/h5diff_612.txt b/tools/h5diff/testfiles/h5diff_612.txt index 8436dee..16baa7c 100644 --- a/tools/h5diff/testfiles/h5diff_612.txt +++ b/tools/h5diff/testfiles/h5diff_612.txt @@ -10,7 +10,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences -v, --verbose Verbose mode. Print differences, list of objects -q, --quiet Quiet mode. Do not do output - -c, --contents Ignore graph contents differences in return value -n C, --count=C Print differences up to C number -d D, --delta=D Print difference when greater than limit D -p R, --relative=R Print difference when greater than relative limit R diff --git a/tools/h5diff/testfiles/h5diff_613.txt b/tools/h5diff/testfiles/h5diff_613.txt index 7156b0a..e57c320 100644 --- a/tools/h5diff/testfiles/h5diff_613.txt +++ b/tools/h5diff/testfiles/h5diff_613.txt @@ -10,7 +10,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences -v, --verbose Verbose mode. Print differences, list of objects -q, --quiet Quiet mode. Do not do output - -c, --contents Ignore graph contents differences in return value -n C, --count=C Print differences up to C number -d D, --delta=D Print difference when greater than limit D -p R, --relative=R Print difference when greater than relative limit R diff --git a/tools/h5diff/testfiles/h5diff_614.txt b/tools/h5diff/testfiles/h5diff_614.txt index 3acd663..828d250 100644 --- a/tools/h5diff/testfiles/h5diff_614.txt +++ b/tools/h5diff/testfiles/h5diff_614.txt @@ -10,7 +10,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences -v, --verbose Verbose mode. Print differences, list of objects -q, --quiet Quiet mode. Do not do output - -c, --contents Ignore graph contents differences in return value -n C, --count=C Print differences up to C number -d D, --delta=D Print difference when greater than limit D -p R, --relative=R Print difference when greater than relative limit R diff --git a/tools/h5diff/testfiles/h5diff_615.txt b/tools/h5diff/testfiles/h5diff_615.txt index 25b7f5d..654a743 100644 --- a/tools/h5diff/testfiles/h5diff_615.txt +++ b/tools/h5diff/testfiles/h5diff_615.txt @@ -10,7 +10,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences -v, --verbose Verbose mode. Print differences, list of objects -q, --quiet Quiet mode. Do not do output - -c, --contents Ignore graph contents differences in return value -n C, --count=C Print differences up to C number -d D, --delta=D Print difference when greater than limit D -p R, --relative=R Print difference when greater than relative limit R diff --git a/tools/h5diff/testfiles/h5diff_621.txt b/tools/h5diff/testfiles/h5diff_621.txt index 54e4bf5..18acda6 100644 --- a/tools/h5diff/testfiles/h5diff_621.txt +++ b/tools/h5diff/testfiles/h5diff_621.txt @@ -10,7 +10,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences -v, --verbose Verbose mode. Print differences, list of objects -q, --quiet Quiet mode. Do not do output - -c, --contents Ignore graph contents differences in return value -n C, --count=C Print differences up to C number -d D, --delta=D Print difference when greater than limit D -p R, --relative=R Print difference when greater than relative limit R diff --git a/tools/h5diff/testfiles/h5diff_622.txt b/tools/h5diff/testfiles/h5diff_622.txt index b21deb9..7740b0a 100644 --- a/tools/h5diff/testfiles/h5diff_622.txt +++ b/tools/h5diff/testfiles/h5diff_622.txt @@ -10,7 +10,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences -v, --verbose Verbose mode. Print differences, list of objects -q, --quiet Quiet mode. Do not do output - -c, --contents Ignore graph contents differences in return value -n C, --count=C Print differences up to C number -d D, --delta=D Print difference when greater than limit D -p R, --relative=R Print difference when greater than relative limit R diff --git a/tools/h5diff/testfiles/h5diff_623.txt b/tools/h5diff/testfiles/h5diff_623.txt index 751d10f..e238a6b 100644 --- a/tools/h5diff/testfiles/h5diff_623.txt +++ b/tools/h5diff/testfiles/h5diff_623.txt @@ -10,7 +10,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences -v, --verbose Verbose mode. Print differences, list of objects -q, --quiet Quiet mode. Do not do output - -c, --contents Ignore graph contents differences in return value -n C, --count=C Print differences up to C number -d D, --delta=D Print difference when greater than limit D -p R, --relative=R Print difference when greater than relative limit R diff --git a/tools/h5diff/testfiles/h5diff_624.txt b/tools/h5diff/testfiles/h5diff_624.txt index 045991e..7100555 100644 --- a/tools/h5diff/testfiles/h5diff_624.txt +++ b/tools/h5diff/testfiles/h5diff_624.txt @@ -10,7 +10,6 @@ usage: h5diff [OPTIONS] file1 file2 [obj1[obj2]] -r, --report Report mode. Print differences -v, --verbose Verbose mode. Print differences, list of objects -q, --quiet Quiet mode. Do not do output - -c, --contents Ignore graph contents differences in return value -n C, --count=C Print differences up to C number -d D, --delta=D Print difference when greater than limit D -p R, --relative=R Print difference when greater than relative limit R diff --git a/tools/lib/h5diff.c b/tools/lib/h5diff.c index 2b10c57..5669945 100644 --- a/tools/lib/h5diff.c +++ b/tools/lib/h5diff.c @@ -974,10 +974,6 @@ hsize_t diff(hid_t file1_id, /* if "path1" != "path2" then the groups are "different" */ nfound = (ret != 0) ? 1 : 0; - /* if the ignore graph is present, consider a no difference */ - if ( options->m_no_contents == 1 ) - nfound = 0; - if(print_objname(options, nfound)) do_print_objname("group", path1, path2); diff --git a/tools/lib/h5diff.h b/tools/lib/h5diff.h index 2444023..430ee65 100644 --- a/tools/lib/h5diff.h +++ b/tools/lib/h5diff.h @@ -38,7 +38,6 @@ typedef struct { int cmn_objs; /* do we have comparable objects */ int not_cmp; /* are the objects comparable */ int contents; /* equal contents */ - int m_no_contents; /* ignore graph comparison in return value */ } diff_opt_t; |