Skip to contentSkip to conversation

xfstests: Change the diff output of failed tests

PATCH In review Lukas Czerner 1 participant 2 messages Apr 10, 2012 – Apr 19, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstests: Change the diff output of failed tests

Currently the entire diff is printed to the stdout in the case that the test output template differs from the actual test run. However in some cases the diff can be _very_ long. This commit changes it so that we print only first 10 lines of the diff.

Also indent the diff output from the left by four spaces for better output readability.

---
 check |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
check +5 -1
index f792009..c5d67a5 100755
@@ -286,7 +286,11 @@ do
 		else
 		    echo " - output mismatch (see $seq.out.bad)"
 		    mv $tmp.out $seq.out.bad
-		    $diff $seq.out $seq.out.bad
+		    $diff $seq.out $seq.out.bad | head -n 10 | \
+			sed -e 's/^\(.\)/    \1/'
+		    echo "     ..."
+		    echo "     (Run '$diff $seq.out $seq.out.bad' to see the" \
+			 "entire diff)"
 		    err=true
 		fi
 	    fi
Signature · 6 lines
1.7.4.4

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
#1 lore raw
Quoted 7 lines · Lukas Czerner

Currently the entire diff is printed to the stdout in the case that the test output template differs from the actual test run. However in some cases the diff can be _very_ long. This commit changes it so that we print only first 10 lines of the diff.

Also indent the diff output from the left by four spaces for better output readability.

ping

Quoted 24 lines
---
 check |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
check +5 -1
index f792009..c5d67a5 100755
@@ -286,7 +286,11 @@ do
 		else
 		    echo " - output mismatch (see $seq.out.bad)"
 		    mv $tmp.out $seq.out.bad
-		    $diff $seq.out $seq.out.bad
+		    $diff $seq.out $seq.out.bad | head -n 10 | \
+			sed -e 's/^\(.\)/    \1/'
+		    echo "     ..."
+		    echo "     (Run '$diff $seq.out $seq.out.bad' to see the" \
+			 "entire diff)"
 		    err=true
 		fi
 	    fi
Signature · 4 lines
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs