summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorFred Wright <fw@fwright.net>2016-02-28 19:39:12 -0800
committerJon Schlueter <jon.schlueter@gmail.com>2016-02-29 07:22:04 -0500
commitf51c4031ee41087840e9f14a1315e101bbea59f1 (patch)
tree61422f1890bb28af4869281ca4f902e5ec648a86 /SConstruct
parent89ea20912d19ef83fc615a5f31914b1e525e73c6 (diff)
downloadgpsd-f51c4031ee41087840e9f14a1315e101bbea59f1.tar.gz
Parallelizes gps-regress and gps-makeregress.
This change turns each of these tests into a set of individual single-case targets, so that they can be run in parallel. It still uses regress-driver, but with a single logfile for each instance. It uses the new -q option to reduce the verbosity when run this way. The "herald" using gpsfake -T is turned into a separate target that's a dependency of the others, so that it always runs first. Because consuming a large number of PTYs would be antisocial (not to mention possibly not working), it uses UDP mode. TCP mode would also work, but is slightly slower (albeit negligibly except on FreeBSD). Since the output format is deficient in this mode (including not having the summary at the end), it runs the old way whenever multiple jobs aren't enabled. But the single-case tests are still generated, to permit running single cases (or sets of cases) by name. It might be more conservative not to parallelize gps-makeregress, but one can get that effect simply by not enabling multiple jobs. This change also removes an obsolete comment about clearing the SHM segments before the run. TESTED: Ran gps-regress and gps-makeregress, in both serial and parallel modes, on three versions of OSX, as well as Linux, FreeBSD, and OpenBSD.
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct38
1 files changed, 29 insertions, 9 deletions
diff --git a/SConstruct b/SConstruct
index 202401a0..c2647cf2 100644
--- a/SConstruct
+++ b/SConstruct
@@ -1537,23 +1537,43 @@ if not env['socket_export'] or not env['python']:
announce("GPS regression tests suppressed because socket_export or python is off.")
gps_regress = None
else:
- # Regression-test the daemon. But first:
- # (1) Clear GPSD's SHM segment in case a previous abort didn't. This
- # prevents spurious error messages.
- # (2) Dump the platform and its delay parameters.
- # The ":;" in this production and the next one forestalls an attempt by
+ # Regression-test the daemon.
+ # But first dump the platform and its delay parameters.
+ # The ":;" in this production and the later one forestalls an attempt by
# SCons to install up to date versions of gpsfake and gpsctl if it can
# find older versions of them in a directory on your $PATH.
- gps_regress = Utility("gps-regress", [gpsd, gpsctl, python_built_extensions],
- ':; $SRCDIR/gpsfake -T; $SRCDIR/regress-driver $REGRESSOPTS test/daemon/*.log')
+ gps_herald = Utility('gps-herald', [gpsd, gpsctl, python_built_extensions],
+ ':; $SRCDIR/gpsfake -T')
+ gps_log_pattern = os.path.join('test', 'daemon', '*.log')
+ gps_logs = glob.glob(gps_log_pattern)
+ gps_names = [os.path.split(x)[-1][:-4] for x in gps_logs]
+ gps_tests = []
+ for gps_name, gps_log in zip(gps_names, gps_logs):
+ gps_tests.append(Utility('gps-regress-' + gps_name, gps_herald,
+ '$SRCDIR/regress-driver -qu $REGRESSOPTS '
+ + gps_log))
+ if GetOption('num_jobs') <= 1:
+ gps_regress = Utility('gps-regress', gps_herald,
+ '$SRCDIR/regress-driver $REGRESSOPTS %s'
+ % gps_log_pattern)
+ else:
+ gps_regress = env.Alias('gps-regress', gps_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;
# that driver relies on the default until it gets the current
# offset from subframe data.
- Utility('gps-makeregress', [gpsd, gpsctl, python_built_extensions],
- ':; $SRCDIR/gpsfake -T; $SRCDIR/regress-driver -b $REGRESSOPTS test/daemon/*.log')
+ gps_rebuilds = []
+ for gps_name, gps_log in zip(gps_names, gps_logs):
+ gps_rebuilds.append(Utility('gps-makeregress-' + gps_name, gps_herald,
+ '$SRCDIR/regress-driver -bqu $REGRESSOPTS '
+ + gps_log))
+ if GetOption('num_jobs') <= 1:
+ Utility('gps-makeregress', gps_herald,
+ '$SRCDIR/regress-driver -b $REGRESSOPTS %s' % gps_log_pattern)
+ else:
+ env.Alias('gps-makeregress', gps_rebuilds)
# To build an individual test for a load named foo.log, put it in
# test/daemon and do this: