compiler-builtins-zynq/ci/script.sh

76 lines
1.8 KiB
Bash
Raw Normal View History

2016-08-08 05:55:30 +08:00
set -ex
. $(dirname $0)/env.sh
gist_it() {
gist -ap -f "'$1' from commit '$TRAVIS_COMMIT' on branch '$TRAVIS_BRANCH'"
echo "Disassembly available at the above URL."
}
2016-08-08 06:03:44 +08:00
build() {
2016-08-14 00:32:52 +08:00
${CARGO:-cargo} build --target $TARGET
${CARGO:-cargo} build --target $TARGET --release
2016-08-08 05:55:30 +08:00
}
inspect() {
$PREFIX$NM -g --defined-only target/**/debug/*.rlib
2016-08-14 01:26:58 +08:00
set +e
2016-08-14 01:26:58 +08:00
case $TRAVIS_OS_NAME in
linux)
$PREFIX$OBJDUMP -Cd target/**/release/*.rlib | gist_it "$TARGET/rustc-builtins.rlib"
;;
osx)
$PREFIX$OBJDUMP -Cd target/**/release/*.rlib
2016-08-14 01:26:58 +08:00
;;
esac
set -e
# Check presence of weak symbols
if [[ $TRAVIS_OS_NAME = "linux" ]]; then
local symbols=( memcmp memcpy memmove memset )
for symbol in "${symbols[@]}"; do
$PREFIX$NM target/**/debug/deps/librlibc*.rlib | grep -q "W $symbol"
done
fi
}
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-14 06:45:43 +08:00
if [[ ${RUN_TESTS:-y} == "y" ]]; then
2016-08-09 09:04:17 +08:00
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
main() {
2016-08-14 06:36:00 +08:00
if [[ $TRAVIS_OS_NAME == "linux" && ${IN_DOCKER_CONTAINER:-n} == "n" ]]; then
local tag=2016-08-22
2016-08-09 09:37:04 +08:00
docker run \
--privileged \
-e IN_DOCKER_CONTAINER=y \
2016-08-09 09:37:04 +08:00
-e TARGET=$TARGET \
-e TRAVIS_BRANCH=$TRAVIS_BRANCH \
-e TRAVIS_COMMIT=$TRAVIS_COMMIT \
2016-08-09 09:37:04 +08:00
-e TRAVIS_OS_NAME=$TRAVIS_OS_NAME \
2016-08-09 09:41:08 +08:00
-v $(pwd):/mnt \
japaric/rustc-builtins:$tag \
2016-08-09 10:14:04 +08:00
sh -c 'set -ex;
cd /mnt;
export PATH="$PATH:/root/.cargo/bin";
2016-08-09 10:02:07 +08:00
bash ci/install.sh;
bash ci/script.sh'
2016-08-09 09:37:04 +08:00
else
build
inspect
2016-08-14 00:32:52 +08:00
run_tests
2016-08-09 09:37:04 +08:00
fi
2016-08-08 05:55:30 +08:00
}
main