From ea1c1b75153740355fd54c4455237be1f8cbd427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Sat, 29 Feb 2020 20:48:58 +0000 Subject: 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. --- cfg.mk | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'cfg.mk') 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: -- cgit v1.2.1