From 89ea20912d19ef83fc615a5f31914b1e525e73c6 Mon Sep 17 00:00:00 2001 From: Fred Wright Date: Sun, 28 Feb 2016 19:39:11 -0800 Subject: Adds -q (quiet) option to regress-driver. This allows reducing the verbosity when running multiple single-case instances of regress-driver (e.g., for parallelism). It is not the same as redirecting stderr, since the "Processing" messages also go to stderr, and are useful in this case. TESTED: Ran regress, build, and view modes, with and without -q, and verified expected output. Signed-off-by: Jon Schlueter --- regress-driver | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'regress-driver') diff --git a/regress-driver b/regress-driver index 34108479..62f1e16d 100755 --- a/regress-driver +++ b/regress-driver @@ -48,7 +48,8 @@ opts="" logfile="" help="0" baton=false -while getopts cl:sStbuvo:h opt +quiet=false +while getopts cl:sStbuvo:qh opt do case $opt in c) testing=clientlib ;; # Can be 'daemon' @@ -60,6 +61,7 @@ do u) opts="$opts -u" ;; # Force UDP v) mode=view ;; # View result of generating a check file o) opts="$opts $OPTARG" ;; # Pass options to gpsfake + q) quiet=true ;; # Suppress header/trailer messages h) help="1" ;; esac done @@ -80,6 +82,7 @@ then echo "-u - Force UDP" echo "-v - view result of generating a check file" echo "-o - Pass options to gpsfake" + echo "-q - Suppress header/trailer messages" echo exit 0 @@ -119,7 +122,7 @@ fi case $mode in regress|slowregress) - echo "Testing the $testing..." >&2 + [ $quiet = true ] || echo "Testing the $testing..." >&2 errors=0; total=0; notfound=0;error_list=""; for f in $*; do if [ -r $f.chk ] @@ -174,7 +177,7 @@ case $mode in fi ;; build) - echo "Rebuilding $testing regressions..." >&2 + [ $quiet = true ] || echo "Rebuilding $testing regressions..." >&2 for f in $*; do case $testing in daemon) ${PYTHON} ${GPSD_HOME}/gpsfake -s 38400 -1 -p $opts ${f} | ${GPSFILTER} >${f}.chk;; @@ -184,7 +187,7 @@ case $mode in status=0 ;; view) - echo "Viewing..." >&2 + [ $quiet = true ] || echo "Viewing..." >&2 for f in $*; do case $testing in daemon) ${PYTHON} ${GPSD_HOME}/gpsfake -s 38400 -1 -p $opts ${f} | ${GPSFILTER} ;; @@ -198,7 +201,7 @@ esac # See starttime above endtime=`date +"%s * 1000000000 + %N" | sed '/+ N/s///' 2>/dev/null` -if [ "$starttime" -a "$endtime" ] +if [ $quiet = false ] && [ "$starttime" -a "$endtime" ] then # Avoid using -n here since some shells don't support it. echo "Elapsed time:" \ -- cgit v1.2.1