]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
squash! Make sure that the test_rust.sh script fails when a test fails
authorNick Mathewson <nickm@torproject.org>
Wed, 13 Jun 2018 16:21:25 +0000 (12:21 -0400)
committerNick Mathewson <nickm@torproject.org>
Wed, 13 Jun 2018 16:21:25 +0000 (12:21 -0400)
Also make sure that we're actually running the test from within the right
cwd, like we do when we're building.  This seems necessary to avoid
an error when running offline.

Amusingly, it appears that we had this bug before: we just weren't
noticing it, because of bug 26258.

src/test/include.am
src/test/test_rust.sh

index b768f74475fc08afee94f2234f6d7079341aca90..cc4f3e5c88c0c69237b34c2ad50bb2d313c3833c 100644 (file)
@@ -9,6 +9,7 @@ TESTS_ENVIRONMENT = \
        export builddir="$(builddir)"; \
        export TESTING_TOR_BINARY="$(TESTING_TOR_BINARY)"; \
        export CARGO="$(CARGO)"; \
+       export EXTRA_CARGO_OPTIONS="$(EXTRA_CARGO_OPTIONS)"; \
        export CARGO_ONLINE="$(CARGO_ONLINE)";
 
 TESTSCRIPTS = \
index 854582ec1766974944d7d71573815126d7ef6ae5..8e8d29b895cc3b3429a9cce7037fb87448a37dec 100755 (executable)
@@ -4,11 +4,15 @@
 set -e
 
 
-for cargo_toml in "${abs_top_srcdir:-../../..}"/src/rust/*/Cargo.toml; do
-    CARGO_TARGET_DIR="${abs_top_builddir:-../../..}/src/rust/target" \
-    CARGO_HOME="${abs_top_builddir:-../../..}/src/rust" \
-    "${CARGO:-cargo}" test --all-features ${CARGO_ONLINE-"--frozen"} \
-    --manifest-path "$cargo_toml" || exitcode=1
+for cargo_toml_dir in "${abs_top_srcdir:-../../..}"/src/rust/*; do
+    if [ -e "${cargo_toml_dir}/Cargo.toml" ]; then
+       cd "${cargo_toml_dir}" && \
+           CARGO_TARGET_DIR="${abs_top_builddir:-../../..}/src/rust/target" \
+           CARGO_HOME="${abs_top_builddir:-../../..}/src/rust" \
+           "${CARGO:-cargo}" test --all-features ${CARGO_ONLINE:-"--frozen"} \
+           ${EXTRA_CARGO_OPTIONS} \
+           --manifest-path "${cargo_toml_dir}/Cargo.toml" || exitcode=1
+    fi
 done
 
 exit $exitcode