Run cargo test during make check

This commit is contained in:
Sebastian Hahn 2017-04-29 13:17:22 +02:00 committed by Nick Mathewson
parent f8ef7c65d1
commit f0516ed348
2 changed files with 21 additions and 1 deletions

View File

@ -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 \

13
src/test/test_rust.sh Executable file
View File

@ -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