[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Run cargo test during make check



commit f0516ed348283fb9fd8e9e1af7d9415728623b1d
Author: Sebastian Hahn <sebastian@xxxxxxxxxxxxxx>
Date:   Sat Apr 29 13:17:22 2017 +0200

    Run cargo test during make check
---
 src/test/include.am   |  9 ++++++++-
 src/test/test_rust.sh | 13 +++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/src/test/include.am b/src/test/include.am
index 438eadd..5fd61dd 100644
--- a/src/test/include.am
+++ b/src/test/include.am
@@ -6,7 +6,8 @@ TESTS_ENVIRONMENT = \
 	export SHELL="$(SHELL)"; \
 	export abs_top_srcdir="$(abs_top_srcdir)"; \
 	export builddir="$(builddir)"; \
-	export TESTING_TOR_BINARY="$(TESTING_TOR_BINARY)";
+	export TESTING_TOR_BINARY="$(TESTING_TOR_BINARY)"; \
+	export CARGO="$(CARGO)";
 
 TESTSCRIPTS = \
 	src/test/fuzz_static_testcases.sh \
@@ -19,6 +20,11 @@ TESTSCRIPTS = \
 	src/test/test_workqueue_socketpair.sh \
 	src/test/test_switch_id.sh
 
+if USE_RUST
+TESTSCRIPTS += \
+	src/test/test_rust.sh
+endif
+
 if USEPYTHON
 TESTSCRIPTS += src/test/test_ntor.sh src/test/test_hs_ntor.sh src/test/test_bt.sh
 endif
@@ -314,6 +320,7 @@ EXTRA_DIST += \
 	src/test/test_zero_length_keys.sh \
 	src/test/test_ntor.sh src/test/test_hs_ntor.sh src/test/test_bt.sh \
 	src/test/test-network.sh \
+	src/test/test_rust.sh \
 	src/test/test_switch_id.sh \
 	src/test/test_workqueue_cancel.sh \
 	src/test/test_workqueue_efd.sh \
diff --git a/src/test/test_rust.sh b/src/test/test_rust.sh
new file mode 100755
index 0000000..b41be97
--- /dev/null
+++ b/src/test/test_rust.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+# Test all the Rust crates we're using
+
+crates=tor_util
+
+exitcode=0
+
+for crate in $crates; do
+    cd "${abs_top_srcdir:-.}/src/rust/${crate}"
+    "${CARGO:-cargo}" test --frozen || exitcode=1
+done
+
+exit $exitcode



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits