Skip to content

Commit 885431e

Browse files
author
Jorge Aparicio
committed
reduce number of targets to test the "weak" feature
1 parent 870712b commit 885431e

File tree

2 files changed

+27
-33
lines changed

2 files changed

+27
-33
lines changed

.travis.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,12 @@ matrix:
3030
os: linux
3131
- env: TARGET=powerpc64le-unknown-linux-gnu
3232
os: linux
33-
- env: TARGET=thumbv6m-none-eabi
34-
os: linux
3533
- env: TARGET=thumbv6m-none-eabi WEAK=true
3634
os: linux
37-
- env: TARGET=thumbv7em-none-eabi
38-
os: linux
3935
- env: TARGET=thumbv7em-none-eabi WEAK=true
4036
os: linux
41-
- env: TARGET=thumbv7em-none-eabihf
42-
os: linux
4337
- env: TARGET=thumbv7em-none-eabihf WEAK=true
4438
os: linux
45-
- env: TARGET=thumbv7m-none-eabi
46-
os: linux
4739
- env: TARGET=thumbv7m-none-eabi WEAK=true
4840
os: linux
4941
- env: TARGET=x86_64-apple-darwin

ci/script.sh

Lines changed: 27 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,8 @@ gist_it() {
88
}
99

1010
build() {
11-
if [[ $WEAK ]]; then
12-
$CARGO build --features weak --target $TARGET
13-
$CARGO build --features weak --target $TARGET --release
14-
else
15-
$CARGO build --target $TARGET
16-
$CARGO build --target $TARGET --release
17-
fi
11+
$CARGO build --target $TARGET
12+
$CARGO build --target $TARGET --release
1813
}
1914

2015
inspect() {
@@ -23,24 +18,6 @@ inspect() {
2318
set +e
2419
$PREFIX$OBJDUMP -Cd target/**/release/*.rlib | gist_it
2520
set -e
26-
27-
# Check presence/absence of weak symbols
28-
if [[ $WEAK ]]; then
29-
local symbols=( memcmp memcpy memmove memset )
30-
for symbol in "${symbols[@]}"; do
31-
$PREFIX$NM target/$TARGET/debug/deps/librlibc-*.rlib | grep -q "W $symbol"
32-
done
33-
else
34-
set +e
35-
ls target/$TARGET/debug/deps/librlibc-*.rlib
36-
37-
if [[ $? == 0 ]]; then
38-
exit 1
39-
fi
40-
41-
set -e
42-
fi
43-
4421
}
4522

4623
run_tests() {
@@ -68,6 +45,30 @@ c_test() {
6845
set -e
6946
}
7047

48+
# Check presence/absence of weak symbols
49+
weak_test() {
50+
if [[ $WEAK ]]; then
51+
$CARGO clean
52+
53+
$CARGO build --features weak --target $TARGET
54+
$CARGO build --features weak --target $TARGET --release
55+
56+
local symbols=( memcmp memcpy memmove memset )
57+
for symbol in "${symbols[@]}"; do
58+
$PREFIX$NM target/$TARGET/debug/deps/librlibc-*.rlib | grep -q "W $symbol"
59+
done
60+
else
61+
set +e
62+
ls target/$TARGET/debug/deps/librlibc-*.rlib
63+
64+
if [[ $? == 0 ]]; then
65+
exit 1
66+
fi
67+
68+
set -e
69+
fi
70+
}
71+
7172
main() {
7273
if [[ $LINUX && ${IN_DOCKER_CONTAINER:-n} == n ]]; then
7374
# NOTE The Dockerfile of this image is in the docker branch of this repository
@@ -89,6 +90,7 @@ main() {
8990
inspect
9091
run_tests
9192
c_test
93+
weak_test
9294
fi
9395
}
9496

0 commit comments

Comments
 (0)