@@ -12,6 +12,7 @@ set -ex
1212
1313export RUSTFLAGS=" ${RUSTFLAGS} -D warnings -Z merge-functions=disabled "
1414export HOST_RUSTFLAGS=" ${RUSTFLAGS} "
15+ export PROFILE=" ${PROFILE:= " --profile=release" } "
1516
1617export STDARCH_DISABLE_DEDUP_GUARD=1
1718
@@ -63,6 +64,7 @@ echo "FEATURES=${FEATURES}"
6364echo " OBJDUMP=${OBJDUMP} "
6465echo " STDARCH_DISABLE_ASSERT_INSTR=${STDARCH_DISABLE_ASSERT_INSTR} "
6566echo " STDARCH_TEST_EVERYTHING=${STDARCH_TEST_EVERYTHING} "
67+ echo " PROFILE=${PROFILE} "
6668
6769cargo_test () {
6870 cmd=" cargo"
@@ -101,46 +103,44 @@ STD_DETECT="--manifest-path=crates/std_detect/Cargo.toml"
101103STDARCH_EXAMPLES=" --manifest-path=examples/Cargo.toml"
102104INTRINSIC_TEST=" --manifest-path=crates/intrinsic-test/Cargo.toml"
103105
104- cargo_test " ${CORE_ARCH} --release "
106+ cargo_test " ${CORE_ARCH} ${PROFILE} "
105107
106108if [ " $NOSTD " != " 1" ]; then
107- cargo_test " ${STD_DETECT} "
108- cargo_test " ${STD_DETECT} --release"
109+ cargo_test " ${STD_DETECT} ${PROFILE} "
109110
110111 cargo_test " ${STD_DETECT} --no-default-features"
111112 cargo_test " ${STD_DETECT} --no-default-features --features=std_detect_file_io"
112113 cargo_test " ${STD_DETECT} --no-default-features --features=std_detect_dlsym_getauxval"
113114 cargo_test " ${STD_DETECT} --no-default-features --features=std_detect_dlsym_getauxval,std_detect_file_io"
114115
115- cargo_test " ${STDARCH_EXAMPLES} "
116- cargo_test " ${STDARCH_EXAMPLES} --release"
116+ cargo_test " ${STDARCH_EXAMPLES} ${PROFILE} "
117117fi
118118
119119# Test targets compiled with extra features.
120120case ${TARGET} in
121121 x86* )
122122 export STDARCH_DISABLE_ASSERT_INSTR=1
123123 export RUSTFLAGS=" ${RUSTFLAGS} -C target-feature=+avx"
124- cargo_test " --release "
124+ cargo_test " ${PROFILE} "
125125 ;;
126126 # FIXME: don't build anymore
127127 # mips-*gnu* | mipsel-*gnu*)
128128 # export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+msa,+fp64,+mips32r5"
129- # cargo_test "--release "
129+ # cargo_test "${PROFILE} "
130130 # ;;
131131 mips64* )
132132 export RUSTFLAGS=" ${RUSTFLAGS} -C target-feature=+msa"
133- cargo_test " --release "
133+ cargo_test " ${PROFILE} "
134134 ;;
135135 powerpc64* )
136136 # We don't build the ppc 32-bit targets with these - these targets
137137 # are mostly unsupported for now.
138138 OLD_RUSTFLAGS=" ${RUSTFLAGS} "
139139 export RUSTFLAGS=" ${OLD_RUSTFLAGS} -C target-feature=+altivec"
140- cargo_test " --release "
140+ cargo_test " ${PROFILE} "
141141
142142 export RUSTFLAGS=" ${OLD_RUSTFLAGS} -C target-feature=+vsx"
143- cargo_test " --release "
143+ cargo_test " ${PROFILE} "
144144 ;;
145145 * )
146146 ;;
@@ -152,22 +152,22 @@ if [ "${TARGET}" = "aarch64-unknown-linux-gnu" ]; then
152152 CPPFLAGS=" -fuse-ld=lld -I/usr/aarch64-linux-gnu/include/ -I/usr/aarch64-linux-gnu/include/c++/9/aarch64-linux-gnu/" \
153153 RUSTFLAGS=" $HOST_RUSTFLAGS " \
154154 RUST_LOG=warn \
155- cargo run ${INTRINSIC_TEST} --release --bin intrinsic-test -- intrinsics_data/arm_intrinsics.json --runner " ${CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER} " --cppcompiler " clang++-15" --skip crates/intrinsic-test/missing_aarch64.txt
155+ cargo run ${INTRINSIC_TEST} " ${PROFILE} " --bin intrinsic-test -- intrinsics_data/arm_intrinsics.json --runner " ${CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUNNER} " --cppcompiler " clang++-15" --skip crates/intrinsic-test/missing_aarch64.txt
156156 )
157157elif [ " ${TARGET} " = " armv7-unknown-linux-gnueabihf" ]; then
158158 (
159159 CPPFLAGS=" -fuse-ld=lld -I/usr/arm-linux-gnueabihf/include/ -I/usr/arm-linux-gnueabihf/include/c++/9/arm-linux-gnueabihf/" \
160160 RUSTFLAGS=" $HOST_RUSTFLAGS " \
161161 RUST_LOG=warn \
162- cargo run ${INTRINSIC_TEST} --release --bin intrinsic-test -- intrinsics_data/arm_intrinsics.json --runner " ${CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER} " --cppcompiler " clang++-15" --skip crates/intrinsic-test/missing_arm.txt --a32
162+ cargo run ${INTRINSIC_TEST} " ${PROFILE} " --bin intrinsic-test -- intrinsics_data/arm_intrinsics.json --runner " ${CARGO_TARGET_ARMV7_UNKNOWN_LINUX_GNUEABIHF_RUNNER} " --cppcompiler " clang++-15" --skip crates/intrinsic-test/missing_arm.txt --a32
163163 )
164164fi
165165
166166if [ " $NORUN " != " 1" ] && [ " $NOSTD " != 1 ]; then
167167 # Test examples
168168 (
169169 cd examples
170- cargo test --target " $TARGET "
171- echo test | cargo run --target " $TARGET " --release hex
170+ cargo test --target " $TARGET " " ${PROFILE} "
171+ echo test | cargo run --target " $TARGET " " ${PROFILE} " hex
172172 )
173173fi
0 commit comments