@@ -19,6 +19,8 @@ gcc_master_branch=1
1919channel=" debug"
2020funcs=()
2121build_only=0
22+ nb_parts=0
23+ current_part=0
2224
2325while [[ $# -gt 0 ]]; do
2426 case $1 in
@@ -77,6 +79,19 @@ while [[ $# -gt 0 ]]; do
7779 funcs+=(extended_sysroot_tests)
7880 shift
7981 ;;
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+
8095 " --mini-tests" )
8196 funcs+=(mini_tests)
8297 shift
@@ -90,6 +105,16 @@ while [[ $# -gt 0 ]]; do
90105 build_only=1
91106 shift
92107 ;;
108+ " --nb-parts" )
109+ shift
110+ nb_parts=$1
111+ shift
112+ ;;
113+ " --current-part" )
114+ shift
115+ current_part=$1
116+ shift
117+ ;;
93118 * )
94119 echo " Unknown option $1 "
95120 exit 1
@@ -200,7 +225,7 @@ function test_libcore() {
200225# echo "[BENCH RUN] mod_bench"
201226# hyperfine --runs ${RUN_RUNS:-10} ./target/out/mod_bench{,_inline} ./target/out/mod_bench_llvm_*
202227
203- function extended_sysroot_tests () {
228+ function extended_rand_tests () {
204229 if (( $gcc_master_branch == 0 )) ; then
205230 return
206231 fi
@@ -210,17 +235,12 @@ function extended_sysroot_tests() {
210235 echo " [TEST] rust-random/rand"
211236 ../cargo.sh test --workspace
212237 popd
238+ }
213239
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
224244
225245 pushd regex
226246 echo " [TEST] rust-lang/regex example shootout-regex-dna"
@@ -232,12 +252,38 @@ function extended_sysroot_tests() {
232252 | ../cargo.sh run --example shootout-regex-dna \
233253 | grep -v " Spawned thread" > res.txt
234254 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
235262
263+ pushd regex
236264 echo " [TEST] rust-lang/regex tests"
265+ export CG_RUSTFLAGS=" --cap-lints warn" # newer aho_corasick versions throw a deprecation warning
237266 ../cargo.sh test --tests -- --exclude-should-panic --test-threads 1 -Zunstable-options -q
238267 popd
239268}
240269
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+
241287function test_rustc() {
242288 echo
243289 echo " [TEST] rust-lang/rust"
297343 xargs -a ../failing-ui-tests.txt -d' \n' git checkout --
298344 fi
299345
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+
300360 echo " [TEST] rustc test suite"
301361 COMPILETEST_FORCE_STAGE0=1 ./x.py test --run always --stage 0 src/test/ui/ --rustc-args " $RUSTC_ARGS "
302362}
0 commit comments