Skip to contentSkip to conversation

tests: Add option to print diff output of failed tests

PATCH Applied Lukas Czerner 2 participants 2 messages Sep 2, 2021 – Oct 1, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: Add option to print diff output of failed tests

Add variable $PRINT_FAILED which when set will print the diff output of a failed test.

---
 tests/test_one.in | 4 ++++
 1 file changed, 4 insertions(+)
tests/test_one.in +4 -0
index 5d7607ad..78499ad0 100644
@@ -82,6 +82,10 @@ if [ $elapsed -gt 60 -a ! -f $test_dir/is_slow_test ]; then
 	echo "$test_name:  consider adding $test_dir/is_slow_test"
 fi
 
+if [ -n "$PRINT_FAILED" -a -f $test_name.failed ] ; then
+	cat $test_name.failed
+fi
+
 if [ "$SKIP_UNLINK" != "true" ] ; then
 	rm -f $TMPFILE
 fi
Signature · 1 line
2.31.1
#1 lore raw
Quoted 4 lines · Lukas Czerner

Add variable $PRINT_FAILED which when set will print the diff output of a failed test.

Applied, thanks!

[1/1] tests: Add option to print diff output of failed tests

      commit: e99e05864464001864b5b17eee2e9a309a7878a9

Best regards,

Signature · 1 line
Theodore Ts'o <[email protected]>