1
Fork 0

Re-use bin/decode_typed_test, pass toolchain down through it.

This commit is contained in:
Alex Helfet 2017-12-29 01:40:55 +00:00
parent acfbb09bd3
commit 3b6ff51434
3 changed files with 14 additions and 10 deletions

View file

@ -32,6 +32,4 @@ 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;
TC=${TC} ${REPO_DIR}/bin/decode_typed_test

View file

@ -8,6 +8,8 @@ E.g. \'framed-rs/test_type\'}"
DECODE_TYPE_NAME="${DECODE_TYPE_NAME?You must set this environment variable with the full name of your serialized type including its module path.
E.g. \'framed_test_type::Test\'}"
TC=${TC:stable}
echo "DECODE_TYPE_CRATE_DIR = '${DECODE_TYPE_CRATE_DIR}'"
echo "DECODE_TYPE_NAME = '${DECODE_TYPE_NAME}'"
@ -31,7 +33,7 @@ EOF
# Build user type crate.
cargo rustc \
cargo +${TC} rustc \
--manifest-path "${DECODE_TYPE_CRATE_DIR}/Cargo.toml" \
--lib \
${DECODE_TYPE_CARGO_FLAGS} \
@ -42,7 +44,7 @@ cargo rustc \
TYPE_CRATE_RLIB="$(ls "${TMP_DIR}"/lib${TYPE_CRATE_NAME}*.rlib)";
# Build decode bin.
cargo rustc \
cargo +${TC} rustc \
--manifest-path "${REPO_DIR}/decode/Cargo.toml" \
--bin framed_decode \
${DECODE_BIN_CARGO_FLAGS} \

View file

@ -3,11 +3,15 @@ set -ex
# A manual test for framed_decode.
repo_dir="$(cd $(dirname ${BASH_SOURCE[0]} )/..; pwd )"
REPO_DIR="$(cd $(dirname ${BASH_SOURCE[0]} )/..; pwd )"
cd ${REPO_DIR};
cd ${repo_dir};
TC=${TC?Supply a toolchain in this environment variable}
cargo run -p framed_test_type > target/test_output;
export DECODE_TYPE_CRATE_DIR=${REPO_DIR}/test_type
export DECODE_TYPE_NAME=framed_test_type::Test
cargo +${TC} run -p framed_test_type > target/test_output;
cat target/test_output | hd;
cat target/test_output | cargo run -p framed_decode;
seq 5 | xargs -I% cat target/test_output | cargo run -p framed_decode;
cat target/test_output | ${REPO_DIR}/bin/decode_typed;
seq 5 | xargs -I% cat target/test_output | ${REPO_DIR}/bin/decode_typed;