From 9c13471b109587a639662fc690384285bee02bc6 Mon Sep 17 00:00:00 2001 From: Jeff Darcy Date: Wed, 23 Apr 2014 15:53:41 +0000 Subject: tests: print info about failed tests It's a bit frustrating to run a test normally (e.g. during development), see a failure, and then have to re-run it with DEBUG=1 to see what actually failed. This tiny patch prints out the command line of the test that just failed, even if DEBUG=0 (in fact only if DEBUG=0 since otherwise it would be redundant). Change-Id: Icffa096d0bcc6f35176f0e47d9d1bc538698ca2c Signed-off-by: Jeff Darcy Reviewed-on: http://review.gluster.org/7537 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- tests/include.rc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/include.rc') diff --git a/tests/include.rc b/tests/include.rc index 452e6d7ca..35b0ddd5d 100644 --- a/tests/include.rc +++ b/tests/include.rc @@ -40,6 +40,7 @@ function test_header() { dbg "========================="; dbg "TEST $t (line $TESTLINE): $*"; + saved_cmd="$*" } @@ -52,6 +53,10 @@ function test_footer() echo "ok $t"; else echo "not ok $t $err"; + # With DEBUG, this was already printed out, so skip it. + if [ x"$DEBUG" = x"0" ]; then + echo "FAILED COMMAND: $saved_cmd" + fi if [ "$EXIT_EARLY" = "1" ]; then exit $RET fi -- cgit