summaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorGreg Troxel <gdt@ir.bbn.com>2010-03-31 11:07:23 -0400
committerGreg Troxel <gdt@ir.bbn.com>2010-03-31 11:10:22 -0400
commiteef5a2b8ab46158837fbc970187a7eed9ea79f21 (patch)
treeb6d9b1d1e6d031ce656c31bcc0cb446d945efa43 /Makefile.am
parent4058914ac83a0b1cf9904ec8cfd9fc9ac0423315 (diff)
downloadgpsd-eef5a2b8ab46158837fbc970187a7eed9ea79f21.tar.gz
Change make check to use a test program.
automake supports test programs, not test make targets. Add a 1-line script "do-tests" to invoke make with our targets, thus conforming to the automake way. This avoids the duplicate test problem in our previous workaround, which first had the test targets as a dependency (running the tests) and then invoked make to actually run them.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am21
1 files changed, 15 insertions, 6 deletions
diff --git a/Makefile.am b/Makefile.am
index 682e9395..b3ce5642 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -531,6 +531,17 @@ version:
# apparently increases the accuracy of computation in a way that affects
# the low-order digits of the track field in the O response.
+# Our regression tests are make targets, while automake expects
+# programs. Thus, our approach is to construct the test
+# infrastructure our way, with make targets, and to have one TEST from
+# automake's viewpoint: a trivial shell script to invoke make with our
+# top-level regression target.
+
+# One might think that using TESTS_ENVIRONMENT=$(MAKE) would work
+# around this, but because the generated rule (check-TESTS) both
+# depends on each TEST as well as invokes it (with TESTS_ENVIRONMENT)
+# the entire list of tests is run twice.
+
# Regression-test the daemon
gps-regress: gpsd
$(srcdir)/regress-driver -t $(srcdir)/test/daemon/*.log
@@ -635,12 +646,10 @@ bits-regress: test_bits
testregress: gps-regress rtcm-regress aivdm-regress packet-regress time-regress unpack-regress json-regress
@echo "Regressions complete."
-# automake has support for running programs, but not make targets.
-# However, TESTS_ENVIRONMENT can be used to specify an interpreter,
-# which we use to re-invoke make. The order of the targets in TESTS
-# defines the sequence order of testing.
-TESTS_ENVIRONMENT = $(MAKE)
-TESTS = gps-regress rtcm-regress aivdm-regress packet-regress time-regress unpack-regress json-regress
+# do-tests is a shell script that invokes make with target testregress.
+# This works around automake's lack of support for make targets as tests.
+TESTS_ENVIRONMENT = MAKE=$(MAKE)
+TESTS = do-tests
# Productions for setting up and performing udev tests.
#