aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastian Hahn <sebastian@torproject.org>2017-04-29 13:17:22 +0200
committerNick Mathewson <nickm@torproject.org>2017-05-19 08:47:11 -0400
commitf0516ed348283fb9fd8e9e1af7d9415728623b1d (patch)
tree4c9c1d4e5620af4501cc411db25e33b56e204ffa /src
parentf8ef7c65d10ccd9403d9d64ceceba0dd74d6421f (diff)
downloadtor-f0516ed348283fb9fd8e9e1af7d9415728623b1d.tar.gz
tor-f0516ed348283fb9fd8e9e1af7d9415728623b1d.zip
Run cargo test during make check
Diffstat (limited to 'src')
-rw-r--r--src/test/include.am9
-rwxr-xr-xsrc/test/test_rust.sh13
2 files changed, 21 insertions, 1 deletions
diff --git a/src/test/include.am b/src/test/include.am
index 438eaddba8..5fd61dd3e6 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 0000000000..b41be978b9
--- /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