summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-04-20 19:55:28 -0400
committerEric S. Raymond <esr@thyrsus.com>2010-04-20 19:55:28 -0400
commit1f08f7a8fb4885aeb072b90995d4e8f04557c5f1 (patch)
treeb3200c16a75075ea815699486ace7163f4d8e4a1
parent47907f6581338435c8a32e90b6b47fc993b198ee (diff)
downloadgpsd-1f08f7a8fb4885aeb072b90995d4e8f04557c5f1.tar.gz
regress-driver reports elapsed time.
-rwxr-xr-xregress-driver23
1 files changed, 19 insertions, 4 deletions
diff --git a/regress-driver b/regress-driver
index de94f64f..4c1c1adb 100755
--- a/regress-driver
+++ b/regress-driver
@@ -4,6 +4,10 @@
# makefile before we regrouped the regression tests by stable and unstable
# drivers.
+# Requires GNU date extensions
+# Should return an empty blank string if tose are not present.
+starttime=`date +"%s.%N" 2>/dev/null`
+
# We need to have the build directory in $PATH to find the new gpsd
# in case there is one in $PATH somewhere else in the system.
if [ "`dirname $0`" = "." ]; then
@@ -96,10 +100,10 @@ case $mode in
done;
if test $errors -gt 0; then
echo "Regression test FAILED: $errors errors in $total tests total ($notfound not found).";
- exit 1;
+ status=1;
else
echo "Regression test successful: no errors in $total tests ($notfound not found).";
- exit 0;
+ status=0;
fi
;;
superraw)
@@ -119,7 +123,7 @@ case $mode in
clientlib) libgps -b <${f} >${f}.chk ;;
esac
done
- exit 0
+ status=0
;;
view)
echo "Viewing..." >&2
@@ -129,6 +133,17 @@ case $mode in
clientlib) libgps -b <${f} ;;
esac
done
- exit 0
+ status=0
;;
esac
+
+# See starttime above
+endtime=`date +"%s.%N" 2>/dev/null`
+
+if [ "$starttime" -a "$endtime" ]
+then
+ echo -n "Elapsed time: "
+ echo "scale=2; ${endtime} - ${starttime}" | bc
+fi
+
+exit $status