|
3 | 3 | set -eux |
4 | 4 |
|
5 | 5 | export RUST_BACKTRACE="${RUST_BACKTRACE:-full}" |
6 | | -# Needed for no-panic to correct detect a lack of panics |
7 | | -export RUSTFLAGS="${RUSTFLAGS:-} -Ccodegen-units=1" |
8 | 6 |
|
9 | 7 | target="${1:-}" |
10 | 8 |
|
|
69 | 67 | cargo check -p libm --no-default-features |
70 | 68 |
|
71 | 69 | if [ "${BUILD_ONLY:-}" = "1" ]; then |
| 70 | + # If we are on targets that can't run tests, verify that we can build. |
72 | 71 | cmd="cargo build --target $target --package libm" |
73 | 72 | $cmd |
74 | 73 | $cmd --features unstable-intrinsics |
75 | 74 |
|
76 | 75 | echo "can't run tests on $target; skipping" |
77 | | -else |
78 | | - cmd="cargo test --all --target $target $extra_flags" |
| 76 | + exit |
| 77 | +fi |
79 | 78 |
|
80 | | - # Test once without intrinsics |
81 | | - $cmd |
| 79 | +# Otherwise, run the test suite. |
82 | 80 |
|
83 | | - # Exclude the macros and utile crates from the rest of the tests to save CI |
84 | | - # runtime, they shouldn't have anything feature- or opt-level-dependent. |
85 | | - cmd="$cmd --exclude util --exclude libm-macros" |
| 81 | +cmd="cargo test --all --target $target $extra_flags" |
86 | 82 |
|
87 | | - # Test once with intrinsics enabled |
88 | | - $cmd --features unstable-intrinsics |
89 | | - $cmd --features unstable-intrinsics --benches |
90 | | - |
91 | | - # Test the same in release mode, which also increases coverage. Also ensure |
92 | | - # the soft float routines are checked. |
93 | | - $cmd --profile release-checked |
94 | | - $cmd --profile release-checked --features force-soft-floats |
95 | | - $cmd --profile release-checked --features unstable-intrinsics |
96 | | - $cmd --profile release-checked --features unstable-intrinsics --benches |
97 | | - |
98 | | - # Ensure that the routines do not panic. |
99 | | - ENSURE_NO_PANIC=1 cargo build -p libm --target "$target" --no-default-features --release |
100 | | -fi |
| 83 | +# Test once without intrinsics |
| 84 | +$cmd |
| 85 | + |
| 86 | +# Exclude the macros and utile crates from the rest of the tests to save CI |
| 87 | +# runtime, they shouldn't have anything feature- or opt-level-dependent. |
| 88 | +cmd="$cmd --exclude util --exclude libm-macros" |
| 89 | + |
| 90 | +# Test once with intrinsics enabled |
| 91 | +$cmd --features unstable-intrinsics |
| 92 | +$cmd --features unstable-intrinsics --benches |
| 93 | + |
| 94 | +# Test the same in release mode, which also increases coverage. Also ensure |
| 95 | +# the soft float routines are checked. |
| 96 | +$cmd --profile release-checked |
| 97 | +$cmd --profile release-checked --features force-soft-floats |
| 98 | +$cmd --profile release-checked --features unstable-intrinsics |
| 99 | +$cmd --profile release-checked --features unstable-intrinsics --benches |
101 | 100 |
|
| 101 | +# Ensure that the routines do not panic. |
| 102 | +ENSURE_NO_PANIC=1 cargo build -p libm --target "$target" --no-default-features --release |
0 commit comments