Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 5dcda26

Browse files
albertlarsan68antoyo
authored andcommitted
Change src/test to tests in source files, fix tidy and tests
1 parent fa874b0 commit 5dcda26

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

test.sh

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -228,15 +228,15 @@ llvm-filecheck = "`which FileCheck-10 || which FileCheck-11 || which FileCheck-1
228228
EOF
229229

230230
rustc -V | cut -d' ' -f3 | tr -d '('
231-
git checkout $(rustc -V | cut -d' ' -f3 | tr -d '(') src/test
231+
git checkout $(rustc -V | cut -d' ' -f3 | tr -d '(') tests
232232
}
233233

234234
function asm_tests() {
235235
setup_rustc
236236

237237
echo "[TEST] rustc test suite"
238238
RUSTC_ARGS="-Zpanic-abort-tests -Csymbol-mangling-version=v0 -Zcodegen-backend="$(pwd)"/../target/"$CHANNEL"/librustc_codegen_gcc."$dylib_ext" --sysroot "$(pwd)"/../build_sysroot/sysroot -Cpanic=abort"
239-
COMPILETEST_FORCE_STAGE0=1 ./x.py test --run always --stage 0 src/test/assembly/asm --rustc-args "$RUSTC_ARGS"
239+
COMPILETEST_FORCE_STAGE0=1 ./x.py test --run always --stage 0 tests/assembly/asm --rustc-args "$RUSTC_ARGS"
240240
}
241241

242242
# FIXME(antoyo): linker gives multiple definitions error on Linux
@@ -332,21 +332,21 @@ function test_rustc() {
332332

333333
setup_rustc
334334

335-
for test in $(rg -i --files-with-matches "//(\[\w+\])?~|// error-pattern:|// build-fail|// run-fail|-Cllvm-args" src/test/ui); do
335+
for test in $(rg -i --files-with-matches "//(\[\w+\])?~|// error-pattern:|// build-fail|// run-fail|-Cllvm-args" tests/ui); do
336336
rm $test
337337
done
338338

339-
git checkout -- src/test/ui/issues/auxiliary/issue-3136-a.rs # contains //~ERROR, but shouldn't be removed
339+
git checkout -- tests/ui/issues/auxiliary/issue-3136-a.rs # contains //~ERROR, but shouldn't be removed
340340

341-
rm -r src/test/ui/{abi*,extern/,unsized-locals/,proc-macro/,threads-sendsync/,thinlto/,borrowck/,chalkify/bugs/,test*,*lto*.rs,consts/const-float-bits-reject-conv.rs,consts/issue-miri-1910.rs} || true
342-
rm src/test/ui/mir/mir_heavy_promoted.rs # this tests is oom-killed in the CI.
343-
for test in $(rg --files-with-matches "thread|lto" src/test/ui); do
341+
rm -r tests/ui/{abi*,extern/,unsized-locals/,proc-macro/,threads-sendsync/,thinlto/,borrowck/,chalkify/bugs/,test*,*lto*.rs,consts/const-float-bits-reject-conv.rs,consts/issue-miri-1910.rs} || true
342+
rm tests/ui/mir/mir_heavy_promoted.rs # this tests is oom-killed in the CI.
343+
for test in $(rg --files-with-matches "thread|lto" tests/ui); do
344344
rm $test
345345
done
346-
git checkout src/test/ui/lto/auxiliary/dylib.rs
347-
git checkout src/test/ui/type-alias-impl-trait/auxiliary/cross_crate_ice.rs
348-
git checkout src/test/ui/type-alias-impl-trait/auxiliary/cross_crate_ice2.rs
349-
git checkout src/test/ui/macros/rfc-2011-nicer-assert-messages/auxiliary/common.rs
346+
git checkout tests/ui/lto/auxiliary/dylib.rs
347+
git checkout tests/ui/type-alias-impl-trait/auxiliary/cross_crate_ice.rs
348+
git checkout tests/ui/type-alias-impl-trait/auxiliary/cross_crate_ice2.rs
349+
git checkout tests/ui/macros/rfc-2011-nicer-assert-messages/auxiliary/common.rs
350350

351351
RUSTC_ARGS="$TEST_FLAGS -Csymbol-mangling-version=v0 -Zcodegen-backend="$(pwd)"/../target/"$CHANNEL"/librustc_codegen_gcc."$dylib_ext" --sysroot "$(pwd)"/../build_sysroot/sysroot"
352352

@@ -358,14 +358,14 @@ function test_rustc() {
358358
xargs -a ../failing-ui-tests.txt -d'\n' rm
359359
else
360360
# Removing all tests.
361-
find src/test/ui -type f -name '*.rs' -not -path '*/auxiliary/*' -delete
361+
find tests/ui -type f -name '*.rs' -not -path '*/auxiliary/*' -delete
362362
# Putting back only the failing ones.
363363
xargs -a ../failing-ui-tests.txt -d'\n' git checkout --
364364
fi
365365

366366
if [ $nb_parts -gt 0 ]; then
367367
echo "Splitting ui_test into $nb_parts parts (and running part $current_part)"
368-
find src/test/ui -type f -name '*.rs' -not -path "*/auxiliary/*" > ui_tests
368+
find tests/ui -type f -name '*.rs' -not -path "*/auxiliary/*" > ui_tests
369369
# To ensure it'll be always the same sub files, we sort the content.
370370
sort ui_tests -o ui_tests
371371
count=$((`wc -l < ui_tests` / $nb_parts))
@@ -374,13 +374,13 @@ function test_rustc() {
374374
count=$((count + 1))
375375
split -d -l $count -a 1 ui_tests ui_tests.split
376376
# Removing all tests.
377-
find src/test/ui -type f -name '*.rs' -not -path "*/auxiliary/*" -delete
377+
find tests/ui -type f -name '*.rs' -not -path "*/auxiliary/*" -delete
378378
# Putting back only the ones we want to test.
379379
xargs -a "ui_tests.split$current_part" -d'\n' git checkout --
380380
fi
381381

382382
echo "[TEST] rustc test suite"
383-
COMPILETEST_FORCE_STAGE0=1 ./x.py test --run always --stage 0 src/test/ui/ --rustc-args "$RUSTC_ARGS"
383+
COMPILETEST_FORCE_STAGE0=1 ./x.py test --run always --stage 0 tests/ui/ --rustc-args "$RUSTC_ARGS"
384384
}
385385

386386
function test_failing_rustc() {

0 commit comments

Comments
 (0)