]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Make sure that the test_rust.sh script fails when a test fails
authorNick Mathewson <nickm@torproject.org>
Fri, 1 Jun 2018 00:15:57 +0000 (17:15 -0700)
committerNick Mathewson <nickm@torproject.org>
Fri, 1 Jun 2018 00:15:57 +0000 (17:15 -0700)
Exit codes from find(1) seem not to be so reliable as we had hoped.

Closes ticket 26258; bugfix on 0.3.3.4-alpha when we fixed #25560

changes/bug26258_033 [new file with mode: 0644]
src/test/test_rust.sh

diff --git a/changes/bug26258_033 b/changes/bug26258_033
new file mode 100644 (file)
index 0000000..ceca383
--- /dev/null
@@ -0,0 +1,4 @@
+  o Major bugfixes (rust, testing):
+    - Fix a bug where a failure in the rust unit tests would not actually
+      cause the build to fail. Fixes bug 26258; bugfix on 0.3.3.4-alpha.
+
index d87336e700a8bfbb2d26424833df27312dd7197b..854582ec1766974944d7d71573815126d7ef6ae5 100755 (executable)
@@ -3,13 +3,14 @@
 
 set -e
 
-CARGO_TARGET_DIR="${abs_top_builddir:-../../..}/src/rust/target" \
+
+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" \
-    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 '{}' \;
+    "${CARGO:-cargo}" test --all-features ${CARGO_ONLINE-"--frozen"} \
+    --manifest-path "$cargo_toml" || exitcode=1
+done
+
+exit $exitcode
 
-exit $?