diff options
author | David Sterba <dsterba@suse.cz> | 2013-01-23 11:14:33 +0000 |
---|---|---|
committer | Rich Johnston <rjohnston@sgi.com> | 2013-03-05 14:42:36 -0600 |
commit | 6f000a96dc21c81b167038f3bccc0dd15ecbb313 (patch) | |
tree | 38475fb1f23490d70f67444ecb20d6f42f93308a /check | |
parent | 24fef70ef3fa0be047264b7a40b0bcf86533ec22 (diff) | |
download | xfstests-dev-6f000a96dc21c81b167038f3bccc0dd15ecbb313.tar.gz |
xfstests: make length of diff output configurable
In commit 11c1d79414e2571 "xfstests: Change the diff output of failed
tests", the diff output of a failed test was hardcoded to 10 lines to
avoid overly long output and user can get the full output by manually
running the diff. However this is not always possible and convenient,
eg. in repeated automated tests where the required information is lost
after the test round finished. Then the caputred logs do not contain
enough informatin for analysis.
Introduce the DIFF_LENGTH env variable to tune the diff size, keeping it
10 as deafult and 0 to disable the limit.
Signed-off-by: David Sterba <dsterba@suse.cz>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Rich Johnston <rjohnston@sgi.com>
Diffstat (limited to 'check')
-rwxr-xr-x | check | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -30,6 +30,8 @@ notrun="" interrupt=true export QA_CHECK_FS=${QA_CHECK_FS:=true} +# number of diff lines from a failed test, 0 for whole output +export DIFF_LENGTH=${DIFF_LENGTH:=10} # by default don't output timestamps timestamp=${TIMESTAMP:=false} @@ -287,7 +289,12 @@ do else echo " - output mismatch (see $seq.out.bad)" mv $tmp.out $seq.out.bad - $diff $seq.out $seq.out.bad | head -n 10 | \ + $diff $seq.out $seq.out.bad | { + if test "$DIFF_LENGTH" -le 0; then + cat + else + head -n "$DIFF_LENGTH" + fi; } | \ sed -e 's/^\(.\)/ \1/' echo " ..." echo " (Run '$diff $seq.out $seq.out.bad' to see the" \ |