summaryrefslogtreecommitdiff
path: root/Libraries/LibJS
diff options
context:
space:
mode:
authorEmanuele Torre <torreemanuele6@gmail.com>2020-05-07 01:28:09 +0200
committerAndreas Kling <kling@serenityos.org>2020-05-07 12:20:41 +0200
commit6bbd0a18a1bb6f7a24cbb029274b9c61c5d2f294 (patch)
treea350f1ee7ba5139eddf840f5e5d55d48d7644c9c /Libraries/LibJS
parent8989300851f6ea65437c7c7a489aa92e3ca6e027 (diff)
downloadserenity-6bbd0a18a1bb6f7a24cbb029274b9c61c5d2f294.zip
LibJS: Fix shellcheck warnings in Tests/run-tests
Diffstat (limited to 'Libraries/LibJS')
-rwxr-xr-xLibraries/LibJS/Tests/run-tests18
1 files changed, 8 insertions, 10 deletions
diff --git a/Libraries/LibJS/Tests/run-tests b/Libraries/LibJS/Tests/run-tests
index d0c5fb94dc..131296c805 100755
--- a/Libraries/LibJS/Tests/run-tests
+++ b/Libraries/LibJS/Tests/run-tests
@@ -1,6 +1,6 @@
#!/bin/bash
-if [ "`uname`" = "SerenityOS" ]; then
+if [ "$(uname)" = "SerenityOS" ]; then
js_program=/bin/js
else
[ -z "$js_program" ] && js_program="$SERENITY_ROOT/Meta/Lagom/build/js"
@@ -9,24 +9,22 @@ else
export UBSAN_OPTIONS=print_stacktrace=1
fi
-extra_args="$*"
-
pass_count=0
fail_count=0
count=0
GLOBIGNORE=test-common.js
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
- let pass_count++
+ (( ++pass_count ))
echo -ne "( \033[32;1mPass\033[0m ) "
else
echo -ne "( \033[31;1mFail\033[0m ) "
- let fail_count++
+ (( ++fail_count ))
fi
- echo $f
- let count++
+ echo "$f"
+ (( ++count ))
done
pass_color=""
@@ -35,11 +33,11 @@ color_off="\033[0m"
exit_code=0
-if [ $pass_count -gt 0 ]; then
+if (( pass_count > 0 )); then
pass_color="\033[32;1m"
fi
-if [ $fail_count -gt 0 ]; then
+if (( fail_count > 0 )); then
fail_color="\033[31;1m"
exit_code=1
fi