set -e
if [[ $(uname) == MINGW* ]]; then
export GMP_MPFR_SYS_CACHE="$(cmd /c cd)\\cache"
else
export GMP_MPFR_SYS_CACHE="$(pwd)/cache"
fi
if [ -e cache ]; then
rm -r cache
fi
suffix=""
if [[ "$1" == "-"* ]]; then
suffix="$1"
shift
fi
if [ $# == 0 ]; then
toolchains=(stable beta nightly 1.18.0 1.17.0)
else
toolchains=("$@")
fi
function print_eval {
printf '$'
printf ' %q' "$@"
printf '\n'
eval $(printf '%q ' "$@")
}
for features in gmp-mpfr-sys/mpc "" gmp-mpfr-sys gmp-mpfr-sys/mpfr integer rational float complex rand; do
if [ -e target ]; then
rm -r target
fi
if [ "$features" == "" ]; then
gmp=""
else
gmp="-p gmp-mpfr-sys"
fi
for build in --release ""; do
print_eval cargo +${toolchains[0]}"$suffix" test $build \
--no-default-features --features "$features" \
$gmp -p rug
rm -r target
done
done
for toolchain in "${toolchains[@]}"; do
if [ -e target ]; then
rm -r target
fi
for build in "" --release; do
print_eval cargo +$toolchain"$suffix" test $build \
-p gmp-mpfr-sys -p rug
rm -r target
done
done
cargo +stable"$suffix" check -p gmp-mpfr-sys
cargo +stable"$suffix" check --release -p gmp-mpfr-sys
cargo +nightly"$suffix" check -p gmp-mpfr-sys
cargo +nightly"$suffix" check --release -p gmp-mpfr-sys
rm -r cache