tests: Automatically detect Rust crates to test and also pass --verbose.

* FIXES #25560: https://bugs.torproject.org/25560.
This commit is contained in:
Isis Lovecruft
2018-03-20 20:46:19 +00:00
committed by Nick Mathewson
parent 2b31387410
commit 657d5cbbbc
3 changed files with 15 additions and 15 deletions
+9 -14
View File
@@ -1,20 +1,15 @@
#!/bin/sh
# Test all Rust crates
crates="protover tor_util smartlist tor_allocate"
exitcode=0
set -e
for crate in $crates; do
cd "${abs_top_builddir:-../../..}/src/rust"
CARGO_TARGET_DIR="${abs_top_builddir:-../../..}/src/rust/target" \
CARGO_HOME="${abs_top_builddir:-../../..}/src/rust" \
"${CARGO:-cargo}" test ${CARGO_ONLINE-"--frozen"} \
--manifest-path "${abs_top_srcdir:-.}/src/rust/${crate}/Cargo.toml" \
|| exitcode=1
cd -
done
CARGO_TARGET_DIR="${abs_top_builddir:-../../..}/src/rust/target" \
CARGO_HOME="${abs_top_builddir:-../../..}/src/rust" \
find "${abs_top_srcdir:-../../..}/src/rust" \
-mindepth 2 -maxdepth 2 \
-type f -name 'Cargo.toml' \
-exec "${CARGO:-cargo}" test --all-features ${CARGO_ONLINE-"--frozen"} \
--manifest-path '{}' \;
exit $?
exit $exitcode