mirror of
https://github.com/Noratrieb/elven-forest.git
synced 2026-01-16 19:35:02 +01:00
tests
This commit is contained in:
parent
eb4d4b98f8
commit
5ef748c2c5
8 changed files with 265 additions and 196 deletions
21
runtest.sh
Executable file
21
runtest.sh
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
|
||||
|
||||
cargo build -p elven-wald --manifest-path "$SCRIPT_DIR/Cargo.toml"
|
||||
|
||||
export ELVEN_WALD="$SCRIPT_DIR/target/debug/elven-wald"
|
||||
|
||||
for dir in "$SCRIPT_DIR"/tests/*; do
|
||||
echo "Testing $(basename "$dir")"
|
||||
tmpdir=$(mktemp -d)
|
||||
cp -r "$dir" "$tmpdir"
|
||||
cd "$tmpdir/$(basename "$dir")" || exit 1
|
||||
if ! bash "$dir/run.sh" >"$tmpdir/__stderr" 2>&1; then
|
||||
cat "$tmpdir/__stderr"
|
||||
echo "failed"
|
||||
else
|
||||
echo "passed"
|
||||
fi
|
||||
done
|
||||
Loading…
Add table
Add a link
Reference in a new issue