Skip to content

Commit 346005a

Browse files
committed
fix: zunit results log format
Signed-off-by: Vladislav Doster <[email protected]>
1 parent 3f09385 commit 346005a

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/commands/run.zsh

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -173,16 +173,17 @@ function _zunit_human_time() {
173173
# Output test results
174174
function _zunit_output_results() {
175175
integer elapsed=$(( end_time - start_time ))
176-
echo
177-
echo "$total tests run in $(_zunit_human_time $elapsed)"
178-
echo
179-
print -Pr "%BResults%b"
176+
print ' '
177+
print -PR "= "$'\e[1;4m'"ZUnit Results"$'\e[0m'" ====="
180178
print -Pr "%F{green}Passed%f: ${#passed}/${total}"
181179
print -Pr "%F{red}Errors%f: ${#errors} $( (( $#errors )) && print "(${(j:, :)errors})" )"
182180
print -Pr "%F{red}Failed%f: ${#failed} $( (( $#failed )) && print "(${(j:, :)failed})" )"
183181
print -Pr "%F{yellow}Warnings%f: ${#warnings} $( (( $#warnings )) && print "(${(j:, :)warnings})" )"
184182
print -Pr "%F{white}Skipped%f: ${#skipped} $( (( $#skipped )) && print "(${(j:, :)skipped})" )"
185-
echo
183+
print ' '
184+
print -Pr "$total tests ran in $(_zunit_human_time $elapsed)"
185+
print -Pr "%B======================%b"
186+
print ' '
186187

187188
[[ -n $output_text ]] && echo "TAP report written at $PWD/$logfile_text"
188189
[[ -n $output_html ]] && echo "HTML report written at $PWD/$logfile_html"
@@ -274,9 +275,9 @@ function _zunit_run() {
274275
# TAP output is disabled
275276
if [[ -z $tap ]]; then
276277
# Print version information
277-
echo $(color yellow 'Launching ZUnit')
278-
echo "ZUnit: $(_zunit_version)"
279-
echo "ZSH: $(zsh --version)"
278+
echo
279+
print -Pr "%F{green}==>%f Launching ZUnit $(_zunit_version)"
280+
print -Pr "%F{blue}==>%f ZSH: $(zsh --version)"
280281
echo
281282
fi
282283

@@ -325,7 +326,7 @@ function _zunit_run() {
325326
# and run it if it is available
326327
if [[ -f "$support/bootstrap" ]]; then
327328
source "$support/bootstrap"
328-
echo "$(color green '[SUCCESS]') Sourced bootstrap script $support/bootstrap"
329+
print -Pr "%F{blue}==>%f Sourced bootstrap script $support/bootstrap"
329330
fi
330331
fi
331332
# Check if fail_fast is specified in the config or as an option
@@ -416,7 +417,7 @@ function _zunit_run_testfile() {
416417
test_names=()
417418

418419
# Update status message
419-
print -Pr "%F{blue}==>%f Loading tests from %B${testfile}%b"
420+
print -Pr "%F{blue}==>%f Loading tests in %B${testfile}%b"
420421

421422
# A regex pattern to match test declarations
422423
pattern='^ *@test *([^ ].*) *\{ *(.*)$'

0 commit comments

Comments
 (0)