From 2a35b085eeee977376b5c5e2dd084f9f505d8f8a Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 10 Aug 2018 11:09:18 +1000 Subject: Rust: backport src/test/test_rust.sh from master Preparation for 26497. --- src/test/test_rust.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'src/test') diff --git a/src/test/test_rust.sh b/src/test/test_rust.sh index d559f94ce0..4ecca7834d 100755 --- a/src/test/test_rust.sh +++ b/src/test/test_rust.sh @@ -1,13 +1,19 @@ #!/bin/sh -# Test all the Rust crates we're using +# Test all Rust crates -crates=tor_util +set -e -exitcode=0 +export LSAN_OPTIONS=suppressions=${abs_top_srcdir}/src/test/rust_supp.txt -for crate in $crates; do - cd "${abs_top_srcdir:-.}/src/rust/${crate}" - CARGO_TARGET_DIR="${abs_top_builddir}/src/rust/target" CARGO_HOME="${abs_top_builddir}/src/rust" "${CARGO:-cargo}" test ${CARGO_ONLINE-"--frozen"} || exitcode=1 +for cargo_toml_dir in "${abs_top_srcdir:-../../..}"/src/rust/*; do + if [ -e "${cargo_toml_dir}/Cargo.toml" ]; then + cd "${cargo_toml_dir}" && \ + CARGO_TARGET_DIR="${abs_top_builddir:-../../..}/src/rust/target" \ + CARGO_HOME="${abs_top_builddir:-../../..}/src/rust/.cargo" \ + "${CARGO:-cargo}" test ${CARGO_ONLINE-"--frozen"} \ + ${EXTRA_CARGO_OPTIONS} \ + --manifest-path "${cargo_toml_dir}/Cargo.toml" || exitcode=1 + fi done exit $exitcode -- cgit v1.2.3-54-g00ecf From ce19477ffcdf64255f050308182f3d682e6f6de1 Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 10 Aug 2018 11:00:46 +1000 Subject: Stop setting $CARGO_HOME cargo will use the user's $CARGO_HOME, or $HOME/.cargo by default. Fixes bug 26497; bugfix on 0.3.1.5-alpha. --- changes/bug26497 | 3 +++ src/rust/tor_util/include.am | 1 - src/test/test_rust.sh | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changes/bug26497 (limited to 'src/test') diff --git a/changes/bug26497 b/changes/bug26497 new file mode 100644 index 0000000000..d0c05ff3e4 --- /dev/null +++ b/changes/bug26497 @@ -0,0 +1,3 @@ + o Minor bugfixes (rust): + - Stop setting $CARGO_HOME. cargo will use the user's $CARGO_HOME, or + $HOME/.cargo by default. Fixes bug 26497; bugfix on 0.3.1.5-alpha. diff --git a/src/rust/tor_util/include.am b/src/rust/tor_util/include.am index ec3898577b..c110602895 100644 --- a/src/rust/tor_util/include.am +++ b/src/rust/tor_util/include.am @@ -7,7 +7,6 @@ EXTRA_DIST +=\ src/rust/target/release/@TOR_RUST_UTIL_STATIC_NAME@: FORCE ( cd "$(abs_top_srcdir)/src/rust/tor_util" ; \ CARGO_TARGET_DIR="$(abs_top_builddir)/src/rust/target" \ - CARGO_HOME="$(abs_top_builddir)/src/rust" \ $(CARGO) build --release --quiet $(CARGO_ONLINE) ) FORCE: diff --git a/src/test/test_rust.sh b/src/test/test_rust.sh index 4ecca7834d..9ad7a698ad 100755 --- a/src/test/test_rust.sh +++ b/src/test/test_rust.sh @@ -9,7 +9,6 @@ for cargo_toml_dir in "${abs_top_srcdir:-../../..}"/src/rust/*; do if [ -e "${cargo_toml_dir}/Cargo.toml" ]; then cd "${cargo_toml_dir}" && \ CARGO_TARGET_DIR="${abs_top_builddir:-../../..}/src/rust/target" \ - CARGO_HOME="${abs_top_builddir:-../../..}/src/rust/.cargo" \ "${CARGO:-cargo}" test ${CARGO_ONLINE-"--frozen"} \ ${EXTRA_CARGO_OPTIONS} \ --manifest-path "${cargo_toml_dir}/Cargo.toml" || exitcode=1 -- cgit v1.2.3-54-g00ecf From c9ad16ca2a2aff63fc4814c843cd376c76e43095 Mon Sep 17 00:00:00 2001 From: teor Date: Fri, 10 Aug 2018 11:22:36 +1000 Subject: Fix $abs_top_srcdir in test_rust.sh Consistently use ../../.. as a fallback for $abs_top_srcdir in test_rust.sh. Fixes bug 27093; bugfix on 0.3.4.3-alpha. --- changes/bug27093 | 3 +++ src/test/test_rust.sh | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changes/bug27093 (limited to 'src/test') diff --git a/changes/bug27093 b/changes/bug27093 new file mode 100644 index 0000000000..6c097f1196 --- /dev/null +++ b/changes/bug27093 @@ -0,0 +1,3 @@ + o Minor bugfixes (rust): + - Consistently use ../../.. as a fallback for $abs_top_srcdir in + test_rust.sh. Fixes bug 27093; bugfix on 0.3.4.3-alpha. diff --git a/src/test/test_rust.sh b/src/test/test_rust.sh index 9ad7a698ad..2761b612b5 100755 --- a/src/test/test_rust.sh +++ b/src/test/test_rust.sh @@ -3,7 +3,7 @@ set -e -export LSAN_OPTIONS=suppressions=${abs_top_srcdir}/src/test/rust_supp.txt +export LSAN_OPTIONS=suppressions=${abs_top_srcdir:-../../..}/src/test/rust_supp.txt for cargo_toml_dir in "${abs_top_srcdir:-../../..}"/src/rust/*; do if [ -e "${cargo_toml_dir}/Cargo.toml" ]; then -- cgit v1.2.3-54-g00ecf