summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/include.am2
-rwxr-xr-xsrc/test/test_rust.sh23
2 files changed, 10 insertions, 15 deletions
diff --git a/src/test/include.am b/src/test/include.am
index 1a49367c6b..b768f74475 100644
--- a/src/test/include.am
+++ b/src/test/include.am
@@ -360,4 +360,4 @@ EXTRA_DIST += \
src/test/test_workqueue_socketpair.sh
test-rust:
- $(TESTS_ENVIRONMENT) $(abs_top_srcdir)/src/test/test_rust.sh
+ $(TESTS_ENVIRONMENT) "$(abs_top_srcdir)/src/test/test_rust.sh"
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