summaryrefslogtreecommitdiff
path: root/regress-driver
diff options
context:
space:
mode:
authorFred Wright <fw@fwright.net>2016-02-28 19:39:11 -0800
committerJon Schlueter <jon.schlueter@gmail.com>2016-02-29 07:19:16 -0500
commit89ea20912d19ef83fc615a5f31914b1e525e73c6 (patch)
tree835ed96802bc63434105d790d950489699570c2c /regress-driver
parent01bc4db1bda42e980fbc4ee1885e48e408939829 (diff)
downloadgpsd-89ea20912d19ef83fc615a5f31914b1e525e73c6.tar.gz
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 <jon.schlueter@gmail.com>
Diffstat (limited to 'regress-driver')
-rwxr-xr-xregress-driver13
1 files changed, 8 insertions, 5 deletions
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 <opt> - 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:" \