[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master a905d19: Run unit tests in parallel
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master a905d19: Run unit tests in parallel |
Date: |
Fri, 6 Jan 2017 15:29:10 +0000 (UTC) |
branch: master
commit a905d1969eac34f599c7b6ef4f3856a606d33be1
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>
Run unit tests in parallel
See:
http://lists.nongnu.org/archive/html/lmi/2017-01/msg00016.html
---
workhorse.make | 21 +++++++++++++++------
1 file changed, 15 insertions(+), 6 deletions(-)
diff --git a/workhorse.make b/workhorse.make
index 2d45414..d4f28a4 100644
--- a/workhorse.make
+++ b/workhorse.make
@@ -1109,15 +1109,20 @@ configurable_settings.xml:
# Unit tests.
-# Use '--jobs=1' to force tests to run in series: running them in
-# parallel would scramble their output.
-#
-# Ignore the "disabling jobserver mode" warning.
+# Use '--output-sync=recurse' so that the output of each test is
+# written as a separate block even though the tests are run in
+# parallel. Each block is written when its test ends, so the order
+# of the blocks is indeterminate. When tests are run in parallel,
+# their internal timings may be less accurate because of competition
+# for resources other than CPUs. Tests can of course be run in series
+# simply by not specifying '--jobs=' on the command line; that is
+# advisable if output is written to logs which are to be compared,
+# e.g., to determine whether timings have changed.
.PHONY: unit_tests
unit_tests: $(test_data)
@-$(MAKE) --file=$(this_makefile) build_unit_tests
- @ $(MAKE) --file=$(this_makefile) --jobs=1 run_unit_tests
+ @ $(MAKE) --file=$(this_makefile) --output-sync=recurse run_unit_tests
.PHONY: build_unit_tests
build_unit_tests: configurable_settings.xml $(unit_test_targets)
@@ -1145,7 +1150,11 @@ cli_subtargets := cli_tests_init cli_selftest
$(addprefix cli_test-,$(test_data)
$(cli_subtargets): $(data_dir)/configurable_settings.xml
# Use '--jobs=1' to force tests to run in series: running them in
-# parallel would scramble their output.
+# parallel would scramble their output. Using '--output-sync=recurse'
+# would prevent scrambling, but would not preserve the order of the
+# tests; that alternative is not chosen because a uniform order makes
+# visual inspection a little easier, while the tests are so fast that
+# parallelism affords no palpable advantage.
#
# Ignore the "disabling jobserver mode" warning.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [lmi-commits] [lmi] master a905d19: Run unit tests in parallel,
Greg Chicares <=