summaryrefslogtreecommitdiff
path: root/gps
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-02-14 07:58:32 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-02-14 07:58:32 -0500
commit55af5afa11e65b4baddce790233117e74cb9633b (patch)
treea543b43e752c7a057b9a9d37916642605be1573b /gps
parent2d427766de94193023f9ffef05e5dfff1565f557 (diff)
downloadgpsd-55af5afa11e65b4baddce790233117e74cb9633b.tar.gz
Allow setting WRITE_PAD from the environment.
Diffstat (limited to 'gps')
-rw-r--r--gps/fake.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/gps/fake.py b/gps/fake.py
index 9452ce9b..cb1b319f 100644
--- a/gps/fake.py
+++ b/gps/fake.py
@@ -83,8 +83,7 @@ import packet as sniffer
# buffers in the pty layer or gpsd itself. Values smaller than the
# system timer tick don't make any difference here.
-# Field reports on minima:
-#
+# Can be set from an environment variable.
# examples are "# sys.platform platform.platform()"
@@ -102,6 +101,10 @@ elif sys.platform.startswith("darwin"):
else:
WRITE_PAD = 0.004
+# Make it easier to test pad values
+if os.getenv("WRITE_PAD"):
+ WRITE_PAD = os.getenv("WRITE_PAD")
+
# Additional delays in slow mode
WRITE_PAD_SLOWDOWN = 0.01
@@ -627,7 +630,7 @@ class TestSession:
chosen = self.choose()
if isinstance(chosen, FakeGPS):
if chosen.exhausted and (time.time() - chosen.exhausted > TEST_TIMEOUT) and chosen.byname in self.fakegpslist:
- sys.stderr.write("Test timed out: increase WRITE_PAD = %s" % WRITE_PAD)
+ sys.stderr.write("Test timed out: increase WRITE_PAD = %s\n" % WRITE_PAD)
raise SystemExit, 1
elif not chosen.go_predicate(chosen.index, chosen):
if chosen.exhausted == 0: