aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/bash_completion_test.sh
diff options
context:
space:
mode:
authorGravatar Philipp Wollermann <philwo@google.com>2015-12-14 12:40:08 +0000
committerGravatar Dmitry Lomov <dslomov@google.com>2015-12-15 11:59:54 +0000
commit713a78c88ae900b3cab08460a4b1428bf19a680c (patch)
tree7696368c7f547422718da7417424e0c2de81b44f /scripts/bash_completion_test.sh
parentd5e3350f3d2a89c12c87208bc41daa89f4d31405 (diff)
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
Diffstat (limited to 'scripts/bash_completion_test.sh')
-rwxr-xr-xscripts/bash_completion_test.sh6
1 files changed, 4 insertions, 2 deletions
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() {