Skip to content

Commit 669462d

Browse files
committed
chore(ci): forward profile to shortint and integer test scripts
1 parent e759274 commit 669462d

File tree

3 files changed

+32
-13
lines changed

3 files changed

+32
-13
lines changed

Makefile

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -261,13 +261,15 @@ test_c_api: test_c_api_rs test_c_api_c
261261
test_shortint_ci: install_rs_build_toolchain install_cargo_nextest
262262
BIG_TESTS_INSTANCE="$(BIG_TESTS_INSTANCE)" \
263263
FAST_TESTS="$(FAST_TESTS)" \
264-
./scripts/shortint-tests.sh --rust-toolchain $(CARGO_RS_BUILD_TOOLCHAIN)
264+
./scripts/shortint-tests.sh --rust-toolchain $(CARGO_RS_BUILD_TOOLCHAIN) \
265+
--cargo-profile "$(CARGO_PROFILE)"
265266

266267
.PHONY: test_shortint_multi_bit_ci # Run the tests for shortint ci running only multibit tests
267268
test_shortint_multi_bit_ci: install_rs_build_toolchain install_cargo_nextest
268269
BIG_TESTS_INSTANCE="$(BIG_TESTS_INSTANCE)" \
269270
FAST_TESTS="$(FAST_TESTS)" \
270-
./scripts/shortint-tests.sh --rust-toolchain $(CARGO_RS_BUILD_TOOLCHAIN) --multi-bit
271+
./scripts/shortint-tests.sh --rust-toolchain $(CARGO_RS_BUILD_TOOLCHAIN) \
272+
--cargo-profile "$(CARGO_PROFILE)" --multi-bit
271273

272274
.PHONY: test_shortint # Run all the tests for shortint
273275
test_shortint: install_rs_build_toolchain
@@ -278,13 +280,15 @@ test_shortint: install_rs_build_toolchain
278280
test_integer_ci: install_rs_build_toolchain install_cargo_nextest
279281
BIG_TESTS_INSTANCE="$(BIG_TESTS_INSTANCE)" \
280282
FAST_TESTS="$(FAST_TESTS)" \
281-
./scripts/integer-tests.sh --rust-toolchain $(CARGO_RS_BUILD_TOOLCHAIN)
283+
./scripts/integer-tests.sh --rust-toolchain $(CARGO_RS_BUILD_TOOLCHAIN) \
284+
--cargo-profile "$(CARGO_PROFILE)"
282285

283286
.PHONY: test_integer_multi_bit_ci # Run the tests for integer ci running only multibit tests
284287
test_integer_multi_bit_ci: install_rs_build_toolchain install_cargo_nextest
285288
BIG_TESTS_INSTANCE="$(BIG_TESTS_INSTANCE)" \
286289
FAST_TESTS="$(FAST_TESTS)" \
287-
./scripts/integer-tests.sh --rust-toolchain $(CARGO_RS_BUILD_TOOLCHAIN) --multi-bit
290+
./scripts/integer-tests.sh --rust-toolchain $(CARGO_RS_BUILD_TOOLCHAIN) \
291+
--cargo-profile "$(CARGO_PROFILE)" --multi-bit
288292

289293
.PHONY: test_integer # Run all the tests for integer
290294
test_integer: install_rs_build_toolchain
@@ -294,7 +298,8 @@ test_integer: install_rs_build_toolchain
294298
.PHONY: test_high_level_api # Run all the tests for high_level_api
295299
test_high_level_api: install_rs_build_toolchain
296300
RUSTFLAGS="$(RUSTFLAGS)" cargo $(CARGO_RS_BUILD_TOOLCHAIN) test --profile $(CARGO_PROFILE) \
297-
--features=$(TARGET_ARCH_FEATURE),boolean,shortint,integer,internal-keycache -p tfhe -- high_level_api::
301+
--features=$(TARGET_ARCH_FEATURE),boolean,shortint,integer,internal-keycache -p tfhe \
302+
-- high_level_api::
298303

299304
.PHONY: test_user_doc # Run tests from the .md documentation
300305
test_user_doc: install_rs_build_toolchain

