summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2007-12-10 23:50:51 +0000
committerEric S. Raymond <esr@thyrsus.com>2007-12-10 23:50:51 +0000
commitf5d8c519a4ed0acfda30530e0e786c83530b2d74 (patch)
tree5b4fa023c03c7878b7d90792f947ee7d8fc15ac3
parent86247dcf6a2f313625d1f8800c1cc4baa2f4e354 (diff)
downloadgpsd-f5d8c519a4ed0acfda30530e0e786c83530b2d74.tar.gz
Portability tweaks.
-rw-r--r--Makefile.am8
-rw-r--r--gpsfake.py19
-rwxr-xr-xregress-driver2
3 files changed, 16 insertions, 13 deletions
diff --git a/Makefile.am b/Makefile.am
index 18afb9f5..7388d87f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -379,11 +379,11 @@ gps-regress: gpsd
# dumped through the daemon running in R=2 mode. (This test is not
# included in the normal regressions.)
raw-regress:
- regress-driver -r
+ ./regress-driver -r
# Build the regression tests for the daemon.
gps-makeregress: gpsd
- regress-driver -b $(srcdir)/test/stable/*.log
+ ./regress-driver -b $(srcdir)/test/stable/*.log
# Regression-test the RTCM decoder.
rtcm-regress: rtcmdecode
@@ -429,8 +429,8 @@ testregress: gps-regress rtcm-regress packet-regress undump-regress
#
unstable-regress: gpsd
- regress-driver -t $(srcdir)/test/unstable/*.log
+ ./regress-driver -t $(srcdir)/test/unstable/*.log
unstable-makeregress: gpsd
- regress-driver -b $(srcdir)/test/unstable/*.log
+ ./regress-driver -b $(srcdir)/test/unstable/*.log
diff --git a/gpsfake.py b/gpsfake.py
index f602b798..811d1b06 100644
--- a/gpsfake.py
+++ b/gpsfake.py
@@ -71,6 +71,15 @@ import sys, os, time, signal, pty, termios # fcntl, array, struct
import string, exceptions, threading, socket, commands
import gps
+# Define a per-character delay on writes so we won't spam the buffers
+# in the pty layer or gpsd itself. The magic number here has to be
+# derived from observation. If it's too high you'll slow the tests
+# down a lot. If it's too low you'll get random spurious regression
+# failures that usually look like lines missing from the end of the
+# test output relative to the check file. This number might have to
+# be adusted upward on faster machines.
+WRITE_PAD = 15.0
+
class TestLoadError(exceptions.Exception):
def __init__(self, msg):
self.msg = msg
@@ -295,13 +304,7 @@ class FakeGPS:
"Feed a line from the contents of the GPS log to the daemon."
line = self.testload.sentences[self.index % len(self.testload.sentences)]
os.write(self.master_fd, line)
- # Delay so we won't spam the buffers in the pty layer or gpsd itself.
- # The magic number here has to be derived from observation. If it's
- # too high you'll slow the tests down a lot. If it's too low you'll
- # get random spurious regression failures that usually look like
- # lines missing from the end of the test output relative to the
- # check file. It might have to be ajusted upward on faster machines.
- time.sleep((15.0 * len(line)) / self.speed)
+ time.sleep((WRITE_PAD * len(line)) / self.speed)
self.index += 1
class DaemonError(exceptions.Exception):
@@ -322,7 +325,7 @@ class DaemonInstance:
"Spawn a daemon instance."
# The -b option to suppress hanging on probe returns is needed to cope
# with OpenBSD (and possibly other non-Linux systems) that don't support
- # anything we can use to implement the feed method
+ # anything we can use to implement the FakeGPS.read() method
self.spawncmd = "gpsd -b -N -S %s -F %s -P %s %s" % (port, self.control_socket, self.pidfile, options)
if prefix:
self.spawncmd = prefix + " " + self.spawncmd.strip()
diff --git a/regress-driver b/regress-driver
index 5c65ee92..16defd72 100755
--- a/regress-driver
+++ b/regress-driver
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
#
# The regression-test driver script. This used to be explicit in the
# makefile before we regrouped the regression tests by stable and unstable