add unit tests to test action and separate unit_tests.sh from test_all.sh
All checks were successful
/ test (push) Successful in 43s

This commit is contained in:
Neemek 2025-09-16 20:08:20 +02:00
parent dac2cbc20d
commit bcf0978b68
3 changed files with 29 additions and 24 deletions

26
unit_tests.sh Normal file
View file

@ -0,0 +1,26 @@
#!/bin/bash
errors=()
echo '=== Testing anglais ==='
# read files
for file in $(find tests -type f); do
echo "-v- Test-running file $file -v-"
if ! ./cli/cli run "$file"; then
echo "-x- Error -x-"
errors+=("$file")
else
echo "-+- Success -+-"
fi
done
if [ 0 -ne "$(wc -w <<< "${errors[@]}")" ]; then
echo "=x= Errors occured while executing =x="
echo "erroring files: $(printf '%s ' "${errors[@]}")"
exit 1
else
echo '=+= Successfully ran all tests =+='
fi