summaryrefslogtreecommitdiff
path: root/src/test/test_rust.sh
diff options
context:
space:
mode:
authorIsis Lovecruft <isis@torproject.org>2018-03-20 20:46:19 +0000
committerNick Mathewson <nickm@torproject.org>2018-03-23 11:13:04 -0400
commit657d5cbbbc09948416bcc4f717cbfb64761a908d (patch)
treec06458957b6035c95a219801bb70a11a1a430cc1 /src/test/test_rust.sh
parent2b3138741002e298ee9b6a0fb8150432bfdcb0fc (diff)
downloadtor-657d5cbbbc09948416bcc4f717cbfb64761a908d.tar.gz
tor-657d5cbbbc09948416bcc4f717cbfb64761a908d.zip
tests: Automatically detect Rust crates to test and also pass --verbose.
* FIXES #25560: https://bugs.torproject.org/25560.
Diffstat (limited to 'src/test/test_rust.sh')
-rwxr-xr-xsrc/test/test_rust.sh23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/test/test_rust.sh b/src/test/test_rust.sh
index 133f2bb940..d87336e700 100755
--- a/src/test/test_rust.sh
+++ b/src/test/test_rust.sh
@@ -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