Skip to content

Commit 613ed05

Browse files
committed
Fix test.sh for the GitHub action
1 parent 3b1e367 commit 613ed05

File tree

1 file changed

+32
-6
lines changed

1 file changed

+32
-6
lines changed

tools/test.sh

+32-6
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,56 @@
11

22
set -e # stop on errors
33

4+
if [ ! -d "toisto-aiff-test-suite/tests" ]; then
5+
echo "toisto-aiff-test-suite is missing. Read README.md Testing section for instructions."
6+
exit 1
7+
fi
8+
49
# ensure clippy gives no errors or warnings
510
cargo clippy -- -D warnings
611

712
cargo doc
813

9-
# runs all tests
10-
11-
cargo test
14+
# run tests - no capture if running under GitHub Actions
15+
if [ "$GITHUB_ACTIONS" == "true" ]; then
16+
cargo test -- --nocapture
17+
else
18+
cargo test
19+
fi
1220

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

24+
# build the toisto tester for the test suite
25+
cargo build --example aifc-toisto
26+
27+
# run the toisto test suite
1628
echo
1729
echo 'Toisto AIFF test suite results:'
1830
echo
1931
echo 'multi:'
20-
2132
cd toisto-aiff-test-suite
22-
python3 toisto-runner.py -c --override-list ../toisto-aifc-override-list.json ../target/debug/examples/aifc-toisto multi
33+
34+
# target/debug for normal testing,
35+
# x86_64-unknown-linux-gnu and powerpc-unknown-linux-gnu for GitHub Actions
36+
if [ -e ../target/x86_64-unknown-linux-gnu/debug/examples/ausnd-aureader-toisto ]; then
37+
python3 toisto-runner.py -c -v --override-list ../toisto-aifc-override-list.json ../target/x86_64-unknown-linux-gnu/debug/examples/aifc-toisto multi
38+
elif [ -e ../target/powerpc-unknown-linux-gnu/debug/examples/ausnd-aureader-toisto ]; then
39+
python3 toisto-runner.py -c -v --override-list ../toisto-aifc-override-list.json ../target/powerpc-unknown-linux-gnu/debug/examples/aifc-toisto multi
40+
else
41+
python3 toisto-runner.py -c --override-list ../toisto-aifc-override-list.json ../target/debug/examples/aifc-toisto multi
42+
fi
2343

2444
echo
2545
echo 'single:'
2646

27-
python3 toisto-runner.py -c --override-list ../toisto-aifc-override-list.json ../target/debug/examples/aifc-toisto single
47+
if [ -e ../target/x86_64-unknown-linux-gnu/debug/examples/ausnd-aureader-toisto ]; then
48+
python3 toisto-runner.py -c -v --override-list ../toisto-aifc-override-list.json ../target/x86_64-unknown-linux-gnu/debug/examples/aifc-toisto single
49+
elif [ -e ../target/powerpc-unknown-linux-gnu/debug/examples/ausnd-aureader-toisto ]; then
50+
python3 toisto-runner.py -c -v --override-list ../toisto-aifc-override-list.json ../target/powerpc-unknown-linux-gnu/debug/examples/aifc-toisto single
51+
else
52+
python3 toisto-runner.py -c --override-list ../toisto-aifc-override-list.json ../target/debug/examples/aifc-toisto single
53+
fi
2854

2955
echo
3056
echo "--- All tests OK."

0 commit comments

Comments
 (0)