[GHA] Add tests.

This commit is contained in:
s3rj1k
2024-07-25 19:47:30 +02:00
parent b4ebd0936c
commit 07283ac104
7 changed files with 269 additions and 21 deletions

View File

@@ -3,26 +3,27 @@
# "print_tests" returns relative paths to all the tests
TESTS=$(make -s -C ../.. print_tests)
chunks=${1:-1}
chunk_number=${2:-1}
IFS=$'\n' read -d '' -r -a lines <<< "$TESTS"
result=""
for ((i=chunk_number-1; i<${#lines[@]}; i+=chunks))
do
result+="${lines[$i]}"$'\n'
done
TESTS=$result
echo "-----------------------------------------------------------------";
echo "Starting tests";
echo "Starting tests on $(nproc --all) processors";
echo "Tests found: ${TESTS}";
echo "-----------------------------------------------------------------";
echo "Starting" > pids.txt
for i in $TESTS
do
echo "Testing $i" ;
./test.sh "$i" &
pid=($!)
pids+=($pid)
echo "$pid $i" >> pids.txt
echo "----------------" ;
done
for pid in "${pids[@]}"
do
echo "$pid waiting" >> pids.txt
wait "$pid"
echo "$pid finished" >> pids.txt
done
make -f run-tests.mk TEST_LIST=$TESTS
echo "Done running tests!"
echo "Timing results:"
cat test_times.log
echo "Done running tests!"