diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-11-05 15:25:02 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-11-05 15:26:21 -0500 |
commit | bd0ffb3d68a514a7430973b295c4e0c2ec706184 (patch) | |
tree | 59b5029a17dd298a7c249e4f15d17cc4bd3b90c7 | |
parent | 9b6cbff43b557981c1f52d70c12b36164dbf8089 (diff) | |
download | gpsd-bd0ffb3d68a514a7430973b295c4e0c2ec706184.tar.gz |
Test machinery improvements. raw-regress is now only partially broken.
-rwxr-xr-x | devtools/striplog | 10 | ||||
-rwxr-xr-x | gpsfake | 3 | ||||
-rwxr-xr-x | regress-driver | 2 |
3 files changed, 12 insertions, 3 deletions
diff --git a/devtools/striplog b/devtools/striplog index f3e21a48..d1c9fe11 100755 --- a/devtools/striplog +++ b/devtools/striplog @@ -11,12 +11,15 @@ import getopt, sys secondline = firstline = False -(options, arguments) = getopt.getopt(sys.argv[1:], "12") +stripval = 0 +(options, arguments) = getopt.getopt(sys.argv[1:], "12n:") for (switch, val) in options: if (switch == '-1'): firstline = True if (switch == '-2'): secondline = True + if (switch == '-n'): + stripval = int(val) try: if firstline: @@ -24,6 +27,9 @@ try: elif secondline: sys.stdin.readline() sys.stdin.readline() + elif stripval: + for _dummy in range(stripval): + sys.stdin.readline() else: while True: line = sys.stdin.readline() @@ -32,5 +38,5 @@ try: sys.stdout.write(line) sys.stdout.write(sys.stdin.read()) -except KeyBoardInterrupt: +except KeyboardInterrupt: pass @@ -215,6 +215,9 @@ if __name__ == '__main__': except gps.client.json_error, e: sys.stderr.write("gpsfake: JSON error on line %s is %s.\n" % (`e.data`, e.explanation)) raise SystemExit, 1 + except KeyboardInterrupt: + sys.stderr.write("gpsfake: aborted\n")) + raise SystemExit, 1 finally: test.cleanup(); diff --git a/regress-driver b/regress-driver index 862e52cd..37b6e2c4 100755 --- a/regress-driver +++ b/regress-driver @@ -158,7 +158,7 @@ case $mode in echo "Testing super-raw mode..." >&2 for f in $*; do ${PYTHON} ${GPSD_HOME}/gpsfake -s 38400 -1 -p $opts -r '?WATCH={"enable":true,"raw":2}' $opts ${f} \ - | ./devtools/striplog -2 >${TMP}/test1-$$.chk; + | ./devtools/striplog -n 4 >${TMP}/test1-$$.chk; ./devtools/striplog <${f} >${TMP}/test2-$$.chk; cmp ${TMP}/test[12]-$$.chk; done; rm ${TMP}/test[12]-$$.chk |