"Fossies" - the Fresh Open Source Software Archive

Member "tor-0.4.1.6/src/test/test_rust.sh" (10 Jun 2019, 1087 Bytes) of package /linux/misc/tor-0.4.1.6.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "test_rust.sh": 0.4.0.5_vs_0.4.1.5.

    1 #!/bin/sh
    2 # Test all Rust crates
    3 
    4 set -e
    5 
    6 export LSAN_OPTIONS=suppressions=${abs_top_srcdir:-../../..}/src/test/rust_supp.txt
    7 
    8 # When testing Cargo we pass a number of very specific linker flags down
    9 # through Cargo. We do not, however, want these flags to affect things like
   10 # build scripts, only the tests that we're compiling. To ensure this happens
   11 # we unconditionally pass `--target` into Cargo, ensuring that `RUSTFLAGS` in
   12 # the environment won't make their way into build scripts.
   13 rustc_host=$(rustc -vV | grep host | sed 's/host: //')
   14 
   15 for cargo_toml_dir in "${abs_top_srcdir:-../../..}"/src/rust/*; do
   16     if [ -e "${cargo_toml_dir}/Cargo.toml" ]; then
   17         # shellcheck disable=SC2086
   18     cd "${abs_top_builddir:-../../..}/src/rust" && \
   19         CARGO_TARGET_DIR="${abs_top_builddir:-../../..}/src/rust/target" \
   20         "${CARGO:-cargo}" test "${CARGO_ONLINE-'--frozen'}" \
   21             --features "test_linking_hack" \
   22             --target "$rustc_host" \
   23         ${EXTRA_CARGO_OPTIONS} \
   24         --manifest-path "${cargo_toml_dir}/Cargo.toml" || exitcode=1
   25     fi
   26 done
   27 
   28 exit $exitcode