2022-01-13 09:42:11 +11:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
set -e # Fail if any command fails
|
|
|
|
|
|
|
|
CARGO_PROJECT_FILES=( agb-*/Cargo.toml agb/Cargo.toml examples/*/Cargo.toml book/games/*/Cargo.toml )
|
|
|
|
|
|
|
|
for CARGO_PROJECT_FILE in "${CARGO_PROJECT_FILES[@]}"; do
|
|
|
|
PROJECT_DIR=$(dirname "$CARGO_PROJECT_FILE")
|
|
|
|
|
|
|
|
echo "Checking project $PROJECT_DIR"
|
|
|
|
(cd "$PROJECT_DIR" && cargo build)
|
|
|
|
|
|
|
|
if echo "$PROJECT_DIR" | grep -qE '^agb'; then
|
|
|
|
echo "Running clippy on $PROJECT_DIR"
|
|
|
|
(cd "$PROJECT_DIR" && cargo clippy)
|
|
|
|
|
|
|
|
echo "Testing $PROJECT_DIR in debug mode"
|
|
|
|
(cd "$PROJECT_DIR" && cargo test)
|
|
|
|
|
2022-01-13 09:57:42 +11:00
|
|
|
echo "Testing $PROJECT_DIR in release mode"
|
2022-01-13 09:42:11 +11:00
|
|
|
(cd "$PROJECT_DIR" && cargo test --release)
|
|
|
|
fi
|
2022-01-13 09:46:48 +11:00
|
|
|
done
|