summaryrefslogtreecommitdiff
path: root/cfg.mk
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2019-12-24 08:16:24 -0800
committerJim Meyering <meyering@fb.com>2019-12-25 15:21:16 -0800
commite5c59d08ad879e9462d0c1f8f887b70ecb685a18 (patch)
tree7503d67c9d95a8beab6094af34711b0b76d04831 /cfg.mk
parentbba28f72f77bc678b76fbc8de995da8e1caee91c (diff)
downloadgrep-e5c59d08ad879e9462d0c1f8f887b70ecb685a18.tar.gz
tests: ensure we use require_timeout_ when needed
* cfg.mk (sc_timeout_prereq): New syntax-check rule.
Diffstat (limited to 'cfg.mk')
-rw-r--r--cfg.mk13
1 files changed, 13 insertions, 0 deletions
diff --git a/cfg.mk b/cfg.mk
index 67eb4110..26534e71 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -159,3 +159,16 @@ exclude_file_name_regexp--sc_prohibit_tab_based_indentation = \
exclude_file_name_regexp--sc_prohibit_doubled_word = ^tests/count-newline$$
exclude_file_name_regexp--sc_long_lines = ^tests/.*$$
+
+# If a test uses timeout, it must also use require_timeout_.
+# Grandfather-exempt the fedora test, since it ensures timeout works
+# as expected before using it.
+sc_timeout_prereq:
+ @$(VC_LIST_EXCEPT) \
+ | grep '^tests/' \
+ | grep -v '^tests/fedora$$' \
+ | xargs grep -lw timeout \
+ | xargs grep -FLw require_timeout_ \
+ | $(GREP) . \
+ && { echo '$(ME): timeout withtout use of require_timeout_' \
+ 1>&2; exit 1; } || :