summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SConstruct23
-rwxr-xr-xgpsfake8
2 files changed, 11 insertions, 20 deletions
diff --git a/SConstruct b/SConstruct
index f8fb8d79..019e2a35 100644
--- a/SConstruct
+++ b/SConstruct
@@ -462,7 +462,6 @@ if env.GetOption("clean") or env.GetOption("help"):
ncurseslibs = []
confdefs = []
manbuilder = False
- regress_driver_options = ''
htmlbuilder = False
else:
config = Configure(env, custom_tests = { 'CheckPKG' : CheckPKG,
@@ -725,20 +724,6 @@ size_t strlcpy(/*@out@*/char *dst, /*@in@*/const char *src, size_t size);
qt_network = env['libQgpsmm'] and config.CheckPKG('QtNetwork')
-
- # check if ptys are available for regression tests
- regress_driver_options = ''
- try:
- import pty
- pty.openpty()
- except Exception:
- pty_available = False
- else:
- pty_available = True
-
- if not pty_available:
- regress_driver_options = '-u'
-
env = config.Finish()
# Be explicit about what we're doing.
@@ -1517,7 +1502,7 @@ else:
if env['socket_export']:
# Regression-test the daemon
gps_regress = Utility("gps-regress", [gpsd, python_built_extensions],
- '$SRCDIR/regress-driver %s test/daemon/*.log' %(regress_driver_options,))
+ '$SRCDIR/regress-driver test/daemon/*.log')
# Build the regression tests for the daemon.
# Note: You'll have to do this whenever the default leap second
@@ -1525,7 +1510,7 @@ if env['socket_export']:
# that driver relies on the default until it gets the current
# offset from subframe data.
Utility('gps-makeregress', [gpsd, python_built_extensions],
- '$SRCDIR/regress-driver %s -b test/daemon/*.log' %(regress_driver_options,))
+ '$SRCDIR/regress-driver -b test/daemon/*.log')
# To build an individual test for a load named foo.log, put it in
# test/daemon and do this:
@@ -1639,13 +1624,13 @@ time_regress = Utility('time-regress', [test_mkgmtime], [
# Regression test the unpacking code in libgps
unpack_regress = Utility('unpack-regress', [test_libgps], [
'@echo "Testing the client-library sentence decoder..."',
- '$SRCDIR/regress-driver %s -c $SRCDIR/test/clientlib/*.log' %(regress_driver_options,),
+ '$SRCDIR/regress-driver -c $SRCDIR/test/clientlib/*.log',
])
# Build the regression test for the sentence unpacker
Utility('unpack-makeregress', [test_libgps], [
'@echo "Rebuilding the client sentence-unpacker tests..."',
- '$SRCDIR/regress-driver %s -c -b $SRCDIR/test/clientlib/*.log' %(regress_driver_options,)
+ '$SRCDIR/regress-driver -c -b $SRCDIR/test/clientlib/*.log'
])
# Unit-test the JSON parsing
diff --git a/gpsfake b/gpsfake
index 628ec0f1..ece89554 100755
--- a/gpsfake
+++ b/gpsfake
@@ -9,7 +9,7 @@
# This file is Copyright (c) 2010 by the GPSD project
# BSD terms apply: see the file COPYING in the distribution root for details.
-import sys, os, time, getopt, socket, random
+import sys, os, time, getopt, socket, random, pty
import gps, gps.fake as gpsfake # The "as" pacifies pychecker
class Baton:
@@ -157,6 +157,12 @@ if __name__ == '__main__':
sys.stderr.write("usage: gpsfake [-h] [-l] [-m monitor] [--D debug] [-o options] [-p] [-s speed] [-c cycle] [-b] logfile\n")
raise SystemExit,0
+ try:
+ pty.openpty()
+ except Exception:
+ print >>sys.stderr, "gpsfake: ptys not available, falling back to UDP."
+ udp = True
+
if not arguments:
print >>sys.stderr, "gpsfake: requires at least one logfile argument."
raise SystemExit, 1