From 713a78c88ae900b3cab08460a4b1428bf19a680c Mon Sep 17 00:00:00 2001 From: Philipp Wollermann Date: Mon, 14 Dec 2015 12:40:08 +0000 Subject: unittest.bash: Correctly handle failures due to "errexit" in tests. This will get rid of all the "ghost flakes" where tests crashed with no apparant reason printed into our logs. Now a stack trace is printed and an easy to understand failure reason, too. -- MOS_MIGRATED_REVID=110142957 --- scripts/bash_completion_test.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts/bash_completion_test.sh') diff --git a/scripts/bash_completion_test.sh b/scripts/bash_completion_test.sh index d45c0b7661..3eed6fbc86 100755 --- a/scripts/bash_completion_test.sh +++ b/scripts/bash_completion_test.sh @@ -170,8 +170,10 @@ source ${COMPLETION} assert_expansion_function() { local ws=${PWD} local function="$1" displacement="$2" type="$3" expected="$4" current="$5" - assert_equals "$(echo -e "${expected}")" \ - "$(eval "_bazel__${function} \"${ws}\" \"${displacement}\" \"${current}\" \"${type}\"")" + disable_errexit + local actual_result=$(eval "_bazel__${function} \"${ws}\" \"${displacement}\" \"${current}\" \"${type}\"") + enable_errexit + assert_equals "$(echo -ne "${expected}")" "${actual_result}" } test_expand_rules_in_package() { -- cgit v1.2.3