[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gpsd-dev] [PATCH 2/4] Improves coverage testing of fake.py.
From: |
Fred Wright |
Subject: |
[gpsd-dev] [PATCH 2/4] Improves coverage testing of fake.py. |
Date: |
Tue, 15 Mar 2016 16:52:10 -0700 |
This adds three "regression" tests which run passthrough.log in all
three transport modes, for more complete coverage in fake.py. The
target for all three is 'gpsfake-tests'.
Although the original motivation for 'test-nondaemon' was to exclude
slow-running tests, and the gpsfake tests are fairly quick, it would
be misleading to classify them as "nondaemon". So a new 'test-quick'
target is added which includes these but not the full set of
regression tests.
TESTED:
Ran all relevant test targets, with and without coveraging.
---
SConstruct | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/SConstruct b/SConstruct
index 32d7e1f..f464910 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1571,6 +1571,7 @@ else:
if not env['socket_export'] or not env['python']:
announce("GPS regression tests suppressed because socket_export or python
is off.")
gps_regress = None
+ gpsfake_tests = None
else:
# Regression-test the daemon.
# But first dump the platform and its delay parameters.
@@ -1594,6 +1595,15 @@ else:
else:
gps_regress = env.Alias('gps-regress', gps_tests)
+ # Run the passthrough log in all transport modes for better coverage
+ gpsfake_log = os.path.join('test', 'daemon', 'passthrough.log')
+ gpsfake_tests = []
+ for name, opts in [['pty', ''], ['udp', '-u'], ['tcp', '-o -t']]:
+ gpsfake_tests.append(Utility('gpsfake-' + name, gps_herald,
+ '$SRCDIR/regress-driver -q %s %s'
+ % (opts, gpsfake_log)))
+ env.Alias('gpsfake-tests', gpsfake_tests)
+
# Build the regression tests for the daemon.
# Note: You'll have to do this whenever the default leap second
# changes in timebase.h. The problem is in the SiRF tests;
@@ -1802,9 +1812,11 @@ test_nondaemon = [
timespec_regress,
]
-test_noclean = test_nondaemon + [gps_regress]
+test_quick = test_nondaemon + [gpsfake_tests]
+test_noclean = test_quick + [gps_regress]
env.Alias('test-nondaemon', test_nondaemon)
+env.Alias('test-quick', test_quick)
check = env.Alias('check', test_noclean)
env.Alias('testregress', check)
env.Alias('build-tests', testprogs)
--
2.7.3