scripts/integer-tests.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,14 @@ function usage() {
88
echo "--help Print this message"
99
echo "--rust-toolchain The toolchain to run the tests with default: stable"
1010
echo "--multi-bit Run multi-bit tests only: default off"
11+
echo "--cargo-profile The cargo profile used to build tests"
1112
echo
1213
}
1314

1415
RUST_TOOLCHAIN="+stable"
1516
multi_bit=""
1617
not_multi_bit="_multi_bit"
18+
cargo_profile="release"
1719

1820
while [ -n "$1" ]
1921
do
@@ -33,6 +35,11 @@ do
3335
not_multi_bit=""
3436
;;
3537

38+
"--cargo-profile" )
39+
shift
40+
cargo_profile="$1"
41+
;;
42+
3643
*)
3744
echo "Unknown param : $1"
3845
exit 1
@@ -103,11 +110,11 @@ and not test(/.*default_add_sequence_multi_thread_param_message_3_carry_3_ks_pbs
103110

104111
if [[ "${multi_bit}" == "" ]]; then
105112
cargo "${RUST_TOOLCHAIN}" test \
106-
--release \
113+
--profile "${cargo_profile}" \
107114
--package tfhe \
108115
--features="${ARCH_FEATURE}",integer,internal-keycache \
109116
--doc \
110-
integer::
117+
-- integer::
111118
fi
112119
else
113120
if [[ "${FAST_TESTS}" != TRUE ]]; then
@@ -147,11 +154,11 @@ and not test(/.*default_add_sequence_multi_thread_param_message_3_carry_3_ks_pbs
147154

148155
if [[ "${multi_bit}" == "" ]]; then
149156
cargo "${RUST_TOOLCHAIN}" test \
150-
--release \
157+
--profile "${cargo_profile}" \
151158
--package tfhe \
152159
--features="${ARCH_FEATURE}",integer,internal-keycache \
153160
--doc \
154-
integer:: -- --test-threads="$(${nproc_bin})"
161+
-- --test-threads="$(${nproc_bin})" integer::
155162
fi
156163
fi
157164

scripts/shortint-tests.sh

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@ function usage() {
88
echo "--help Print this message"
99
echo "--rust-toolchain The toolchain to run the tests with default: stable"
1010
echo "--multi-bit Run multi-bit tests only: default off"
11+
echo "--cargo-profile The cargo profile used to build tests"
1112
echo
1213
}
1314

1415
RUST_TOOLCHAIN="+stable"
1516
multi_bit=""
17+
cargo_profile="release"
1618

1719
while [ -n "$1" ]
1820
do
@@ -31,6 +33,11 @@ do
3133
multi_bit="_multi_bit"
3234
;;
3335

36+
"--cargo-profile" )
37+
shift
38+
cargo_profile="$1"
39+
;;
40+
3441
*)
3542
echo "Unknown param : $1"
3643
exit 1
@@ -128,11 +135,11 @@ and not test(~smart_add_and_mul)"""
128135

129136
if [[ "${multi_bit}" == "" ]]; then
130137
cargo "${RUST_TOOLCHAIN}" test \
131-
--release \
138+
--profile "${cargo_profile}" \
132139
--package tfhe \
133140
--features="${ARCH_FEATURE}",shortint,internal-keycache \
134141
--doc \
135-
shortint::
142+
-- shortint::
136143
fi
137144
fi
138145
else
@@ -176,11 +183,11 @@ and not test(~smart_add_and_mul)""" # This test is too slow
176183

177184
if [[ "${multi_bit}" == "" ]]; then
178185
cargo "${RUST_TOOLCHAIN}" test \
179-
--release \
186+
--profile "${cargo_profile}" \
180187
--package tfhe \
181188
--features="${ARCH_FEATURE}",shortint,internal-keycache \
182189
--doc \
183-
shortint:: -- --test-threads="$(${nproc_bin})"
190+
-- --test-threads="$(${nproc_bin})" shortint::
184191
fi
185192
fi
186193

0 commit comments

Comments
 (0)