@@ -12,6 +12,7 @@ set -ex
12
12
13
13
export RUSTFLAGS=" ${RUSTFLAGS} -D warnings -Z merge-functions=disabled "
14
14
export HOST_RUSTFLAGS=" ${RUSTFLAGS} "
15
+ export PROFILE=" ${PROFILE:= " --profile=release" } "
15
16
16
17
export STDARCH_DISABLE_DEDUP_GUARD=1
17
18
@@ -63,6 +64,7 @@ echo "FEATURES=${FEATURES}"
63
64
echo " OBJDUMP=${OBJDUMP} "
64
65
echo " STDARCH_DISABLE_ASSERT_INSTR=${STDARCH_DISABLE_ASSERT_INSTR} "
65
66
echo " STDARCH_TEST_EVERYTHING=${STDARCH_TEST_EVERYTHING} "
67
+ echo " PROFILE=${PROFILE} "
66
68
67
69
cargo_test () {
68
70
cmd=" cargo"
@@ -101,46 +103,44 @@ STD_DETECT="--manifest-path=crates/std_detect/Cargo.toml"
101
103
STDARCH_EXAMPLES=" --manifest-path=examples/Cargo.toml"
102
104
INTRINSIC_TEST=" --manifest-path=crates/intrinsic-test/Cargo.toml"
103
105
104
- cargo_test " ${CORE_ARCH} --release "
106
+ cargo_test " ${CORE_ARCH} ${PROFILE} "
105
107
106
108
if [ " $NOSTD " != " 1" ]; then
107
- cargo_test " ${STD_DETECT} "
108
- cargo_test " ${STD_DETECT} --release"
109
+ cargo_test " ${STD_DETECT} ${PROFILE} "
109
110
110
111
cargo_test " ${STD_DETECT} --no-default-features"
111
112
cargo_test " ${STD_DETECT} --no-default-features --features=std_detect_file_io"
112
113
cargo_test " ${STD_DETECT} --no-default-features --features=std_detect_dlsym_getauxval"
113
114
cargo_test " ${STD_DETECT} --no-default-features --features=std_detect_dlsym_getauxval,std_detect_file_io"
114
115
115
- cargo_test " ${STDARCH_EXAMPLES} "
116
- cargo_test " ${STDARCH_EXAMPLES} --release"
116
+ cargo_test " ${STDARCH_EXAMPLES} ${PROFILE} "
117
117
fi
118
118
119
119
# Test targets compiled with extra features.
120
120
case ${TARGET} in
121
121
x86* )
122
122
export STDARCH_DISABLE_ASSERT_INSTR=1
123
123
export RUSTFLAGS=" ${RUSTFLAGS} -C target-feature=+avx"
124
- cargo_test " --release "
124
+ cargo_test " ${PROFILE} "
125
125
;;
126
126
# FIXME: don't build anymore
127
127
# mips-*gnu* | mipsel-*gnu*)
128
128
# export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+msa,+fp64,+mips32r5"
129
- # cargo_test "--release "
129
+ # cargo_test "${PROFILE} "
130
130
# ;;
131
131
mips64* )
132
132
export RUSTFLAGS=" ${RUSTFLAGS} -C target-feature=+msa"
133
- cargo_test " --release "
133
+ cargo_test " ${PROFILE} "
134
134
;;
135
135
powerpc64* )
136
136
# We don't build the ppc 32-bit targets with these - these targets
137
137
# are mostly unsupported for now.
138
138
OLD_RUSTFLAGS=" ${RUSTFLAGS} "
139
139
export RUSTFLAGS=" ${OLD_RUSTFLAGS} -C target-feature=+altivec"
140
- cargo_test " --release "
140
+ cargo_test " ${PROFILE} "
141
141
142
142
export RUSTFLAGS=" ${OLD_RUSTFLAGS} -C target-feature=+vsx"
143
- cargo_test " --release "
143
+ cargo_test " ${PROFILE} "
144
144
;;
145
145
* )
146
146
;;
@@ -152,22 +152,22 @@ if [ "${TARGET}" = "aarch64-unknown-linux-gnu" ]; then
152
152
CPPFLAGS=" -fuse-ld=lld -I/usr/aarch64-linux-gnu/include/ -I/usr/aarch64-linux-gnu/include/c++/9/aarch64-linux-gnu/" \
153
153
RUSTFLAGS=" $HOST_RUSTFLAGS " \
154
154
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
156
156
)
157
157
elif [ " ${TARGET} " = " armv7-unknown-linux-gnueabihf" ]; then
158
158
(
159
159
CPPFLAGS=" -fuse-ld=lld -I/usr/arm-linux-gnueabihf/include/ -I/usr/arm-linux-gnueabihf/include/c++/9/arm-linux-gnueabihf/" \
160
160
RUSTFLAGS=" $HOST_RUSTFLAGS " \
161
161
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
163
163
)
164
164
fi
165
165
166
166
if [ " $NORUN " != " 1" ] && [ " $NOSTD " != 1 ]; then
167
167
# Test examples
168
168
(
169
169
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
172
172
)
173
173
fi
0 commit comments