diff options
author | Jim Meyering <meyering@fb.com> | 2019-12-24 08:16:24 -0800 |
---|---|---|
committer | Jim Meyering <meyering@fb.com> | 2019-12-25 15:21:16 -0800 |
commit | e5c59d08ad879e9462d0c1f8f887b70ecb685a18 (patch) | |
tree | 7503d67c9d95a8beab6094af34711b0b76d04831 /cfg.mk | |
parent | bba28f72f77bc678b76fbc8de995da8e1caee91c (diff) | |
download | grep-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.mk | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -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; } || : |