libm/ci/script.sh
Jorge Aparicio ce02130e55 omit bounds check in release mode
this eliminates panicking branches in the optimized version of the functions. We keep the bounds
checks when running the test suite to check that we never do an out of bounds access.

This commit also adds a "must link" test that ensures that future changes in our implementation
won't add panicking branches.

closes #129
2018-07-25 13:16:10 -05:00

36 lines
848 B
Bash

set -euxo pipefail
main() {
if [ $TARGET = cargo-fmt ]; then
cargo fmt -- --check
return
fi
# quick check
cargo check
# check that we can source import libm into compiler-builtins
cargo check --package cb
# test that the functions don't contain invocations of `panic!`
case $TARGET in
armv7-unknown-linux-gnueabihf)
cross build --release --target $TARGET --example no-panic
;;
esac
# run unit tests
cross test --lib --features checked --target $TARGET --release
# generate tests
cargo run --package test-generator --target x86_64-unknown-linux-musl
# run generated tests
cross test --tests --features checked --target $TARGET --release
# TODO need to fix overflow issues (cf. issue #4)
# cross test --target $TARGET
}
main