diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2008-10-16 23:24:18 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2008-10-16 23:24:18 (GMT) |
commit | 924ba14474479cacc6aa99aabb2ac81462ff6d73 (patch) | |
tree | 4a23df0c90e6e80fe37f83c17d8bb72abe49c82e /tools/h5diff | |
parent | 208777ec89b63e27fbe34879ec43d95329301c08 (diff) | |
download | hdf5-924ba14474479cacc6aa99aabb2ac81462ff6d73.zip hdf5-924ba14474479cacc6aa99aabb2ac81462ff6d73.tar.gz hdf5-924ba14474479cacc6aa99aabb2ac81462ff6d73.tar.bz2 |
[svn-r15896] Introduced a -c flag to ignore file contents differences in the return value (return 0 id -c is present)
Introduced for h5copy validation
Tested: windows, linux
Diffstat (limited to 'tools/h5diff')
-rw-r--r-- | tools/h5diff/h5diff_common.c | 8 | ||||
-rw-r--r-- | tools/h5diff/h5diff_main.c | 9 | ||||
-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 |
16 files changed, 29 insertions, 2 deletions
diff --git a/tools/h5diff/h5diff_common.c b/tools/h5diff/h5diff_common.c index 797052c..986a0c0 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:"; +static const char *s_opts = "hVrvqn:d:p:c"; static struct long_options l_opts[] = { { "help", no_arg, 'h' }, { "version", no_arg, 'V' }, @@ -41,6 +41,7 @@ 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' } }; @@ -94,6 +95,10 @@ 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; @@ -322,6 +327,7 @@ 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"); diff --git a/tools/h5diff/h5diff_main.c b/tools/h5diff/h5diff_main.c index eb85407..c383933 100644 --- a/tools/h5diff/h5diff_main.c +++ b/tools/h5diff/h5diff_main.c @@ -90,11 +90,18 @@ int main(int argc, const char *argv[]) ret = (nfound == 0 ? 0 : 1 ); + /* if graph difference return 1 for differences */ if ( options.contents == 0 ) ret = 1; - if(options.err_stat) + /* 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; + return ret; } diff --git a/tools/h5diff/testfiles/h5diff_10.txt b/tools/h5diff/testfiles/h5diff_10.txt index a74a37c..57d9882 100644 --- a/tools/h5diff/testfiles/h5diff_10.txt +++ b/tools/h5diff/testfiles/h5diff_10.txt @@ -9,6 +9,7 @@ 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 dcf14f7..33ba01f 100644 --- a/tools/h5diff/testfiles/h5diff_600.txt +++ b/tools/h5diff/testfiles/h5diff_600.txt @@ -9,6 +9,7 @@ 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 e274d88..a50cb54 100644 --- a/tools/h5diff/testfiles/h5diff_603.txt +++ b/tools/h5diff/testfiles/h5diff_603.txt @@ -10,6 +10,7 @@ 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 8232c38..517d0b6 100644 --- a/tools/h5diff/testfiles/h5diff_604.txt +++ b/tools/h5diff/testfiles/h5diff_604.txt @@ -10,6 +10,7 @@ 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 bce2118..3d887d7 100644 --- a/tools/h5diff/testfiles/h5diff_605.txt +++ b/tools/h5diff/testfiles/h5diff_605.txt @@ -10,6 +10,7 @@ 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 9a0a8cd..a1e46c1 100644 --- a/tools/h5diff/testfiles/h5diff_606.txt +++ b/tools/h5diff/testfiles/h5diff_606.txt @@ -10,6 +10,7 @@ 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 16baa7c..8436dee 100644 --- a/tools/h5diff/testfiles/h5diff_612.txt +++ b/tools/h5diff/testfiles/h5diff_612.txt @@ -10,6 +10,7 @@ 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 e57c320..7156b0a 100644 --- a/tools/h5diff/testfiles/h5diff_613.txt +++ b/tools/h5diff/testfiles/h5diff_613.txt @@ -10,6 +10,7 @@ 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 828d250..3acd663 100644 --- a/tools/h5diff/testfiles/h5diff_614.txt +++ b/tools/h5diff/testfiles/h5diff_614.txt @@ -10,6 +10,7 @@ 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 654a743..25b7f5d 100644 --- a/tools/h5diff/testfiles/h5diff_615.txt +++ b/tools/h5diff/testfiles/h5diff_615.txt @@ -10,6 +10,7 @@ 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 18acda6..54e4bf5 100644 --- a/tools/h5diff/testfiles/h5diff_621.txt +++ b/tools/h5diff/testfiles/h5diff_621.txt @@ -10,6 +10,7 @@ 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 7740b0a..b21deb9 100644 --- a/tools/h5diff/testfiles/h5diff_622.txt +++ b/tools/h5diff/testfiles/h5diff_622.txt @@ -10,6 +10,7 @@ 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 e238a6b..751d10f 100644 --- a/tools/h5diff/testfiles/h5diff_623.txt +++ b/tools/h5diff/testfiles/h5diff_623.txt @@ -10,6 +10,7 @@ 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 7100555..045991e 100644 --- a/tools/h5diff/testfiles/h5diff_624.txt +++ b/tools/h5diff/testfiles/h5diff_624.txt @@ -10,6 +10,7 @@ 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 |