1
Fork 0

Refactor build scripts to all go through new build_tc.

This commit is contained in:
Alex Helfet 2017-12-29 01:27:12 +00:00
parent 6a1ef6d6cb
commit acfbb09bd3
3 changed files with 42 additions and 36 deletions

View file

@ -3,24 +3,8 @@ set -ex;
# A simple build script to run locally before pushing.
script_dir=$( cd $(dirname ${BASH_SOURCE[0]}); pwd )
repo_dir=${script_dir}/..
REPO_DIR=$( cd $(dirname ${BASH_SOURCE[0]})/..; pwd )
cd ${repo_dir};
for tc in nightly stable beta; do
echo "Toolchain: ${tc}";
rustup toolchain update ${tc};
export CARGO_TARGET_DIR="${repo_dir}/target/build_local/${tc}"
cargo +${tc} test -p framed --verbose;
cargo +${tc} test -p framed --verbose --no-default-features;
cargo +${tc} test -p framed --verbose --no-default-features --features=typed;
cargo +${tc} test -p framed --verbose --features=trace;
cargo +${tc} doc -p framed --verbose --no-deps;
for TC in nightly stable beta; do
TC="${TC}" ${REPO_DIR}/bin/build_tc
done
DECODE_TYPE_CRATE_DIR=test_type \
DECODE_TYPE_NAME=framed_test_type::Test \
bin/decode_typed < /dev/null;

37
bin/build_tc Executable file
View file

@ -0,0 +1,37 @@
#!/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 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;
# 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;
# TODO: Use correct toolchain.
DECODE_TYPE_CRATE_DIR=${REPO_DIR}/test_type \
DECODE_TYPE_NAME=framed_test_type::Test \
${REPO_DIR}/bin/decode_typed < /dev/null;

View file

@ -1,21 +1,6 @@
#!/usr/bin/env bash
set -e;
script_dir=$( cd $(dirname ${BASH_SOURCE[0]}); pwd )
repo_dir=${script_dir}/../..
REPO_DIR=$( cd $(dirname ${BASH_SOURCE[0]})/../..; pwd )
echo "TRAVIS_RUST_VERSION: '${TRAVIS_RUST_VERSION}'"
set -x;
cd ${repo_dir};
cargo test -p framed --verbose;
cargo test -p framed --verbose --no-default-features;
cargo test -p framed --verbose --no-default-features --features=typed;
cargo test -p framed --verbose --features=trace;
cargo doc -p framed --verbose --no-deps;
DECODE_TYPE_CRATE_DIR=test_type \
DECODE_TYPE_NAME=framed_test_type::Test \
bin/decode_typed < /dev/null;
TC="${TRAVIS_RUST_VERSION}" ${REPO_DIR}/bin/build_tc