1
Fork 0
framed-rs/bin/build_tc

41 lines
1 KiB
Bash
Executable file

#!/usr/bin/env bash
set -e;
# Run a build with a given toolchain.
TC=${TC?Supply a toolchain in this environment variable}
echo "Rust toolchain: ${TC}"
REPO_DIR=$( cd $(dirname ${BASH_SOURCE[0]})/..; pwd )
export CARGO_TARGET_DIR="${REPO_DIR}/target/build_local/${TC}"
set -x;
rustup self update;
rustup toolchain update ${TC};
cd ${REPO_DIR}/framed;
# use_std build
cargo +${TC} test -p framed --verbose --lib;
if [[ "${TC}" == "nightly" ]]; then
# no_std build
cargo +${TC} test -p framed --verbose --lib \
--no-default-features --features=use_nightly;
rustup target add --toolchain "${TC}" thumbv7em-none-eabihf
cargo +${TC} build --verbose --lib \
--target thumbv7em-none-eabihf \
--no-default-features --features=use_nightly;
# doc tests require nightly
cargo +${TC} test -p framed --verbose --doc \
--features=use_nightly;
fi
cargo +${TC} test -p framed --verbose --lib --features=trace;
cargo +${TC} doc -p framed --verbose --no-deps;
TC=${TC} ${REPO_DIR}/bin/decode_typed_test;