You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: hack/cmd_util.sh
+12-18
Original file line number
Diff line number
Diff line change
@@ -174,7 +174,8 @@ function os::cmd::internal::expect_exit_code_run_grep() {
174
174
os::test::junit::declare_test_start
175
175
176
176
local name=$(os::cmd::internal::describe_call "${cmd}""${cmd_eval_func}""${grep_args}""${test_eval_func}")
177
-
echo"Running ${name}..."
177
+
local preamble="Running ${name}..."
178
+
echo"${preamble}"
178
179
# for ease of parsing, we want the entire declaration on one line, so we replace '\n' with ';'
179
180
junit_log+=( "${name//$'\n'/;}" )
180
181
@@ -193,11 +194,8 @@ function os::cmd::internal::expect_exit_code_run_grep() {
193
194
local end_time=$(os::cmd::internal::seconds_since_epoch)
194
195
local time_elapsed=$(echo "scale=3; ${end_time} - ${start_time}"| bc | xargs printf'%5.3f')# in decimal seconds, we need leading zeroes for parsing later
195
196
196
-
# some commands are multi-line, so we may need to clear more than just the previous line
197
-
local cmd_length=$(echo "${cmd}"| wc -l)
198
-
for(( i=0; i<${cmd_length}; i++));do
199
-
os::text::clear_last_line
200
-
done
197
+
# clear the preamble so we can print out the success or error message
198
+
os::text::clear_string "${preamble}"
201
199
202
200
local return_code
203
201
if(( cmd_succeeded && test_succeeded ));then
@@ -460,7 +458,8 @@ function os::cmd::internal::run_until_exit_code() {
460
458
local description=$(os::cmd::internal::describe_call "${cmd}""${cmd_eval_func}")
461
459
local duration_seconds=$(echo "scale=3; $(( duration )) / 1000"| bc | xargs printf'%5.3f')
462
460
local description="${description}; re-trying every ${interval}s until completion or ${duration_seconds}s"
463
-
echo"Running ${description}..."
461
+
local preamble="Running ${description}..."
462
+
echo"${preamble}"
464
463
# for ease of parsing, we want the entire declaration on one line, so we replace '\n' with ';'
465
464
junit_log+=( "${description//$'\n'/;}" )
466
465
@@ -481,11 +480,8 @@ function os::cmd::internal::run_until_exit_code() {
481
480
local end_time=$(os::cmd::internal::seconds_since_epoch)
482
481
local time_elapsed=$(echo "scale=9; ${end_time} - ${start_time}"| bc | xargs printf'%5.3f')# in decimal seconds, we need leading zeroes for parsing later
483
482
484
-
# some commands are multi-line, so we may need to clear more than just the previous line
485
-
local cmd_length=$(echo "${cmd}"| wc -l)
486
-
for(( i=0; i<${cmd_length}; i++));do
487
-
os::text::clear_last_line
488
-
done
483
+
# clear the preamble so we can print out the success or error message
484
+
os::text::clear_string "${preamble}"
489
485
490
486
local return_code
491
487
if(( cmd_succeeded ));then
@@ -541,7 +537,8 @@ function os::cmd::internal::run_until_text() {
541
537
local description=$(os::cmd::internal::describe_call "${cmd}""""${text}""os::cmd::internal::success_func")
542
538
local duration_seconds=$(echo "scale=3; $(( duration )) / 1000"| bc | xargs printf'%5.3f')
543
539
local description="${description}; re-trying every ${interval}s until completion or ${duration_seconds}s"
544
-
echo"Running ${description}..."
540
+
local preamble="Running ${description}..."
541
+
echo"${preamble}"
545
542
# for ease of parsing, we want the entire declaration on one line, so we replace '\n' with ';'
546
543
junit_log+=( "${description//$'\n'/;}" )
547
544
@@ -564,11 +561,8 @@ function os::cmd::internal::run_until_text() {
564
561
local end_time=$(os::cmd::internal::seconds_since_epoch)
565
562
local time_elapsed=$(echo "scale=9; ${end_time} - ${start_time}"| bc | xargs printf'%5.3f')# in decimal seconds, we need leading zeroes for parsing later
566
563
567
-
# some commands are multi-line, so we may need to clear more than just the previous line
568
-
local cmd_length=$(echo "${cmd}"| wc -l)
569
-
for(( i=0; i<${cmd_length}; i++));do
570
-
os::text::clear_last_line
571
-
done
564
+
# clear the preamble so we can print out the success or error message
0 commit comments