1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:07:45 +00:00

LibJS: Show run-tests progress in the taskbar

Use the window progress escape sequence to indicate how far along in
the test collection we are while running tests. :^)
This commit is contained in:
Andreas Kling 2020-05-30 22:13:13 +02:00
parent 165f69023b
commit 29ab518003

View file

@ -12,8 +12,14 @@ fi
pass_count=0 pass_count=0
fail_count=0 fail_count=0
count=0 count=0
test_count=0
GLOBIGNORE=test-common.js GLOBIGNORE=test-common.js
for f in *.js; do
(( ++test_count ))
done
for f in *.js; do for f in *.js; do
result="$("$js_program" "$@" -t "$f" 2>/dev/null)" result="$("$js_program" "$@" -t "$f" 2>/dev/null)"
if [ "$result" = "PASS" ]; then if [ "$result" = "PASS" ]; then
@ -23,10 +29,13 @@ for f in *.js; do
echo -ne "( \033[31;1mFail\033[0m ) " echo -ne "( \033[31;1mFail\033[0m ) "
(( ++fail_count )) (( ++fail_count ))
fi fi
echo -ne "\033]9;${count};${test_count}\033\\"
echo "$f" echo "$f"
(( ++count )) (( ++count ))
done done
echo -e "\033]9;-1\033\\"
pass_color="" pass_color=""
fail_color="" fail_color=""
color_off="\033[0m" color_off="\033[0m"