summaryrefslogtreecommitdiff
path: root/cfg.mk
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2020-02-29 20:48:58 +0000
committerPádraig Brady <P@draigBrady.com>2020-02-29 22:45:00 +0000
commitea1c1b75153740355fd54c4455237be1f8cbd427 (patch)
tree6144b57ce379287b8e33a476f6db7eb2a90990b8 /cfg.mk
parentde73a867ca989e6cf1929f511d2679aa2085c2be (diff)
downloadcoreutils-ea1c1b75153740355fd54c4455237be1f8cbd427.tar.gz
tests: fix incorrect `|| fail` pattern in tests
* tests/ls/stat-free-symlinks.sh: s/|| fail/|| fail=1/. * tests/misc/tee.sh: Likewise. * tests/touch/relative.sh: Likewise. * cfg.mk (sc_prohibit_or_fail): A new syntax-check to avoid this.
Diffstat (limited to 'cfg.mk')
-rw-r--r--cfg.mk8
1 files changed, 8 insertions, 0 deletions
diff --git a/cfg.mk b/cfg.mk
index c9b8c7af5..bb0960a26 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -519,6 +519,14 @@ sc_prohibit_and_fail_1:
in_vc_files='^tests/' \
$(_sc_search_regexp)
+# Ensure that tests don't use `cmd ... || fail` as that's a noop.
+sc_prohibit_or_fail:
+ @prohibit='\|\| fail$$' \
+ exclude=':#' \
+ halt='|| fail detected. Please use: || fail=1' \
+ in_vc_files='^tests/' \
+ $(_sc_search_regexp)
+
# Ensure that env vars are not passed through returns_ as
# that was seen to fail on FreeBSD /bin/sh at least
sc_prohibit_env_returns: