From cb4bfac119e0cbf2422df1efadbc12c2e0e7ed05 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 2 Aug 2021 23:14:03 +0200 Subject: [PATCH] Clarify some comments Signed-off-by: Gilles Peskine --- tests/scripts/all.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 2d52fd13d2..6c5e7e3cc4 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -2873,8 +2873,11 @@ pseudo_component_error_test () { echo "Expect three failing commands." fi error_test='this should not be used since the component runs in a subshell' + # Expected error: 'grep non_existent /dev/null -> 1' grep non_existent /dev/null + # Expected error: '! grep -q . tests/scripts/all.sh -> 1' not grep -q . "$0" + # Expected error: 'make unknown_target -> 2' make unknown_target false "this should not be executed" } @@ -2894,8 +2897,11 @@ run_component () { esac "${dd_cmd[@]}" - # Run the component in a subshell + # Run the component in a subshell, with error trapping and output + # redirection set up based on the relevant options. if [ $KEEP_GOING -eq 1 ]; then + # We want to keep running if the subshell fails, so 'set -e' must + # be off when the subshell runs. set +e fi (