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

LibJS: Fix shellcheck warnings in Tests/run-tests

This commit is contained in:
Emanuele Torre 2020-05-07 01:28:09 +02:00 committed by Andreas Kling
parent 8989300851
commit 6bbd0a18a1

View file

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
if [ "`uname`" = "SerenityOS" ]; then if [ "$(uname)" = "SerenityOS" ]; then
js_program=/bin/js js_program=/bin/js
else else
[ -z "$js_program" ] && js_program="$SERENITY_ROOT/Meta/Lagom/build/js" [ -z "$js_program" ] && js_program="$SERENITY_ROOT/Meta/Lagom/build/js"
@ -9,24 +9,22 @@ else
export UBSAN_OPTIONS=print_stacktrace=1 export UBSAN_OPTIONS=print_stacktrace=1
fi fi
extra_args="$*"
pass_count=0 pass_count=0
fail_count=0 fail_count=0
count=0 count=0
GLOBIGNORE=test-common.js GLOBIGNORE=test-common.js
for f in *.js; do for f in *.js; do
result=`$js_program $extra_args -t $f 2>/dev/null` result="$("$js_program" "$@" -t "$f" 2>/dev/null)"
if [ "$result" = "PASS" ]; then if [ "$result" = "PASS" ]; then
let pass_count++ (( ++pass_count ))
echo -ne "( \033[32;1mPass\033[0m ) " echo -ne "( \033[32;1mPass\033[0m ) "
else else
echo -ne "( \033[31;1mFail\033[0m ) " echo -ne "( \033[31;1mFail\033[0m ) "
let fail_count++ (( ++fail_count ))
fi fi
echo $f echo "$f"
let count++ (( ++count ))
done done
pass_color="" pass_color=""
@ -35,11 +33,11 @@ color_off="\033[0m"
exit_code=0 exit_code=0
if [ $pass_count -gt 0 ]; then if (( pass_count > 0 )); then
pass_color="\033[32;1m" pass_color="\033[32;1m"
fi fi
if [ $fail_count -gt 0 ]; then if (( fail_count > 0 )); then
fail_color="\033[31;1m" fail_color="\033[31;1m"
exit_code=1 exit_code=1
fi fi