@@ -65,7 +65,7 @@ function runner::load_test_files() {
6565 parallel::aggregate_test_results " $TEMP_DIR_PARALLEL_TEST_SUITE "
6666 # Kill the spinner once the aggregation finishes
6767 disown " $spinner_pid " && kill " $spinner_pid " & > /dev/null
68- printf " \r " # Clear the spinner output
68+ printf " \r \r " # Clear the spinner output
6969 for script_id in " ${scripts_ids[@]} " ; do
7070 export BASHUNIT_CURRENT_SCRIPT_ID=" ${script_id} "
7171 cleanup_script_temp_files
@@ -111,6 +111,13 @@ function runner::load_bench_files() {
111111}
112112
113113function runner::spinner() {
114+ # Only show spinner when output is to a terminal
115+ if [[ ! -t 1 ]]; then
116+ # Not a terminal, just wait silently
117+ while true ; do sleep 1; done
118+ return
119+ fi
120+
114121 if env::is_simple_output_enabled; then
115122 printf " \n"
116123 fi
@@ -524,13 +531,15 @@ function runner::run_test() {
524531 if [[ " $current_assertions_incomplete " != " $( state::get_assertions_incomplete) " ]]; then
525532 state::add_tests_incomplete
526533 reports::add_test_incomplete " $test_file " " $label " " $duration " " $total_assertions "
534+ runner::write_incomplete_result_output " $test_file " " $fn_name " " $subshell_output "
527535 internal_log " Test incomplete" " $label "
528536 return
529537 fi
530538
531539 if [[ " $current_assertions_skipped " != " $( state::get_assertions_skipped) " ]]; then
532540 state::add_tests_skipped
533541 reports::add_test_skipped " $test_file " " $label " " $duration " " $total_assertions "
542+ runner::write_skipped_result_output " $test_file " " $fn_name " " $subshell_output "
534543 internal_log " Test skipped" " $label "
535544 return
536545 fi
@@ -681,6 +690,38 @@ function runner::write_failure_result_output() {
681690 echo -e " $test_nr ) $test_file :$line_number \n$error_msg " >> " $FAILURES_OUTPUT_PATH "
682691}
683692
693+ function runner::write_skipped_result_output() {
694+ local test_file=$1
695+ local fn_name=$2
696+ local output_msg=$3
697+
698+ local line_number
699+ line_number=$( helper::get_function_line_number " $fn_name " )
700+
701+ local test_nr=" *"
702+ if ! parallel::is_enabled; then
703+ test_nr=$( state::get_tests_skipped)
704+ fi
705+
706+ echo -e " $test_nr ) $test_file :$line_number \n$output_msg " >> " $SKIPPED_OUTPUT_PATH "
707+ }
708+
709+ function runner::write_incomplete_result_output() {
710+ local test_file=$1
711+ local fn_name=$2
712+ local output_msg=$3
713+
714+ local line_number
715+ line_number=$( helper::get_function_line_number " $fn_name " )
716+
717+ local test_nr=" *"
718+ if ! parallel::is_enabled; then
719+ test_nr=$( state::get_tests_incomplete)
720+ fi
721+
722+ echo -e " $test_nr ) $test_file :$line_number \n$output_msg " >> " $INCOMPLETE_OUTPUT_PATH "
723+ }
724+
684725function runner::record_file_hook_failure() {
685726 local hook_name=" $1 "
686727 local test_file=" $2 "
0 commit comments