Rework acceptance test runner

Show less noise, support parallel execution and make it easier to run a single one.
This commit is contained in:
KtorZ 2022-12-27 09:17:48 +01:00
parent 0d0536f6c1
commit 2e17f18846
No known key found for this signature in database
GPG Key ID: 33173CB6F77F4277
3 changed files with 27 additions and 5 deletions

View File

@ -1,5 +0,0 @@
all:
@for t in $(shell find . -regex ".*[0-9]\{3\}" -type d | sort); do \
cargo run --quiet -- check $${t}; \
echo ""; \
done

View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
find . -regex ".*[0-9]\{3\}" -type d | xargs -P 8 -I {} -- ./run.sh {}

View File

@ -0,0 +1,24 @@
#!/usr/bin/env bash
if [ -z $1 ]; then
echo -e "\033[31mMissing argument: \033[1mACCEPTANCE_TEST\033[0m"
echo ""
echo -e "\033[1mUsage: \033[0m"
echo " run.sh {ACCEPTANCE_TEST}"
echo ""
echo -e "\033[1mExample: \033[0m"
echo " run.sh 034"
exit 1
fi
WORKDIR="$(dirname -- "${BASH_SOURCE[0]}")"
TARGET="$WORKDIR/$(basename $1)"
TMP=$(mktemp)
RESULT=$(cargo run --quiet -- check $TARGET 2>$TMP)
if [ "$?" -eq "0" ]; then
echo "$(basename $TARGET)"
else
echo "$(basename $TARGET)"
cat $TMP
fi