anglais/unit_tests.sh
2025-09-30 16:02:39 +02:00

26 lines
No EOL
501 B
Bash

#!/bin/bash
errors=()
echo '=== Testing anglais ==='
# read files
for file in $(find tests -type f); do
echo "-v- Test-running file $file -v-"
if ! timeout 3s ./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