1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:17:36 +00:00

Tests: Run each test in their respective directories

This is so they can find their associated resources and it's
the same behavior as in Lagom.

This also required changing some tests so that they could
write their resources in a writable location.
This commit is contained in:
coderdreams 2021-05-30 12:15:20 -03:00 committed by Ali Mohammad Pur
parent 9ffb3e7e30
commit 6bc7f2204e
3 changed files with 16 additions and 4 deletions

View file

@ -5,9 +5,14 @@ echo "==== Running Tests on SerenityOS ===="
run(index) {
shift
test_dir=$(dirname $1)
if test -z $test_dir {
test_dir="."
}
test_cmd=($*)
echo "==== Running test $index out of $count_of_all_tests -- $test_cmd ===="
echo "::group::$test_cmd"
cd $test_dir
if $test_cmd {
echo "::endgroup::"
echo "==== $test_cmd passed! ===="
@ -17,6 +22,7 @@ run(index) {
echo "==== Added $test_cmd to list of failed tests. Failed tests so far: $failed_tests ===="
echo "::error file=$test_cmd:: $test_cmd returned non-zero exit code, check logs!"
}
cd -
}
# Files in /usr/Tests/* that we don't want to execute match these patterns:
@ -25,10 +31,10 @@ run(index) {
# UserEmulator: Tests designed to run inside the Userspace Emulator
# stack-smash: Intentionally crashes by smashing the stack
# TestJSON: AK/TestJSON makes assumptions about $PWD to load its input files
# .frm: Test inputs that are not tests
# .frm,.txt: Test inputs that are not tests
# test-web: Requires the window server in order to work
# test-js: We start this one manually with the show progress flag set to false
exclude_patterns='Kernel/Legacy|.inc|UserEmulator|stack-smash|TestJSON|.frm|test-web|test-js'
exclude_patterns='Kernel/Legacy|.inc|UserEmulator|stack-smash|TestJSON|.txt|.frm|test-web|test-js'
system_tests=((test-js --show-progress=false) (test-crypto -c -t test))
all_tests=${concat_lists $system_tests $(find /usr/Tests -type f | grep -E -v $exclude_patterns | shuf) }