Skip to content

Commit

Permalink
Fix test.sh for the GitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
karip committed Jul 26, 2024
1 parent 3b1e367 commit 613ed05
Showing 1 changed file with 32 additions and 6 deletions.
38 changes: 32 additions & 6 deletions tools/test.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,56 @@

set -e # stop on errors

if [ ! -d "toisto-aiff-test-suite/tests" ]; then
echo "toisto-aiff-test-suite is missing. Read README.md Testing section for instructions."
exit 1
fi

# ensure clippy gives no errors or warnings
cargo clippy -- -D warnings

cargo doc

# runs all tests

cargo test
# run tests - no capture if running under GitHub Actions
if [ "$GITHUB_ACTIONS" == "true" ]; then
cargo test -- --nocapture
else
cargo test
fi

# check that some functions never panic
cargo test --release --features internal-no-panic

# build the toisto tester for the test suite
cargo build --example aifc-toisto

# run the toisto test suite
echo
echo 'Toisto AIFF test suite results:'
echo
echo 'multi:'

cd toisto-aiff-test-suite
python3 toisto-runner.py -c --override-list ../toisto-aifc-override-list.json ../target/debug/examples/aifc-toisto multi

# target/debug for normal testing,
# x86_64-unknown-linux-gnu and powerpc-unknown-linux-gnu for GitHub Actions
if [ -e ../target/x86_64-unknown-linux-gnu/debug/examples/ausnd-aureader-toisto ]; then
python3 toisto-runner.py -c -v --override-list ../toisto-aifc-override-list.json ../target/x86_64-unknown-linux-gnu/debug/examples/aifc-toisto multi
elif [ -e ../target/powerpc-unknown-linux-gnu/debug/examples/ausnd-aureader-toisto ]; then
python3 toisto-runner.py -c -v --override-list ../toisto-aifc-override-list.json ../target/powerpc-unknown-linux-gnu/debug/examples/aifc-toisto multi
else
python3 toisto-runner.py -c --override-list ../toisto-aifc-override-list.json ../target/debug/examples/aifc-toisto multi
fi

echo
echo 'single:'

python3 toisto-runner.py -c --override-list ../toisto-aifc-override-list.json ../target/debug/examples/aifc-toisto single
if [ -e ../target/x86_64-unknown-linux-gnu/debug/examples/ausnd-aureader-toisto ]; then
python3 toisto-runner.py -c -v --override-list ../toisto-aifc-override-list.json ../target/x86_64-unknown-linux-gnu/debug/examples/aifc-toisto single
elif [ -e ../target/powerpc-unknown-linux-gnu/debug/examples/ausnd-aureader-toisto ]; then
python3 toisto-runner.py -c -v --override-list ../toisto-aifc-override-list.json ../target/powerpc-unknown-linux-gnu/debug/examples/aifc-toisto single
else
python3 toisto-runner.py -c --override-list ../toisto-aifc-override-list.json ../target/debug/examples/aifc-toisto single
fi

echo
echo "--- All tests OK."

0 comments on commit 613ed05

Please sign in to comment.