@@ -19,6 +19,8 @@ gcc_master_branch=1
19
19
channel=" debug"
20
20
funcs=()
21
21
build_only=0
22
+ nb_parts=0
23
+ current_part=0
22
24
23
25
while [[ $# -gt 0 ]]; do
24
26
case $1 in
@@ -77,6 +79,19 @@ while [[ $# -gt 0 ]]; do
77
79
funcs+=(extended_sysroot_tests)
78
80
shift
79
81
;;
82
+ " --extended-rand-tests" )
83
+ funcs+=(extended_rand_tests)
84
+ shift
85
+ ;;
86
+ " --extended-regex-example-tests" )
87
+ funcs+=(extended_regex_example_tests)
88
+ shift
89
+ ;;
90
+ " --extended-regex-tests" )
91
+ funcs+=(extended_regex_tests)
92
+ shift
93
+ ;;
94
+
80
95
" --mini-tests" )
81
96
funcs+=(mini_tests)
82
97
shift
@@ -90,6 +105,16 @@ while [[ $# -gt 0 ]]; do
90
105
build_only=1
91
106
shift
92
107
;;
108
+ " --nb-parts" )
109
+ shift
110
+ nb_parts=$1
111
+ shift
112
+ ;;
113
+ " --current-part" )
114
+ shift
115
+ current_part=$1
116
+ shift
117
+ ;;
93
118
* )
94
119
echo " Unknown option $1 "
95
120
exit 1
@@ -200,7 +225,7 @@ function test_libcore() {
200
225
# echo "[BENCH RUN] mod_bench"
201
226
# hyperfine --runs ${RUN_RUNS:-10} ./target/out/mod_bench{,_inline} ./target/out/mod_bench_llvm_*
202
227
203
- function extended_sysroot_tests () {
228
+ function extended_rand_tests () {
204
229
if (( $gcc_master_branch == 0 )) ; then
205
230
return
206
231
fi
@@ -210,17 +235,12 @@ function extended_sysroot_tests() {
210
235
echo " [TEST] rust-random/rand"
211
236
../cargo.sh test --workspace
212
237
popd
238
+ }
213
239
214
- # pushd simple-raytracer
215
- # echo "[BENCH COMPILE] ebobby/simple-raytracer"
216
- # hyperfine --runs "${RUN_RUNS:-10}" --warmup 1 --prepare "cargo clean" \
217
- # "RUSTC=rustc RUSTFLAGS='' cargo build" \
218
- # "../cargo.sh build"
219
-
220
- # echo "[BENCH RUN] ebobby/simple-raytracer"
221
- # cp ./target/debug/main ./raytracer_cg_gcc
222
- # hyperfine --runs "${RUN_RUNS:-10}" ./raytracer_cg_llvm ./raytracer_cg_gcc
223
- # popd
240
+ function extended_regex_example_tests() {
241
+ if (( $gcc_master_branch == 0 )) ; then
242
+ return
243
+ fi
224
244
225
245
pushd regex
226
246
echo " [TEST] rust-lang/regex example shootout-regex-dna"
@@ -232,12 +252,38 @@ function extended_sysroot_tests() {
232
252
| ../cargo.sh run --example shootout-regex-dna \
233
253
| grep -v " Spawned thread" > res.txt
234
254
diff -u res.txt examples/regexdna-output.txt
255
+ popd
256
+ }
257
+
258
+ function extended_regex_tests() {
259
+ if (( $gcc_master_branch == 0 )) ; then
260
+ return
261
+ fi
235
262
263
+ pushd regex
236
264
echo " [TEST] rust-lang/regex tests"
265
+ export CG_RUSTFLAGS=" --cap-lints warn" # newer aho_corasick versions throw a deprecation warning
237
266
../cargo.sh test --tests -- --exclude-should-panic --test-threads 1 -Zunstable-options -q
238
267
popd
239
268
}
240
269
270
+ function extended_sysroot_tests() {
271
+ # pushd simple-raytracer
272
+ # echo "[BENCH COMPILE] ebobby/simple-raytracer"
273
+ # hyperfine --runs "${RUN_RUNS:-10}" --warmup 1 --prepare "cargo clean" \
274
+ # "RUSTC=rustc RUSTFLAGS='' cargo build" \
275
+ # "../cargo.sh build"
276
+
277
+ # echo "[BENCH RUN] ebobby/simple-raytracer"
278
+ # cp ./target/debug/main ./raytracer_cg_gcc
279
+ # hyperfine --runs "${RUN_RUNS:-10}" ./raytracer_cg_llvm ./raytracer_cg_gcc
280
+ # popd
281
+
282
+ extended_rand_tests
283
+ extended_regex_example_tests
284
+ extended_regex_tests
285
+ }
286
+
241
287
function test_rustc() {
242
288
echo
243
289
echo " [TEST] rust-lang/rust"
297
343
xargs -a ../failing-ui-tests.txt -d' \n' git checkout --
298
344
fi
299
345
346
+ if [ $nb_parts -gt 0 ]; then
347
+ echo " Splitting ui_test into $nb_parts parts (and running part $current_part )"
348
+ find src/test/ui -type f -name ' *.rs' -not -path " */auxiliary/*" > ui_tests
349
+ count=$(( `wc - l < ui_tests` / $nb_parts ))
350
+ # We increment the number of tests by one because if this is an odd number, we would skip
351
+ # one test.
352
+ count=$(( count + 1 ))
353
+ split -d -l $count -a 1 ui_tests ui_tests.split
354
+ # Removing all tests.
355
+ find src/test/ui -type f -name ' *.rs' -not -path " */auxiliary/*" -exec rm {} \;
356
+ # Putting back only the ones we want to test.
357
+ xargs -a " ui_tests.split$current_part " -d' \n' git checkout --
358
+ fi
359
+
300
360
echo " [TEST] rustc test suite"
301
361
COMPILETEST_FORCE_STAGE0=1 ./x.py test --run always --stage 0 src/test/ui/ --rustc-args " $RUSTC_ARGS "
302
362
}
0 commit comments