1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:47:35 +00:00

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

View file

@ -2,9 +2,10 @@
echo "==== Running Tests on SerenityOS ====" echo "==== Running Tests on SerenityOS ===="
run() { run(index) {
shift
test_cmd=($*) test_cmd=($*)
echo "Running test -- $test_cmd" echo "Running test $index out of $count_of_all_tests -- $test_cmd"
if $test_cmd { if $test_cmd {
echo "::debug file=$test_cmd:: $test_cmd passed!" echo "::debug file=$test_cmd:: $test_cmd passed!"
} else { } 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 # 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)) 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 # 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 index i cmd in $all_tests {
for $list { run $it } run $(expr $i + 1) $cmd
} }
echo "==== Done running tests ====" echo "==== Done running tests ===="