File tree Expand file tree Collapse file tree 4 files changed +15
-6
lines changed
Expand file tree Collapse file tree 4 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -9,14 +9,14 @@ declare -r BASHUNIT_ROOT_DIR="$(dirname "${BASH_SOURCE[0]}")"
99export BASHUNIT_ROOT_DIR
1010
1111source " $BASHUNIT_ROOT_DIR /src/dev/debug.sh"
12+ source " $BASHUNIT_ROOT_DIR /src/check_os.sh"
1213source " $BASHUNIT_ROOT_DIR /src/str.sh"
1314source " $BASHUNIT_ROOT_DIR /src/globals.sh"
1415source " $BASHUNIT_ROOT_DIR /src/dependencies.sh"
1516source " $BASHUNIT_ROOT_DIR /src/io.sh"
1617source " $BASHUNIT_ROOT_DIR /src/math.sh"
1718source " $BASHUNIT_ROOT_DIR /src/parallel.sh"
1819source " $BASHUNIT_ROOT_DIR /src/env.sh"
19- source " $BASHUNIT_ROOT_DIR /src/check_os.sh"
2020source " $BASHUNIT_ROOT_DIR /src/clock.sh"
2121source " $BASHUNIT_ROOT_DIR /src/state.sh"
2222source " $BASHUNIT_ROOT_DIR /src/colors.sh"
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ function env::find_terminal_width() {
7979 echo " ${cols:- $_DEFAULT_TERMINAL_WIDTH } "
8080}
8181
82- TEMP_DIR_PARALLEL_TEST_SUITE=" /tmp/bashunit/parallel"
82+ TEMP_DIR_PARALLEL_TEST_SUITE=" /tmp/bashunit/parallel/ ${_OS :- Unknown} "
8383TERMINAL_WIDTH=" $( env::find_terminal_width) "
8484FAILURES_OUTPUT_PATH=$( mktemp)
8585CAT=" $( which cat) "
Original file line number Diff line number Diff line change @@ -158,8 +158,6 @@ function runner::run_test() {
158158 # Closes FD 3, which was used temporarily to hold the original stdout.
159159 exec 3>& -
160160
161- runner::parse_result " $function_name " " $test_execution_result " " $@ "
162-
163161 local subshell_output=$( \
164162 echo " $test_execution_result " | \
165163 tail -n 1 | \
@@ -192,6 +190,8 @@ function runner::run_test() {
192190 fi
193191 done
194192
193+ runner::parse_result " $function_name " " $test_execution_result " " $@ "
194+
195195 local total_assertions=" $( state::calculate_total_assertions " $test_execution_result " ) "
196196
197197 local end_time=$( clock::now)
@@ -282,6 +282,15 @@ function runner::parse_result_parallel() {
282282 count=$(( count + 1 ))
283283 done
284284
285+ if env::is_dev_mode_enabled; then
286+ local test_id=$( \
287+ echo " $execution_result " | \
288+ tail -n 1 | \
289+ sed -E -e ' s/.*##TEST_ID=([0-9]*)##.*/\1/g' \
290+ )
291+ log " debug" " [PARA] test_id:$test_id " " function_name:$function_name " " execution_result:$execution_result "
292+ fi
293+
285294 echo " $execution_result " > " $unique_test_result_file "
286295}
287296
@@ -326,7 +335,7 @@ function runner::parse_result_sync() {
326335 tail -n 1 | \
327336 sed -E -e ' s/.*##TEST_ID=([0-9]*)##.*/\1/g' \
328337 )
329- log " $test_id " " $function_name " " $execution_result "
338+ log " debug " " [SYNC] test_id: $test_id " " function_name: $function_name " " execution_result: $execution_result "
330339 fi
331340
332341 (( _ASSERTIONS_PASSED += assertions_passed)) || true
Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ function state::export_subshell_context() {
148148 encoded_test_output=$( echo -n " $_TEST_OUTPUT " | base64)
149149 fi
150150
151- echo " ##TEST_ID=$( random_str) \
151+ echo " ##TEST_ID=$( random_str 8 ) \
152152##ASSERTIONS_FAILED=$_ASSERTIONS_FAILED \
153153##ASSERTIONS_PASSED=$_ASSERTIONS_PASSED \
154154##ASSERTIONS_SKIPPED=$_ASSERTIONS_SKIPPED \
You can’t perform that action at this time.
0 commit comments