compiler-builtins-zynq/ci/script.sh

64 lines
1.5 KiB
Bash
Raw Normal View History

2016-08-08 05:55:30 +08:00
set -ex
. $(dirname $0)/env.sh
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
$PREFIX$OBJDUMP -Cd target/**/debug/*.rlib
$PREFIX$OBJDUMP -Cd target/**/release/*.rlib
set -e
2016-08-14 01:26:58 +08:00
# Check presence of weak symbols
case $TRAVIS_OS_NAME in
linux)
local symbols=( memcmp memcpy memmove memset )
for symbol in "${symbols[@]}"; do
$PREFIX$NM target/**/debug/deps/librlibc*.rlib | grep -q "W $symbol"
2016-08-14 01:26:58 +08:00
done
;;
esac
}
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-13
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_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