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 "$@"
364
364
do
365
365
notify_suite_starting " $test_file "
366
366
(
367
+ set -e # Ensure bash_unit with exit with failure
368
+ # in case of syntax error.
367
369
if [[ " ${STICK_TO_CWD} " != true ]]
368
370
then
369
371
cd " $( dirname " $test_file " ) "
370
372
source " $( basename " $test_file " ) "
371
373
else
372
374
source " $test_file "
373
375
fi
376
+ set +e
374
377
run_test_suite
375
378
)
376
379
failure=$(( $? || failure))
Original file line number Diff line number Diff line change 23
23
)"
24
24
}
25
25
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
+
26
33
test_run_all_file_parameters () {
27
34
bash_unit_output=$( $BASH_UNIT \
28
35
<( echo " test_one() { echo -n ; }" ) \
You can’t perform that action at this time.
0 commit comments