2016-08-08 05:55:30 +08:00
|
|
|
set -ex
|
|
|
|
|
|
|
|
. $(dirname $0)/env.sh
|
|
|
|
|
2016-08-08 06:03:44 +08:00
|
|
|
build() {
|
|
|
|
cargo build --target $TARGET
|
|
|
|
cargo build --target $TARGET --release
|
2016-08-08 05:55:30 +08:00
|
|
|
}
|
|
|
|
|
2016-08-08 06:03:44 +08:00
|
|
|
run_tests() {
|
|
|
|
if [[ $QEMU_LD_PREFIX ]]; then
|
|
|
|
export RUST_TEST_THREADS=1
|
2016-08-08 05:55:30 +08:00
|
|
|
fi
|
|
|
|
|
2016-08-09 09:04:17 +08:00
|
|
|
if [[ $QEMU ]]; then
|
|
|
|
cargo test --target $TARGET --no-run
|
|
|
|
$QEMU target/**/debug/rustc_builtins-*
|
|
|
|
cargo test --target $TARGET --release --no-run
|
|
|
|
$QEMU target/**/release/rustc_builtins-*
|
|
|
|
else
|
|
|
|
cargo test --target $TARGET
|
|
|
|
cargo test --target $TARGET --release
|
|
|
|
fi
|
2016-08-08 06:03:44 +08:00
|
|
|
}
|
2016-08-08 05:55:30 +08:00
|
|
|
|
2016-08-08 06:03:44 +08:00
|
|
|
inspect() {
|
2016-08-08 06:29:31 +08:00
|
|
|
$PREFIX$NM -g --defined-only target/**/debug/*.rlib
|
2016-08-08 06:13:29 +08:00
|
|
|
set +e
|
2016-08-08 06:29:31 +08:00
|
|
|
$PREFIX$OBJDUMP -Cd target/**/debug/*.rlib
|
|
|
|
$PREFIX$OBJDUMP -Cd target/**/release/*.rlib
|
2016-08-08 06:13:29 +08:00
|
|
|
set -e
|
2016-08-08 05:55:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
main() {
|
2016-08-09 09:53:33 +08:00
|
|
|
if [[ $DOCKER == "y" ]]; then
|
2016-08-09 09:37:04 +08:00
|
|
|
docker run \
|
2016-08-09 10:27:08 +08:00
|
|
|
-e DOCKER=i \
|
2016-08-09 09:37:04 +08:00
|
|
|
-e TARGET=$TARGET \
|
|
|
|
-e TRAVIS_OS_NAME=$TRAVIS_OS_NAME \
|
2016-08-09 09:41:08 +08:00
|
|
|
-v $(pwd):/mnt \
|
2016-08-09 09:37:04 +08:00
|
|
|
ubuntu:16.04 \
|
2016-08-09 10:14:04 +08:00
|
|
|
sh -c 'set -ex;
|
|
|
|
cd /mnt;
|
2016-08-09 10:02:07 +08:00
|
|
|
export PATH="$PATH:$HOME/.cargo/bin";
|
|
|
|
bash ci/install.sh;
|
|
|
|
bash ci/script.sh'
|
2016-08-09 09:37:04 +08:00
|
|
|
else
|
|
|
|
build
|
|
|
|
run_tests
|
|
|
|
inspect
|
|
|
|
fi
|
2016-08-08 05:55:30 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
main
|