Meta: Use the new Shell features to improve run-tests-and-shutdown

Fixes two TODOs in that file :^)
This commit is contained in:
AnotherTest 2021-03-06 15:42:35 +03:30 committed by Andreas Kling
parent 13b65b632a
commit 1496b02203
Notes: sideshowbarker 2024-07-18 21:39:38 +09:00

View File

@ -2,9 +2,10 @@
echo "==== Running Tests on SerenityOS ===="
run() {
run(index) {
shift
test_cmd=($*)
echo "Running test -- $test_cmd"
echo "Running test $index out of $count_of_all_tests -- $test_cmd"
if $test_cmd {
echo "::debug file=$test_cmd:: $test_cmd passed!"
} else {
@ -12,15 +13,14 @@ run() {
}
}
# TODO: It'd be nice to have a list+list op (as opposed to nest-on-in-another)
# TODO: It'd be nice to have a list.length or enumerate(list) operation to allow terminal progress bar
# TODO: test-web requires the window server
system_tests=((test-js --show-progress=false) test-pthread test-compress /usr/Tests/LibM/test-math (test-crypto bigint -t))
# FIXME: Running too much at once is likely to run into #5541. Remove commented out find below when stable
all_tests=($system_tests) #$(find /usr/Tests -type f | grep -v Kernel | grep -v .inc | shuf))
all_tests=${concat_lists $system_tests} #$(find /usr/Tests -type f | grep -v Kernel | grep -v .inc | shuf))
count_of_all_tests=${length $all_tests}
for list in $all_tests {
for $list { run $it }
for index i cmd in $all_tests {
run $(expr $i + 1) $cmd
}
echo "==== Done running tests ===="