mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:07:44 +00:00
Build: Switch to CMake :^)
Closes https://github.com/SerenityOS/serenity/issues/2080
This commit is contained in:
parent
49727ffee4
commit
450a2a0f9c
236 changed files with 1774 additions and 2337 deletions
48
Libraries/LibJS/Tests/run-tests.sh
Executable file
48
Libraries/LibJS/Tests/run-tests.sh
Executable file
|
@ -0,0 +1,48 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ "$(uname)" = "SerenityOS" ]; then
|
||||
js_program=/bin/js
|
||||
else
|
||||
[ -z "$js_program" ] && js_program="$SERENITY_ROOT/Build/Meta/Lagom/js"
|
||||
|
||||
# Enable back traces if sanitizers are enabled
|
||||
export UBSAN_OPTIONS=print_stacktrace=1
|
||||
fi
|
||||
|
||||
pass_count=0
|
||||
fail_count=0
|
||||
count=0
|
||||
|
||||
GLOBIGNORE=test-common.js
|
||||
for f in *.js; do
|
||||
result="$("$js_program" "$@" -t "$f" 2>/dev/null)"
|
||||
if [ "$result" = "PASS" ]; then
|
||||
(( ++pass_count ))
|
||||
echo -ne "( \033[32;1mPass\033[0m ) "
|
||||
else
|
||||
echo -ne "( \033[31;1mFail\033[0m ) "
|
||||
(( ++fail_count ))
|
||||
fi
|
||||
echo "$f"
|
||||
(( ++count ))
|
||||
done
|
||||
|
||||
pass_color=""
|
||||
fail_color=""
|
||||
color_off="\033[0m"
|
||||
|
||||
exit_code=0
|
||||
|
||||
if (( pass_count > 0 )); then
|
||||
pass_color="\033[32;1m"
|
||||
fi
|
||||
|
||||
if (( fail_count > 0 )); then
|
||||
fail_color="\033[31;1m"
|
||||
exit_code=1
|
||||
fi
|
||||
|
||||
echo
|
||||
echo -e "Ran $count tests. Passed: ${pass_color}${pass_count}${color_off}, Failed: ${fail_color}${fail_count}${color_off}"
|
||||
|
||||
exit $exit_code
|
Loading…
Add table
Add a link
Reference in a new issue