From 76d40fa977399fa23c664c6309a34fe83d3f7a07 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 2 Aug 2021 23:29:53 +0200 Subject: [PATCH] Improve the detection of keep-going commands Have simpler patterns related to 'test' (the central objective being to keep going if 'make test' or 'tests/...' fails, but not if 'make tests' fails). Add 'cd' as a can't-keep-going command. Signed-off-by: Gilles Peskine --- tests/scripts/all.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 47ecc57fa..575e3ec36 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -538,13 +538,19 @@ pre_setup_keep_going () { # Whether it makes sense to keep a component going after the specified # command fails (test command) or not (configure or build). # This doesn't have to be 100% accurate: all failures are recorded anyway. + # False positives result in running things that can't be expected to + # work. False negatives result in things not running after something else + # failed even though they might have given useful feedback. can_keep_going_after_failure () { case "$1" in "msg "*) false;; - *[!A-Za-z]"test"|*[!A-Za-z]"test"[!A-Za-z]*) true;; - "tests/"*) true;; - "grep "*|"! grep "*) true;; - "test "*|"[ "*) true;; + "cd "*) false;; + *make*[\ /]tests*) false;; # make tests, make CFLAGS=-I../tests, ... + *test*) true;; # make test, tests/stuff, env V=v tests/stuff, ... + *make*check*) true;; + "grep "*) true;; + "[ "*) true;; + "! "*) true;; *) false;; esac }