summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2014-04-23 15:53:41 +0000
committerAnand Avati <avati@redhat.com>2014-04-23 20:49:13 -0700
commit9c13471b109587a639662fc690384285bee02bc6 (patch)
treebb03f203d96178934f2ef25cefa7acc91a7eb3d0 /tests
parent00e247ee44067f2b3e7ca5f7e6dc2f7934c97181 (diff)
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 <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/7537 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/include.rc5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/include.rc b/tests/include.rc
index 452e6d7ca2c..35b0ddd5d63 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