From 881bc0a983bc1c407d41df29c3dfb7d901884932 Mon Sep 17 00:00:00 2001 From: Michael Buesch Date: Mon, 5 Apr 2010 22:32:04 +0200 Subject: testsuite: Option for verbose output Signed-off-by: Michael Buesch --- tests/run-tests.sh | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/run-tests.sh b/tests/run-tests.sh index 9a31220..9a92eb7 100755 --- a/tests/run-tests.sh +++ b/tests/run-tests.sh @@ -47,11 +47,17 @@ function toprammer { local args="$@" local logfile="$tmpdir/toprammer.log" + echo " toprammer $args" - $basedir/../toprammer $args >$logfile 2>&1 - if [ $? -ne 0 ]; then - [ -r "$logfile" ] && cat "$logfile" - die "toprammer $args <<>>" + if [ $verbose -eq 0 ]; then + $basedir/../toprammer $args >$logfile 2>&1 + if [ $? -ne 0 ]; then + [ -r "$logfile" ] && cat "$logfile" + die "toprammer $args <<>>" + fi + else + $basedir/../toprammer $args -V2 + [ $? -eq 0 ] || die "toprammer $args <<>>" fi } @@ -132,6 +138,7 @@ function usage echo echo "Options:" echo " -h|--help Show this help text" + echo " -V|--verbose Be verbose" echo echo "If the optional scriptpath is specified, only that testscript" echo "is executed. The scriptpath is DEVICE/TESTSCRIPT. Example:" @@ -142,11 +149,17 @@ function usage # Parse commandline nr_scriptpaths=0 +verbose=0 while [ $# -gt 0 ]; do if [ "$1" = "-h" -o "$1" = "--help" ]; then usage exit 0 fi + if [ "$1" = "-V" -o "$1" = "--verbose" ]; then + verbose=1 + shift + continue + fi scriptpaths[nr_scriptpaths]="$1" let nr_scriptpaths=nr_scriptpaths+1 shift -- cgit v1.2.3