diff options
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am index adf02122ff..36a5dd2e9e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -239,6 +239,7 @@ test-network: need-chutney-path $(TESTING_TOR_BINARY) src/tools/tor-gencert # because they're incompatible test-network-all: need-chutney-path test-driver $(TESTING_TOR_BINARY) src/tools/tor-gencert mkdir -p $(TEST_NETWORK_ALL_LOG_DIR) + rm -f $(TEST_NETWORK_ALL_LOG_DIR)/*.log $(TEST_NETWORK_ALL_LOG_DIR)/*.trs @flavors="$(TEST_CHUTNEY_FLAVORS)"; \ if ping6 -q -c 1 -o ::1 >/dev/null 2>&1 || ping6 -q -c 1 -W 1 ::1 >/dev/null 2>&1 || ping -6 -c 1 -W 1 ::1 >/dev/null 2>&1; then \ echo "ping6 ::1 or ping ::1 succeeded, running IPv6 flavors: $(TEST_CHUTNEY_FLAVORS_IPV6)."; \ @@ -262,7 +263,7 @@ test-network-all: need-chutney-path test-driver $(TESTING_TOR_BINARY) src/tools/ $(top_srcdir)/src/test/test-network.sh $(TEST_NETWORK_WARNING_FLAGS); \ done; \ echo "Log and result files are available in $(TEST_NETWORK_ALL_LOG_DIR)."; \ - ! grep -q FAIL test_network_log/*.trs + ! grep -q FAIL $(TEST_NETWORK_ALL_LOG_DIR)/*.trs need-stem-path: @if test ! -d "$$STEM_SOURCE_DIR"; then \ @@ -358,6 +359,37 @@ check-typos: echo "You can install the latest version of misspell here: https://github.com/client9/misspell#install"; \ fi +.PHONY: rustfmt +rustfmt: +if USE_RUST + @if test -x "`which cargo-fmt 2>&1;true`"; then \ + echo "Formatting Rust code ..."; \ + (cd "$(top_srcdir)/src/rust" && cargo fmt --all --); \ + else \ + echo "Tor uses rustfmt (via cargo-fmt) to format Rust code."; \ + echo "However, it seems that you don't have rustfmt installed."; \ + printf "You can install rustfmt by following the directions here:"; \ + echo " https://github.com/rust-lang-nursery/rustfmt"; \ + fi +endif + +.PHONY: check-rustfmt +check-rustfmt: +if USE_RUST + @if test -x "`which cargo-fmt 2>&1;true`"; then \ + printf "Running rustfmt..."; \ + (cd "$(top_srcdir)/src/rust" && cargo fmt --all -- --check && echo "done.") || \ + (echo "**************** check-rustfmt failed. ****************"; \ + echo " Run \`make rustfmt\` to apply the above changes."; \ + exit 1); \ + else \ + echo "Tor uses rustfmt (via cargo-fmt) to format Rust code."; \ + echo "However, it seems that you don't have rustfmt installed."; \ + printf "You can install rustfmt by following the directions here:"; \ + echo " https://github.com/rust-lang-nursery/rustfmt"; \ + fi +endif + .PHONY: clippy clippy: if USE_RUST |