aboutsummaryrefslogtreecommitdiff
path: root/Makeconfig
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2014-03-14 21:02:40 +0000
committerJoseph Myers <joseph@codesourcery.com>2014-03-14 21:02:40 +0000
commitd6fe5e582d4e4bb339f55bc6369eaca0c52e527c (patch)
treed6c6a990fd448691da617bb46e4a0026d6a4aac7 /Makeconfig
parent22dbc19dbb703bfeef8ef587fc4329aae8704a8e (diff)
downloadglibc-d6fe5e582d4e4bb339f55bc6369eaca0c52e527c.zip
glibc-d6fe5e582d4e4bb339f55bc6369eaca0c52e527c.tar.gz
glibc-d6fe5e582d4e4bb339f55bc6369eaca0c52e527c.tar.bz2
Do not terminate default test runs on test failure.
This patch is an updated version of <https://sourceware.org/ml/libc-alpha/2014-01/msg00198.html> and <https://sourceware.org/ml/libc-alpha/2014-03/msg00180.html>. Normal practice for software testsuites is that rather than terminating immediately when a test fails, they continue running and report at the end on how many tests passed or failed. The principle behind the glibc testsuite stopping on failure was probably that the expected state is no failures and so any failure indicates a problem such as miscompilation. In practice, while this is fairly close to true for native testing on x86_64 and x86 (kernel bugs and race conditions can still cause intermittent failures), it's less likely to be the case on other platforms, and so people testing glibc run the testsuite with "make -k" and then examine the logs to determine whether the failures are what they expect to fail on that platform, possibly with some automation for the comparison. This patch switches the glibc testsuite to the normal convention of not stopping on failure - unless you use stop-on-test-failure=y, in which case it behaves essentially as it did before (and does not generate overall test summaries on failure). Instead, the summary tests.sum may contain tests that FAILed. At the end of the test run, any FAIL or ERROR lines from tests.sum are printed, and then it exits with error status if there were any such lines. In addition, build failures will also cause the test run to stop - this has the justification that those *do* indicate serious problems that should be promptly fixed and aren't generally hard to fix (but apart from that, avoiding the build stopping on those failures seems harder). Note that unlike the previous patches in this series, this *does* require people with automation around testing glibc to change their processes - either to start using tests.sum / xtests.sum to track failures and compare them with expectations (with or without also using "make -k" and examining "make" logs to identify build failures), or else to use stop-on-test-failure=y and ignore the new tests.sum / xtests.sum mechanism. (If all you check is the exit status from "make check", no changes are needed unless you want to avoid test runs continuing after the first failure.) Tested x86_64. * scripts/evaluate-test.sh: Handle fourth argument to determine whether test run should stop on failure. * Makeconfig (stop-on-test-failure): New variable. (evaluate-test): Pass fourth argument to evaluate-test.sh based on $(stop-on-test-failure). * Makefile (tests): Give a summary of results from testing and exit with failure status if they include an ERROR or FAIL. (xtests): Likewise. * manual/install.texi (Configuring and compiling): Mention stop-on-test-failure=y. * INSTALL: Regenerated.
Diffstat (limited to 'Makeconfig')
-rw-r--r--Makeconfig7
1 files changed, 7 insertions, 0 deletions
diff --git a/Makeconfig b/Makeconfig
index fa9fb63..3338ab6 100644
--- a/Makeconfig
+++ b/Makeconfig
@@ -601,6 +601,12 @@ run-built-tests = yes
endif
endif
+# Whether to stop immediately when a test fails. Nonempty means to
+# stop, empty means not to stop.
+ifndef stop-on-test-failure
+stop-on-test-failure =
+endif
+
# How to run a program we just linked with our library.
# The program binary is assumed to be $(word 2,$^).
built-program-file = $(dir $(word 2,$^))$(notdir $(word 2,$^))
@@ -1092,6 +1098,7 @@ test-xfail-name = $(strip $(patsubst %.out, %, $(patsubst $(objpfx)%, %, $@)))
# XPASS or XFAIL rather than PASS or FAIL.
evaluate-test = $(..)scripts/evaluate-test.sh $(test-name) $$? \
$(if $(test-xfail-$(test-xfail-name)),true,false) \
+ $(if $(stop-on-test-failure),true,false) \
> $(common-objpfx)$(test-name).test-result
endif # Makeconfig not yet included