File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -364,13 +364,16 @@ for test_file in "$@"
364364do
365365 notify_suite_starting " $test_file "
366366 (
367+ set -e # Ensure bash_unit with exit with failure
368+ # in case of syntax error.
367369 if [[ " ${STICK_TO_CWD} " != true ]]
368370 then
369371 cd " $( dirname " $test_file " ) "
370372 source " $( basename " $test_file " ) "
371373 else
372374 source " $test_file "
373375 fi
376+ set +e
374377 run_test_suite
375378 )
376379 failure=$(( $? || failure))
Original file line number Diff line number Diff line change 2323)"
2424}
2525
26+ test_exit_code_not_0_in_case_of_syntax_error () {
27+ assert_fails " $BASH_UNIT <($CAT << EOF
28+ function test_fails() { while true ; done ; }
29+ EOF
30+ )"
31+ }
32+
2633test_run_all_file_parameters () {
2734 bash_unit_output=$( $BASH_UNIT \
2835 <( echo " test_one() { echo -n ; }" ) \
You can’t perform that action at this time.
0 commit comments