diff options
author | 2015-12-14 12:40:08 +0000 | |
---|---|---|
committer | 2015-12-15 11:59:54 +0000 | |
commit | 713a78c88ae900b3cab08460a4b1428bf19a680c (patch) | |
tree | 7696368c7f547422718da7417424e0c2de81b44f /third_party/ijar/test | |
parent | d5e3350f3d2a89c12c87208bc41daa89f4d31405 (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 'third_party/ijar/test')
-rwxr-xr-x | third_party/ijar/test/ijar_test.sh | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/third_party/ijar/test/ijar_test.sh b/third_party/ijar/test/ijar_test.sh index 93f858690c..db9a3a7f4d 100755 --- a/third_party/ijar/test/ijar_test.sh +++ b/third_party/ijar/test/ijar_test.sh @@ -15,7 +15,6 @@ # TODO(bazel-team) test that modifying the source in a non-interface # changing way results in the same -interface.jar. - DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) ## Inputs @@ -97,6 +96,7 @@ function check_consistent_file_contents() { local actual="$(cat $1 | ${MD5SUM} | awk '{ print $1; }')" local filename="$(echo $1 | ${MD5SUM} | awk '{ print $1; }')" local expected="$actual" + disable_errexit if $(echo "${expected_output}" | grep -q "^${filename} "); then echo "${expected_output}" | grep -q "^${filename} ${actual}$" || { ls -l "$1" @@ -106,6 +106,7 @@ function check_consistent_file_contents() { expected_output="$expected_output$filename $actual " fi + enable_errexit } function set_up() { |