33set -e
44
55CRATE=num
6- MSRV=1.31
6+ MSRV=1.60
77
88get_rust_version () {
99 local array=($( rustc --version) );
@@ -27,21 +27,15 @@ if ! check_version $MSRV ; then
2727 exit 1
2828fi
2929
30- STD_FEATURES=(libm serde)
30+ STD_FEATURES=(libm serde rand)
31+ ALLOC_FEATURES=(libm serde rand)
3132NO_STD_FEATURES=(libm)
32- check_version 1.36 && STD_FEATURES+=(rand)
33- check_version 1.36 && ALLOC_FEATURES=(libm serde rand)
3433echo " Testing supported features: ${STD_FEATURES[*]} "
34+ echo " alloc supported features: ${ALLOC_FEATURES[*]} "
3535echo " no_std supported features: ${NO_STD_FEATURES[*]} "
36- if [ -n " ${ALLOC_FEATURES[*]} " ]; then
37- echo " alloc supported features: ${ALLOC_FEATURES[*]} "
38- fi
3936
4037cargo generate-lockfile
4138
42- # libm 0.2.6 started using {float}::EPSILON
43- check_version 1.43 || cargo update -p libm --precise 0.2.5
44-
4539set -x
4640
4741# test the default with std
@@ -74,18 +68,16 @@ cargo build --no-default-features --features="${NO_STD_FEATURES[*]}"
7468cargo test --no-default-features --features=" ${NO_STD_FEATURES[*]} "
7569
7670
77- if [ -n " ${ALLOC_FEATURES[*]} " ]; then
78- # test minimal with alloc
79- cargo build --no-default-features --features=" alloc"
80- cargo test --no-default-features --features=" alloc"
71+ # test minimal with alloc
72+ cargo build --no-default-features --features=" alloc"
73+ cargo test --no-default-features --features=" alloc"
8174
82- # test each isolated feature with alloc
83- for feature in ${ALLOC_FEATURES[*]} ; do
84- cargo build --no-default-features --features=" alloc $feature "
85- cargo test --no-default-features --features=" alloc $feature "
86- done
75+ # test each isolated feature with alloc
76+ for feature in ${ALLOC_FEATURES[*]} ; do
77+ cargo build --no-default-features --features=" alloc $feature "
78+ cargo test --no-default-features --features=" alloc $feature "
79+ done
8780
88- # test all supported features with alloc
89- cargo build --no-default-features --features=" alloc ${ALLOC_FEATURES[*]} "
90- cargo test --no-default-features --features=" alloc ${ALLOC_FEATURES[*]} "
91- fi
81+ # test all supported features with alloc
82+ cargo build --no-default-features --features=" alloc ${ALLOC_FEATURES[*]} "
83+ cargo test --no-default-features --features=" alloc ${ALLOC_FEATURES[*]} "
0 commit comments