summaryrefslogtreecommitdiff
path: root/cfg.mk
diff options
context:
space:
mode:
Diffstat (limited to 'cfg.mk')
-rw-r--r--cfg.mk11
1 files changed, 11 insertions, 0 deletions
diff --git a/cfg.mk b/cfg.mk
index 1e5108b2d..c3a7afe5e 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -230,4 +230,15 @@ sc_prohibit_emacs__indent_tabs_mode__setting:
msg='use of emacs indent-tabs-mode: setting' \
$(_prohibit_regexp)
+# Ensure that each file that contains fail=1 also contains fail=0.
+# Otherwise, setting file=1 in the environment would make tests fail unexpectedly.
+sc_fail_is_initialized:
+ @files=$$(grep -l -E '\<fail=1$$' $$($(VC_LIST_EXCEPT))); \
+ if test "$$?" = 0; then \
+ grep -LE '\<fail=0$$' $$files | grep . && \
+ { echo '$(ME): the above files do not set fail=0' \
+ 1>&2; exit 1; } || :; \
+ else :; \
+ fi
+
include $(srcdir)/dist-check.mk