Change src/test to tests in source files, fix tidy and tests

This commit is contained in:
Albert Larsan 2023-01-05 09:45:44 +01:00
parent cf2dff2b1e
commit 40ba0e84d5
No known key found for this signature in database
GPG Key ID: 92709B88BB8F13EA
137 changed files with 315 additions and 311 deletions

View File

@ -342,7 +342,7 @@ jobs:
os: macos-12-xl
- name: x86_64-apple-1
env:
SCRIPT: "./x.py --stage 2 test --exclude src/test/ui --exclude src/test/rustdoc --exclude src/test/run-make-fulldeps"
SCRIPT: "./x.py --stage 2 test --exclude tests/ui --exclude tests/rustdoc --exclude tests/run-make-fulldeps"
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
MACOSX_DEPLOYMENT_TARGET: 10.8
@ -353,7 +353,7 @@ jobs:
os: macos-12-xl
- name: x86_64-apple-2
env:
SCRIPT: "./x.py --stage 2 test src/test/ui src/test/rustdoc src/test/run-make-fulldeps"
SCRIPT: "./x.py --stage 2 test tests/ui tests/rustdoc tests/run-make-fulldeps"
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
MACOSX_DEPLOYMENT_TARGET: 10.8

4
.gitignore vendored
View File

@ -26,7 +26,7 @@ Session.vim
.valgrindrc
.cargo
# Included because it is part of the test case
!/src/test/run-make/thumb-none-qemu/example/.cargo
!/tests/run-make/thumb-none-qemu/example/.cargo
## Configuration
/config.toml
@ -74,6 +74,6 @@ package-lock.json
package.json
## Rustdoc GUI tests
src/test/rustdoc-gui/src/**.lock
tests/rustdoc-gui/src/**.lock
# Before adding new lines, see the comment at the top.

View File

@ -51,7 +51,7 @@ exclude = [
"compiler/rustc_codegen_cranelift",
"compiler/rustc_codegen_gcc",
"src/bootstrap",
"src/test/rustdoc-gui",
"tests/rustdoc-gui",
# HACK(eddyb) This hardcodes the fact that our CI uses `/checkout/obj`.
"obj",
# The `x` binary is a thin wrapper that calls `x.py`, which initializes

View File

@ -689,8 +689,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
// call (like the identity function), as otherwise type and lifetime
// inference have a hard time figuring things out.
// Without this, we would get:
// E0720 in src/test/ui/impl-trait/in-trait/default-body-with-rpit.rs
// E0700 in src/test/ui/self/self_lifetime-async.rs
// E0720 in tests/ui/impl-trait/in-trait/default-body-with-rpit.rs
// E0700 in tests/ui/self/self_lifetime-async.rs
// `future::identity_future`:
let identity_future =

View File

@ -25,7 +25,7 @@ pub use super::{
/// can, for example, happen when requesting a body of a `const` function
/// because they are evaluated during typechecking. The panic can be avoided
/// by overriding the `mir_borrowck` query. You can find a complete example
/// that shows how to do this at `src/test/run-make/obtain-borrowck/`.
/// that shows how to do this at `tests/run-make/obtain-borrowck/`.
///
/// * Polonius is highly unstable, so expect regular changes in its signature or other details.
pub fn get_body_with_borrowck_facts(

View File

@ -1737,7 +1737,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
/// We check that there's a single level of block nesting to ensure always correct
/// suggestions. If we don't, then we only provide a free-form message to avoid
/// misleading users in cases like `src/test/ui/nll/borrowed-temporary-error.rs`.
/// misleading users in cases like `tests/ui/nll/borrowed-temporary-error.rs`.
/// We could expand the analysis to suggest hoising all of the relevant parts of
/// the users' code to make the code compile, but that could be too much.
struct NestedStatementVisitor {

View File

@ -262,7 +262,7 @@ impl<'tcx> InferCtxtExt<'tcx> for InferCtxt<'tcx> {
return self.tcx.ty_error();
}
// Only check this for TAIT. RPIT already supports `src/test/ui/impl-trait/nested-return-type2.rs`
// Only check this for TAIT. RPIT already supports `tests/ui/impl-trait/nested-return-type2.rs`
// on stable and we'd break that.
let OpaqueTyOrigin::TyAlias = origin else {
return definition_ty;

View File

@ -10,118 +10,118 @@ pushd rust
command -v rg >/dev/null 2>&1 || cargo install ripgrep
rm -r src/test/ui/{extern/,unsized-locals/,lto/,linkage*} || true
for test in $(rg --files-with-matches "lto|// needs-asm-support|// needs-unwind" src/test/{ui,incremental}); do
rm -r tests/ui/{extern/,unsized-locals/,lto/,linkage*} || true
for test in $(rg --files-with-matches "lto|// needs-asm-support|// needs-unwind" tests/{ui,incremental}); do
rm $test
done
for test in $(rg -i --files-with-matches "//(\[\w+\])?~[^\|]*\s*ERR|// error-pattern:|// build-fail|// run-fail|-Cllvm-args" src/test/ui); do
for test in $(rg -i --files-with-matches "//(\[\w+\])?~[^\|]*\s*ERR|// error-pattern:|// build-fail|// run-fail|-Cllvm-args" tests/ui); do
rm $test
done
git checkout -- src/test/ui/issues/auxiliary/issue-3136-a.rs # contains //~ERROR, but shouldn't be removed
git checkout -- src/test/ui/proc-macro/pretty-print-hack/
git checkout -- tests/ui/issues/auxiliary/issue-3136-a.rs # contains //~ERROR, but shouldn't be removed
git checkout -- tests/ui/proc-macro/pretty-print-hack/
# missing features
# ================
# requires stack unwinding
rm src/test/incremental/change_crate_dep_kind.rs
rm src/test/incremental/issue-80691-bad-eval-cache.rs # -Cpanic=abort causes abort instead of exit(101)
rm tests/incremental/change_crate_dep_kind.rs
rm tests/incremental/issue-80691-bad-eval-cache.rs # -Cpanic=abort causes abort instead of exit(101)
# requires compiling with -Cpanic=unwind
rm -r src/test/ui/macros/rfc-2011-nicer-assert-messages/
rm -r src/test/run-make/test-benches
rm -r tests/ui/macros/rfc-2011-nicer-assert-messages/
rm -r tests/run-make/test-benches
# vendor intrinsics
rm src/test/ui/sse2.rs # cpuid not supported, so sse2 not detected
rm src/test/ui/intrinsics/const-eval-select-x86_64.rs # requires x86_64 vendor intrinsics
rm src/test/ui/simd/array-type.rs # "Index argument for `simd_insert` is not a constant"
rm src/test/ui/simd/intrinsic/generic-bitmask-pass.rs # simd_bitmask unimplemented
rm src/test/ui/simd/intrinsic/generic-as.rs # simd_as unimplemented
rm src/test/ui/simd/intrinsic/generic-arithmetic-saturating-pass.rs # simd_saturating_add unimplemented
rm src/test/ui/simd/intrinsic/float-math-pass.rs # simd_fcos unimplemented
rm src/test/ui/simd/intrinsic/generic-gather-pass.rs # simd_gather unimplemented
rm src/test/ui/simd/intrinsic/generic-select-pass.rs # simd_select_bitmask unimplemented
rm src/test/ui/simd/issue-85915-simd-ptrs.rs # simd_gather unimplemented
rm src/test/ui/simd/issue-89193.rs # simd_gather unimplemented
rm src/test/ui/simd/simd-bitmask.rs # simd_bitmask unimplemented
rm tests/ui/sse2.rs # cpuid not supported, so sse2 not detected
rm tests/ui/intrinsics/const-eval-select-x86_64.rs # requires x86_64 vendor intrinsics
rm tests/ui/simd/array-type.rs # "Index argument for `simd_insert` is not a constant"
rm tests/ui/simd/intrinsic/generic-bitmask-pass.rs # simd_bitmask unimplemented
rm tests/ui/simd/intrinsic/generic-as.rs # simd_as unimplemented
rm tests/ui/simd/intrinsic/generic-arithmetic-saturating-pass.rs # simd_saturating_add unimplemented
rm tests/ui/simd/intrinsic/float-math-pass.rs # simd_fcos unimplemented
rm tests/ui/simd/intrinsic/generic-gather-pass.rs # simd_gather unimplemented
rm tests/ui/simd/intrinsic/generic-select-pass.rs # simd_select_bitmask unimplemented
rm tests/ui/simd/issue-85915-simd-ptrs.rs # simd_gather unimplemented
rm tests/ui/simd/issue-89193.rs # simd_gather unimplemented
rm tests/ui/simd/simd-bitmask.rs # simd_bitmask unimplemented
# exotic linkages
rm src/test/ui/issues/issue-33992.rs # unsupported linkages
rm src/test/incremental/hashes/function_interfaces.rs # same
rm src/test/incremental/hashes/statics.rs # same
rm tests/ui/issues/issue-33992.rs # unsupported linkages
rm tests/incremental/hashes/function_interfaces.rs # same
rm tests/incremental/hashes/statics.rs # same
# variadic arguments
rm src/test/ui/abi/mir/mir_codegen_calls_variadic.rs # requires float varargs
rm src/test/ui/abi/variadic-ffi.rs # requires callee side vararg support
rm tests/ui/abi/mir/mir_codegen_calls_variadic.rs # requires float varargs
rm tests/ui/abi/variadic-ffi.rs # requires callee side vararg support
# unsized locals
rm -r src/test/run-pass-valgrind/unsized-locals
rm -r tests/run-pass-valgrind/unsized-locals
# misc unimplemented things
rm src/test/ui/intrinsics/intrinsic-nearby.rs # unimplemented nearbyintf32 and nearbyintf64 intrinsics
rm src/test/ui/target-feature/missing-plusminus.rs # error not implemented
rm src/test/ui/fn/dyn-fn-alignment.rs # wants a 256 byte alignment
rm -r src/test/run-make/emit-named-files # requires full --emit support
rm src/test/ui/abi/stack-probes.rs # stack probes not yet implemented
rm src/test/ui/simd/intrinsic/ptr-cast.rs # simd_expose_addr intrinsic unimplemented
rm -r src/test/run-make/repr128-dwarf # debuginfo test
rm src/test/codegen-units/item-collection/asm-sym.rs # requires support for sym in asm!()
rm tests/ui/intrinsics/intrinsic-nearby.rs # unimplemented nearbyintf32 and nearbyintf64 intrinsics
rm tests/ui/target-feature/missing-plusminus.rs # error not implemented
rm tests/ui/fn/dyn-fn-alignment.rs # wants a 256 byte alignment
rm -r tests/run-make/emit-named-files # requires full --emit support
rm tests/ui/abi/stack-probes.rs # stack probes not yet implemented
rm tests/ui/simd/intrinsic/ptr-cast.rs # simd_expose_addr intrinsic unimplemented
rm -r tests/run-make/repr128-dwarf # debuginfo test
rm tests/codegen-units/item-collection/asm-sym.rs # requires support for sym in asm!()
# optimization tests
# ==================
rm src/test/ui/codegen/issue-28950.rs # depends on stack size optimizations
rm src/test/ui/codegen/init-large-type.rs # same
rm src/test/ui/issues/issue-40883.rs # same
rm -r src/test/run-make/fmt-write-bloat/ # tests an optimization
rm tests/ui/codegen/issue-28950.rs # depends on stack size optimizations
rm tests/ui/codegen/init-large-type.rs # same
rm tests/ui/issues/issue-40883.rs # same
rm -r tests/run-make/fmt-write-bloat/ # tests an optimization
# backend specific tests
# ======================
rm src/test/incremental/thinlto/cgu_invalidated_when_import_{added,removed}.rs # requires LLVM
rm src/test/ui/abi/stack-protector.rs # requires stack protector support
rm tests/incremental/thinlto/cgu_invalidated_when_import_{added,removed}.rs # requires LLVM
rm tests/ui/abi/stack-protector.rs # requires stack protector support
# giving different but possibly correct results
# =============================================
rm src/test/ui/mir/mir_misc_casts.rs # depends on deduplication of constants
rm src/test/ui/mir/mir_raw_fat_ptr.rs # same
rm src/test/ui/consts/issue-33537.rs # same
rm src/test/ui/layout/valid_range_oob.rs # different ICE message
rm tests/ui/mir/mir_misc_casts.rs # depends on deduplication of constants
rm tests/ui/mir/mir_raw_fat_ptr.rs # same
rm tests/ui/consts/issue-33537.rs # same
rm tests/ui/layout/valid_range_oob.rs # different ICE message
# doesn't work due to the way the rustc test suite is invoked.
# should work when using ./x.py test the way it is intended
# ============================================================
rm -r src/test/run-make/emit-shared-files # requires the rustdoc executable in dist/bin/
rm -r src/test/run-make/unstable-flag-required # same
rm -r src/test/run-make/rustdoc-* # same
rm -r src/test/run-make/issue-88756-default-output # same
rm -r src/test/run-make/remap-path-prefix-dwarf # requires llvm-dwarfdump
rm -r src/test/ui/consts/missing_span_in_backtrace.rs # expects sysroot source to be elsewhere
rm -r tests/run-make/emit-shared-files # requires the rustdoc executable in dist/bin/
rm -r tests/run-make/unstable-flag-required # same
rm -r tests/run-make/rustdoc-* # same
rm -r tests/run-make/issue-88756-default-output # same
rm -r tests/run-make/remap-path-prefix-dwarf # requires llvm-dwarfdump
rm -r tests/ui/consts/missing_span_in_backtrace.rs # expects sysroot source to be elsewhere
# genuine bugs
# ============
rm src/test/incremental/spike-neg1.rs # errors out for some reason
rm src/test/incremental/spike-neg2.rs # same
rm src/test/ui/issues/issue-74564-if-expr-stack-overflow.rs # gives a stackoverflow before the backend runs
rm src/test/ui/mir/ssa-analysis-regression-50041.rs # produces ICE
rm src/test/ui/type-alias-impl-trait/assoc-projection-ice.rs # produces ICE
rm tests/incremental/spike-neg1.rs # errors out for some reason
rm tests/incremental/spike-neg2.rs # same
rm tests/ui/issues/issue-74564-if-expr-stack-overflow.rs # gives a stackoverflow before the backend runs
rm tests/ui/mir/ssa-analysis-regression-50041.rs # produces ICE
rm tests/ui/type-alias-impl-trait/assoc-projection-ice.rs # produces ICE
rm src/test/ui/simd/intrinsic/generic-reduction-pass.rs # simd_reduce_add_unordered doesn't accept an accumulator for integer vectors
rm tests/ui/simd/intrinsic/generic-reduction-pass.rs # simd_reduce_add_unordered doesn't accept an accumulator for integer vectors
rm src/test/ui/runtime/out-of-stack.rs # SIGSEGV instead of SIGABRT for some reason (#1301)
rm tests/ui/runtime/out-of-stack.rs # SIGSEGV instead of SIGABRT for some reason (#1301)
# bugs in the test suite
# ======================
rm src/test/ui/backtrace.rs # TODO warning
rm src/test/ui/simple_global_asm.rs # TODO add needs-asm-support
rm src/test/ui/test-attrs/test-type.rs # TODO panic message on stderr. correct stdout
rm tests/ui/backtrace.rs # TODO warning
rm tests/ui/simple_global_asm.rs # TODO add needs-asm-support
rm tests/ui/test-attrs/test-type.rs # TODO panic message on stderr. correct stdout
# not sure if this is actually a bug in the test suite, but the symbol list shows the function without leading _ for some reason
rm -r src/test/run-make/native-link-modifier-bundle
rm src/test/ui/process/nofile-limit.rs # TODO some AArch64 linking issue
rm src/test/ui/dyn-star/dispatch-on-pin-mut.rs # TODO failed assertion in vtable::get_ptr_and_method_ref
rm -r tests/run-make/native-link-modifier-bundle
rm tests/ui/process/nofile-limit.rs # TODO some AArch64 linking issue
rm tests/ui/dyn-star/dispatch-on-pin-mut.rs # TODO failed assertion in vtable::get_ptr_and_method_ref
rm src/test/ui/stdio-is-blocking.rs # really slow with unoptimized libstd
rm tests/ui/stdio-is-blocking.rs # really slow with unoptimized libstd
echo "[TEST] rustc test suite"
RUST_TEST_NOCAPTURE=1 COMPILETEST_FORCE_STAGE0=1 ./x.py test --stage 0 src/test/{codegen-units,run-make,run-pass-valgrind,ui,incremental}
RUST_TEST_NOCAPTURE=1 COMPILETEST_FORCE_STAGE0=1 ./x.py test --stage 0 tests/{codegen-units,run-make,run-pass-valgrind,ui,incremental}
popd

View File

@ -253,25 +253,25 @@ rustc = "$HOME/.rustup/toolchains/$rust_toolchain-$TARGET_TRIPLE/bin/rustc"
EOF
rustc -V | cut -d' ' -f3 | tr -d '('
git checkout $(rustc -V | cut -d' ' -f3 | tr -d '(') src/test
git checkout $(rustc -V | cut -d' ' -f3 | tr -d '(') tests
for test in $(rg -i --files-with-matches "//(\[\w+\])?~|// error-pattern:|// build-fail|// run-fail|-Cllvm-args" src/test/ui); do
for test in $(rg -i --files-with-matches "//(\[\w+\])?~|// error-pattern:|// build-fail|// run-fail|-Cllvm-args" tests/ui); do
rm $test
done
git checkout -- src/test/ui/issues/auxiliary/issue-3136-a.rs # contains //~ERROR, but shouldn't be removed
git checkout -- tests/ui/issues/auxiliary/issue-3136-a.rs # contains //~ERROR, but shouldn't be removed
rm -r src/test/ui/{abi*,extern/,panic-runtime/,panics/,unsized-locals/,proc-macro/,threads-sendsync/,thinlto/,borrowck/,test*,*lto*.rs} || true
for test in $(rg --files-with-matches "catch_unwind|should_panic|thread|lto" src/test/ui); do
rm -r tests/ui/{abi*,extern/,panic-runtime/,panics/,unsized-locals/,proc-macro/,threads-sendsync/,thinlto/,borrowck/,test*,*lto*.rs} || true
for test in $(rg --files-with-matches "catch_unwind|should_panic|thread|lto" tests/ui); do
rm $test
done
git checkout src/test/ui/type-alias-impl-trait/auxiliary/cross_crate_ice.rs
git checkout src/test/ui/type-alias-impl-trait/auxiliary/cross_crate_ice2.rs
git checkout tests/ui/type-alias-impl-trait/auxiliary/cross_crate_ice.rs
git checkout tests/ui/type-alias-impl-trait/auxiliary/cross_crate_ice2.rs
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"
echo "[TEST] rustc test suite"
COMPILETEST_FORCE_STAGE0=1 ./x.py test --run always --stage 0 src/test/ui/ --rustc-args "$RUSTC_ARGS"
COMPILETEST_FORCE_STAGE0=1 ./x.py test --run always --stage 0 tests/ui/ --rustc-args "$RUSTC_ARGS"
}
function clean_ui_tests() {

View File

@ -95,7 +95,7 @@ impl<'tcx> Visitor<'tcx> for CheckLiveDrops<'_, 'tcx> {
}
// Drop elaboration is not precise enough to accept code like
// `src/test/ui/consts/control-flow/drop-pass.rs`; e.g., when an `Option<Vec<T>>` is
// `tests/ui/consts/control-flow/drop-pass.rs`; e.g., when an `Option<Vec<T>>` is
// initialized with `None` and never changed, it still emits drop glue.
// Hence we additionally check the qualifs here to allow more code to pass.
if self.qualifs.needs_non_const_drop(self.ccx, dropped_place.local, location) {

View File

@ -267,7 +267,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
// segments, even though `trait_ref.path.segments` is of length `1`. Work
// around that bug here, even though it should be fixed elsewhere.
// This would otherwise cause an invalid suggestion. For an example, look at
// `src/test/ui/issues/issue-28344.rs` where instead of the following:
// `tests/ui/issues/issue-28344.rs` where instead of the following:
//
// error[E0191]: the value of the associated type `Output`
// (from trait `std::ops::BitXor`) must be specified

View File

@ -13,7 +13,7 @@
//! useful for freezing mut things (that is, when the expected type is &T
//! but you have &mut T) and also for avoiding the linearity
//! of mut things (when the expected is &mut T and you have &mut T). See
//! the various `src/test/ui/coerce/*.rs` tests for
//! the various `tests/ui/coerce/*.rs` tests for
//! examples of where this is useful.
//!
//! ## Subtle note

View File

@ -1855,7 +1855,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
let mut expectation = Some(expected_ty);
while let hir::ExprKind::MethodCall(_, rcvr, ..) = expr.kind {
// Getting to the root receiver and asserting it is a fn call let's us ignore cases in
// `src/test/ui/methods/issues/issue-90315.stderr`.
// `tests/ui/methods/issues/issue-90315.stderr`.
expr = rcvr;
// If we have more than one layer of calls, then the expected ty
// cannot guide the method probe.

View File

@ -308,7 +308,7 @@ impl<'tcx> FnCtxt<'_, 'tcx> {
if relationship.self_in_trait && relationship.output {
// This case falls back to () to ensure that the code pattern in
// src/test/ui/never_type/fallback-closure-ret.rs continues to
// tests/ui/never_type/fallback-closure-ret.rs continues to
// compile when never_type_fallback is enabled.
//
// This rule is not readily explainable from first principles,

View File

@ -670,8 +670,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// Note: this check is pessimistic, as the inference type could be matched with something other
// than the opaque type, but then we need a new `TypeRelation` just for this specific case and
// can't re-use `sup` below.
// See src/test/ui/impl-trait/hidden-type-is-opaque.rs and
// src/test/ui/impl-trait/hidden-type-is-opaque-2.rs for examples that hit this path.
// See tests/ui/impl-trait/hidden-type-is-opaque.rs and
// tests/ui/impl-trait/hidden-type-is-opaque-2.rs for examples that hit this path.
if formal_ret.has_infer_types() {
for ty in ret_ty.walk() {
if let ty::subst::GenericArgKind::Type(ty) = ty.unpack()

View File

@ -448,7 +448,7 @@ impl<'a, 'tcx> Visitor<'tcx> for InteriorVisitor<'a, 'tcx> {
// the yield, even if it's not borrowed or referenced after the yield. Ideally this would
// *only* happen for types with observable drop, not all types which wrap them, but that
// doesn't match the behavior of MIR borrowck and causes ICEs. See the FIXME comment in
// src/test/ui/generator/drop-tracking-parent-expression.rs.
// tests/ui/generator/drop-tracking-parent-expression.rs.
let scope = if self.drop_ranges.is_borrowed_temporary(expr)
|| ty.map_or(true, |ty| {
// Avoid ICEs in needs_drop.

View File

@ -90,7 +90,7 @@ impl<'a, 'tcx> ConfirmContext<'a, 'tcx> {
// If there is a `Self: Sized` bound and `Self` is a trait object, it is possible that
// something which derefs to `Self` actually implements the trait and the caller
// wanted to make a static dispatch on it but forgot to import the trait.
// See test `src/test/ui/issue-35976.rs`.
// See test `tests/ui/issue-35976.rs`.
//
// In that case, we'll error anyway, but we'll also re-run the search with all traits
// in scope, and if we find another method which can be used, we'll output an

View File

@ -1713,7 +1713,7 @@ impl<'a, 'tcx> ProbeContext<'a, 'tcx> {
/// probe. This will result in a pending obligation so when more type-info is available we can
/// make the final decision.
///
/// Example (`src/test/ui/method-two-trait-defer-resolution-1.rs`):
/// Example (`tests/ui/method-two-trait-defer-resolution-1.rs`):
///
/// ```ignore (illustrative)
/// trait Foo { ... }

View File

@ -663,7 +663,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
// fields of some type, the observable drop order will remain the same as it previously
// was even though we're dropping each capture individually.
// See https://github.com/rust-lang/project-rfc-2229/issues/42 and
// `src/test/ui/closures/2229_closure_analysis/preserve_field_drop_order.rs`.
// `tests/ui/closures/2229_closure_analysis/preserve_field_drop_order.rs`.
for (_, captures) in &mut root_var_min_capture_list {
captures.sort_by(|capture1, capture2| {
for (p1, p2) in capture1.place.projections.iter().zip(&capture2.place.projections) {

View File

@ -219,7 +219,7 @@ impl<'tcx> InferCtxt<'tcx> {
///
/// As `3 + 4` contains `N` in its substs, this must not succeed.
///
/// See `src/test/ui/const-generics/occurs-check/` for more examples where this is relevant.
/// See `tests/ui/const-generics/occurs-check/` for more examples where this is relevant.
#[instrument(level = "debug", skip(self))]
fn unify_const_variable(
&self,

View File

@ -310,7 +310,7 @@ pub fn unexpected_hidden_region_diagnostic<'tcx>(
// Ugh. This is a painful case: the hidden region is not one
// that we can easily summarize or explain. This can happen
// in a case like
// `src/test/ui/multiple-lifetimes/ordinary-bounds-unsuited.rs`:
// `tests/ui/multiple-lifetimes/ordinary-bounds-unsuited.rs`:
//
// ```
// fn upper_bounds<'a, 'b>(a: Ordinary<'a>, b: Ordinary<'b>) -> impl Trait<'a, 'b> {
@ -1395,7 +1395,7 @@ impl<'tcx> TypeErrCtxt<'_, 'tcx> {
/// `swap_secondary_and_primary` is used to make projection errors in particular nicer by using
/// the message in `secondary_span` as the primary label, and apply the message that would
/// otherwise be used for the primary label on the `secondary_span` `Span`. This applies on
/// E0271, like `src/test/ui/issues/issue-39970.stderr`.
/// E0271, like `tests/ui/issues/issue-39970.stderr`.
#[instrument(
level = "debug",
skip(self, diag, secondary_span, swap_secondary_and_primary, prefer_label)

View File

@ -87,7 +87,7 @@ where
// unless otherwise is unreachable, in which case deleting a normal branch causes it to be merged with
// the otherwise, keeping its unreachable.
// This looses information about reachability causing worse codegen.
// For example (see src/test/codegen/match-optimizes-away.rs)
// For example (see tests/codegen/match-optimizes-away.rs)
//
// pub enum Two { A, B }
// pub fn identity(x: Two) -> Two {

View File

@ -1755,7 +1755,7 @@ impl SearchInterfaceForPrivateItemsVisitor<'_> {
// clauses that the compiler inferred. We only want to
// consider the ones that the user wrote. This is important
// for the inferred outlives rules; see
// `src/test/ui/rfc-2093-infer-outlives/privacy.rs`.
// `tests/ui/rfc-2093-infer-outlives/privacy.rs`.
self.visit_predicates(self.tcx.explicit_predicates_of(self.item_def_id));
self
}

View File

@ -514,7 +514,7 @@ impl<'a, 'b> BuildReducedGraphVisitor<'a, 'b> {
ModuleKind::Block => unreachable!(),
};
// HACK(eddyb) unclear how good this is, but keeping `$crate`
// in `source` breaks `src/test/ui/imports/import-crate-var.rs`,
// in `source` breaks `tests/ui/imports/import-crate-var.rs`,
// while the current crate doesn't have a valid `crate_name`.
if crate_name != kw::Empty {
// `crate_name` should not be interpreted as relative.

View File

@ -749,7 +749,7 @@ impl<'tcx> TypeVisitor<'tcx> for OrphanChecker<'tcx> {
///
/// This means that we can completely ignore constants during the orphan check.
///
/// See `src/test/ui/coherence/const-generics-orphan-check-ok.rs` for examples.
/// See `tests/ui/coherence/const-generics-orphan-check-ok.rs` for examples.
///
/// [^1]: This might not hold for function pointers or trait objects in the future.
/// As these should be quite rare as const arguments and especially rare as impl

View File

@ -282,7 +282,7 @@ fn project_and_unify_type<'cx, 'tcx>(
};
debug!(?normalized, ?obligations, "project_and_unify_type result");
let actual = obligation.predicate.term;
// For an example where this is necessary see src/test/ui/impl-trait/nested-return-type2.rs
// For an example where this is necessary see tests/ui/impl-trait/nested-return-type2.rs
// This allows users to omit re-mentioning all bounds on an associated type and just use an
// `impl Trait` for the assoc type to add more bounds.
let InferOk { value: actual, obligations: new } =

View File

@ -232,7 +232,7 @@ fn extend_cause_with_original_assoc_item_obligation<'tcx>(
// The obligation comes not from the current `impl` nor the `trait` being implemented,
// but rather from a "second order" obligation, where an associated type has a
// projection coming from another associated type. See
// `src/test/ui/associated-types/point-at-type-on-obligation-failure.rs` and
// `tests/ui/associated-types/point-at-type-on-obligation-failure.rs` and
// `traits-assoc-type-in-supertrait-bad.rs`.
if let Some(ty::Alias(ty::Projection, projection_ty)) = proj.term.ty().map(|ty| ty.kind())
&& let Some(&impl_item_id) =
@ -640,7 +640,7 @@ impl<'tcx> WfPredicates<'tcx> {
// hidden type that is not actually well formed and
// can cause compiler crashes when the user abuses unsafe
// code to procure such a closure.
// See src/test/ui/type-alias-impl-trait/wf_check_closures.rs
// See tests/ui/type-alias-impl-trait/wf_check_closures.rs
let obligations = self.nominal_obligations(did, substs);
self.out.extend(obligations);
}

View File

@ -35,7 +35,7 @@ fn fn_sig_for_fn_abi<'tcx>(
// HACK(davidtwco,eddyb): This is a workaround for polymorphization considering
// parameters unused if they show up in the signature, but not in the `mir::Body`
// (i.e. due to being inside a projection that got normalized, see
// `src/test/ui/polymorphization/normalized_sig_types.rs`), and codegen not keeping
// `tests/ui/polymorphization/normalized_sig_types.rs`), and codegen not keeping
// track of a polymorphization `ParamEnv` to allow normalizing later.
//
// We normalize the `fn_sig` again after substituting at a later point.

View File

@ -3,7 +3,7 @@ use crate::panic::catch_unwind;
use crate::process::Command;
// Many of the other aspects of this situation, including heap alloc concurrency
// safety etc., are tested in src/test/ui/process/process-panic-after-fork.rs
// safety etc., are tested in tests/ui/process/process-panic-after-fork.rs
#[test]
fn exitstatus_display_tests() {

View File

@ -13,7 +13,7 @@ ignore = [
# tests for now are not formatted, as they are sometimes pretty-printing constrained
# (and generally rustfmt can move around comments in UI-testing incompatible ways)
"src/test",
"tests",
# do not format submodules
"library/backtrace",

View File

@ -59,10 +59,10 @@ The script accepts commands, flags, and arguments to determine what to do:
./x.py test tidy
# execute the UI test suite
./x.py test src/test/ui
./x.py test tests/ui
# execute only some tests in the UI test suite
./x.py test src/test/ui --test-args substring-of-test-name
./x.py test tests/ui --test-args substring-of-test-name
# execute tests in the standard library in stage0
./x.py test --stage 0 library/std

View File

@ -191,9 +191,9 @@ pub enum PathSet {
/// A "suite" of paths.
///
/// These can match as a path suffix (like `Set`), or as a prefix. For
/// example, a command-line value of `src/test/ui/abi/variadic-ffi.rs`
/// will match `src/test/ui`. A command-line value of `ui` would also
/// match `src/test/ui`.
/// example, a command-line value of `tests/ui/abi/variadic-ffi.rs`
/// will match `tests/ui`. A command-line value of `ui` would also
/// match `tests/ui`.
Suite(TaskPath),
}

View File

@ -78,7 +78,7 @@ macro_rules! rustc {
#[test]
fn test_valid() {
// make sure multi suite paths are accepted
check_cli(["test", "src/test/ui/attr-start.rs", "src/test/ui/attr-shebang.rs"]);
check_cli(["test", "tests/ui/attr-start.rs", "tests/ui/attr-shebang.rs"]);
}
#[test]

View File

@ -1193,7 +1193,7 @@ impl Step for Sysroot {
);
if builder.config.rust_remap_debuginfo {
eprintln!(
"warning: some `src/test/ui` tests will fail when lacking `{}`",
"warning: some `tests/ui` tests will fail when lacking `{}`",
sysroot_lib_rustlib_src_rust.display(),
);
}

View File

@ -45,7 +45,7 @@ o("llvm-static-stdcpp", "llvm.static-libstdcpp", "statically link to libstdc++ f
o("llvm-link-shared", "llvm.link-shared", "prefer shared linking to LLVM (llvm-config --link-shared)")
o("rpath", "rust.rpath", "build rpaths into rustc itself")
o("llvm-version-check", "llvm.version-check", "check if the LLVM version is supported, build anyway")
o("codegen-tests", "rust.codegen-tests", "run the src/test/codegen tests")
o("codegen-tests", "rust.codegen-tests", "run the tests/codegen tests")
o("option-checking", None, "complain about unrecognized options in this configure script")
o("ninja", "llvm.ninja", "build LLVM using the Ninja generator (for MSVC, requires building in the correct environment)")
o("locked-deps", "build.locked-deps", "force Cargo.lock to be up to date")

View File

@ -487,13 +487,13 @@ Arguments:
This subcommand accepts a number of paths to test directories that
should be compiled and run. For example:
./x.py test src/test/ui
./x.py test tests/ui
./x.py test library/std --test-args hash_map
./x.py test library/std --stage 0 --no-doc
./x.py test src/test/ui --bless
./x.py test src/test/ui --compare-mode chalk
./x.py test tests/ui --bless
./x.py test tests/ui --compare-mode chalk
Note that `test src/test/* --stage N` does NOT depend on `build compiler/rustc --stage N`;
Note that `test tests/* --stage N` does NOT depend on `build compiler/rustc --stage N`;
just like `build library/std --stage N` it tests the compiler produced by the previous
stage.

View File

@ -58,7 +58,7 @@ prepare:
$(Q)$(BOOTSTRAP) build --stage 2 nonexistent/path/to/trigger/cargo/metadata
TESTS_IN_2 := \
src/test/ui \
tests/ui \
src/tools/linkchecker
## MSVC native builders
@ -72,7 +72,7 @@ ci-subset-2:
## MingW native builders
TESTS_IN_MINGW_2 := \
src/test/ui
tests/ui
ci-mingw-subset-1:
$(Q)$(CFG_SRC_DIR)/x test --stage 2 $(TESTS_IN_MINGW_2:%=--exclude %)

View File

@ -907,7 +907,7 @@ impl Step for TestHelpers {
type Output = ();
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.path("src/test/auxiliary/rust_test_helpers.c")
run.path("tests/auxiliary/rust_test_helpers.c")
}
fn make_run(run: RunConfig<'_>) {
@ -929,7 +929,7 @@ impl Step for TestHelpers {
self.target
};
let dst = builder.test_helpers_out(target);
let src = builder.src.join("src/test/auxiliary/rust_test_helpers.c");
let src = builder.src.join("tests/auxiliary/rust_test_helpers.c");
if up_to_date(&src, &dst.join("librust_test_helpers.a")) {
return;
}
@ -958,7 +958,7 @@ impl Step for TestHelpers {
.opt_level(0)
.warnings(false)
.debug(false)
.file(builder.src.join("src/test/auxiliary/rust_test_helpers.c"))
.file(builder.src.join("tests/auxiliary/rust_test_helpers.c"))
.compile("rust_test_helpers");
}
}

View File

@ -144,7 +144,7 @@ pub fn setup(config: &Config, profile: Profile) {
Profile::Tools => &[
"check",
"build",
"test src/test/rustdoc*",
"test tests/rustdoc*",
"test src/tools/clippy",
"test src/tools/miri",
"test src/tools/rustfmt",

View File

@ -841,7 +841,7 @@ impl Step for RustdocJSStd {
const ONLY_HOSTS: bool = true;
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.suite_path("src/test/rustdoc-js-std")
run.suite_path("tests/rustdoc-js-std")
}
fn make_run(run: RunConfig<'_>) {
@ -860,10 +860,10 @@ impl Step for RustdocJSStd {
.arg("--doc-folder")
.arg(builder.doc_out(self.target))
.arg("--test-folder")
.arg(builder.src.join("src/test/rustdoc-js-std"));
.arg(builder.src.join("tests/rustdoc-js-std"));
for path in &builder.paths {
if let Some(p) =
util::is_valid_test_suite_arg(path, "src/test/rustdoc-js-std", builder)
util::is_valid_test_suite_arg(path, "tests/rustdoc-js-std", builder)
{
if !p.ends_with(".js") {
eprintln!("A non-js file was given: `{}`", path.display());
@ -879,7 +879,7 @@ impl Step for RustdocJSStd {
});
builder.run(&mut command);
} else {
builder.info("No nodejs found, skipping \"src/test/rustdoc-js-std\" tests");
builder.info("No nodejs found, skipping \"tests/rustdoc-js-std\" tests");
}
}
}
@ -896,7 +896,7 @@ impl Step for RustdocJSNotStd {
const ONLY_HOSTS: bool = true;
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
run.suite_path("src/test/rustdoc-js")
run.suite_path("tests/rustdoc-js")
}
fn make_run(run: RunConfig<'_>) {
@ -911,11 +911,11 @@ impl Step for RustdocJSNotStd {
target: self.target,
mode: "js-doc-test",
suite: "rustdoc-js",
path: "src/test/rustdoc-js",
path: "tests/rustdoc-js",
compare_mode: None,
});
} else {
builder.info("No nodejs found, skipping \"src/test/rustdoc-js\" tests");
builder.info("No nodejs found, skipping \"tests/rustdoc-js\" tests");
}
}
}
@ -976,7 +976,7 @@ impl Step for RustdocGUI {
fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
let builder = run.builder;
let run = run.suite_path("src/test/rustdoc-gui");
let run = run.suite_path("tests/rustdoc-gui");
run.lazy_default_condition(Box::new(move || {
builder.config.nodejs.is_some()
&& builder
@ -1025,7 +1025,7 @@ impl Step for RustdocGUI {
// We remove existing folder to be sure there won't be artifacts remaining.
builder.clear_if_dirty(&out_dir, &builder.rustdoc(self.compiler));
let src_path = builder.build.src.join("src/test/rustdoc-gui/src");
let src_path = builder.build.src.join("tests/rustdoc-gui/src");
// We generate docs for the libraries present in the rustdoc-gui's src folder.
for entry in src_path.read_dir().expect("read_dir call failed") {
if let Ok(entry) = entry {
@ -1064,9 +1064,9 @@ impl Step for RustdocGUI {
.arg("--doc-folder")
.arg(out_dir.join("doc"))
.arg("--tests-folder")
.arg(builder.build.src.join("src/test/rustdoc-gui"));
.arg(builder.build.src.join("tests/rustdoc-gui"));
for path in &builder.paths {
if let Some(p) = util::is_valid_test_suite_arg(path, "src/test/rustdoc-gui", builder) {
if let Some(p) = util::is_valid_test_suite_arg(path, "tests/rustdoc-gui", builder) {
if !p.ends_with(".goml") {
eprintln!("A non-goml file was given: `{}`", path.display());
panic!("Cannot run rustdoc-gui tests");
@ -1308,59 +1308,51 @@ macro_rules! test_definitions {
};
}
default_test!(Ui { path: "src/test/ui", mode: "ui", suite: "ui" });
default_test!(Ui { path: "tests/ui", mode: "ui", suite: "ui" });
default_test!(RunPassValgrind {
path: "src/test/run-pass-valgrind",
path: "tests/run-pass-valgrind",
mode: "run-pass-valgrind",
suite: "run-pass-valgrind"
});
default_test!(MirOpt { path: "src/test/mir-opt", mode: "mir-opt", suite: "mir-opt" });
default_test!(MirOpt { path: "tests/mir-opt", mode: "mir-opt", suite: "mir-opt" });
default_test!(Codegen { path: "src/test/codegen", mode: "codegen", suite: "codegen" });
default_test!(Codegen { path: "tests/codegen", mode: "codegen", suite: "codegen" });
default_test!(CodegenUnits {
path: "src/test/codegen-units",
path: "tests/codegen-units",
mode: "codegen-units",
suite: "codegen-units"
});
default_test!(Incremental {
path: "src/test/incremental",
mode: "incremental",
suite: "incremental"
});
default_test!(Incremental { path: "tests/incremental", mode: "incremental", suite: "incremental" });
default_test_with_compare_mode!(Debuginfo {
path: "src/test/debuginfo",
path: "tests/debuginfo",
mode: "debuginfo",
suite: "debuginfo",
compare_mode: "split-dwarf"
});
host_test!(UiFullDeps { path: "src/test/ui-fulldeps", mode: "ui", suite: "ui-fulldeps" });
host_test!(UiFullDeps { path: "tests/ui-fulldeps", mode: "ui", suite: "ui-fulldeps" });
host_test!(Rustdoc { path: "src/test/rustdoc", mode: "rustdoc", suite: "rustdoc" });
host_test!(RustdocUi { path: "src/test/rustdoc-ui", mode: "ui", suite: "rustdoc-ui" });
host_test!(Rustdoc { path: "tests/rustdoc", mode: "rustdoc", suite: "rustdoc" });
host_test!(RustdocUi { path: "tests/rustdoc-ui", mode: "ui", suite: "rustdoc-ui" });
host_test!(RustdocJson {
path: "src/test/rustdoc-json",
mode: "rustdoc-json",
suite: "rustdoc-json"
});
host_test!(RustdocJson { path: "tests/rustdoc-json", mode: "rustdoc-json", suite: "rustdoc-json" });
host_test!(Pretty { path: "src/test/pretty", mode: "pretty", suite: "pretty" });
host_test!(Pretty { path: "tests/pretty", mode: "pretty", suite: "pretty" });
default_test!(RunMake { path: "src/test/run-make", mode: "run-make", suite: "run-make" });
default_test!(RunMake { path: "tests/run-make", mode: "run-make", suite: "run-make" });
host_test!(RunMakeFullDeps {
path: "src/test/run-make-fulldeps",
path: "tests/run-make-fulldeps",
mode: "run-make",
suite: "run-make-fulldeps"
});
default_test!(Assembly { path: "src/test/assembly", mode: "assembly", suite: "assembly" });
default_test!(Assembly { path: "tests/assembly", mode: "assembly", suite: "assembly" });
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
struct Compiletest {
@ -1472,7 +1464,7 @@ note: if you're sure you want to do this, please open an issue as to why. In the
cmd.arg("--rust-demangler-path").arg(rust_demangler);
}
cmd.arg("--src-base").arg(builder.src.join("src/test").join(suite));
cmd.arg("--src-base").arg(builder.src.join("tests").join(suite));
cmd.arg("--build-base").arg(testdir(builder, compiler.host).join(suite));
cmd.arg("--sysroot-base").arg(builder.sysroot(compiler));
cmd.arg("--stage-id").arg(format!("stage{}-{}", compiler.stage, target));
@ -1936,7 +1928,7 @@ impl Step for ErrorIndex {
fn make_run(run: RunConfig<'_>) {
// error_index_generator depends on librustdoc. Use the compiler that
// is normally used to build rustdoc for other tests (like compiletest
// tests in src/test/rustdoc) so that it shares the same artifacts.
// tests in tests/rustdoc) so that it shares the same artifacts.
let compiler = run.builder.compiler(run.builder.top_stage, run.builder.config.build);
run.builder.ensure(ErrorIndex { compiler });
}
@ -2233,7 +2225,7 @@ impl Step for CrateRustdoc {
builder.compiler(builder.top_stage, target)
} else {
// Use the previous stage compiler to reuse the artifacts that are
// created when running compiletest for src/test/rustdoc. If this used
// created when running compiletest for tests/rustdoc. If this used
// `compiler`, then it would cause rustdoc to be built *again*, which
// isn't really necessary.
builder.compiler_for(builder.top_stage, target, target)
@ -2349,7 +2341,7 @@ impl Step for CrateRustdocJsonTypes {
let target = self.host;
// Use the previous stage compiler to reuse the artifacts that are
// created when running compiletest for src/test/rustdoc. If this used
// created when running compiletest for tests/rustdoc. If this used
// `compiler`, then it would cause rustdoc to be built *again*, which
// isn't really necessary.
let compiler = builder.compiler_for(builder.top_stage, target, target);

View File

@ -48,7 +48,7 @@ RUN CC=gcc CFLAGS="-m32 -Wa,-mrelax-relocations=no" \
rm -rf /build
# FIXME: musl really shouldn't be linking libgcc_s.so, as it's linked to glibc,
# but it's required by src/test/ui/proc-macro/crt-static.rs. Ubuntu:16.04 gcc-5
# but it's required by tests/ui/proc-macro/crt-static.rs. Ubuntu:16.04 gcc-5
# had libgcc_s.so as a symlink to the absolute libgcc_s.so.1, but now it's an
# ld-script that expects to find libgcc_s.so.1 in the library search path.
# See also https://github.com/rust-lang/rust/issues/82521

View File

@ -183,7 +183,7 @@ ENV RUST_CONFIGURE_ARGS \
--disable-docs
ENV SCRIPT \
python3 ../x.py --stage 2 test --host='' --target $RUN_MAKE_TARGETS src/test/run-make && \
python3 ../x.py --stage 2 test --host='' --target $RUN_MAKE_TARGETS tests/run-make && \
python3 ../x.py dist --host='' --target $TARGETS
# sccache

View File

@ -27,6 +27,6 @@ ENV RUST_CONFIGURE_ARGS --build=i686-unknown-linux-gnu
# this slow job.
ENV SCRIPT python3 ../x.py --stage 2 test \
--exclude src/bootstrap \
--exclude src/test/rustdoc-js \
--exclude tests/rustdoc-js \
--exclude src/tools/error_index_generator \
--exclude src/tools/linkchecker

View File

@ -59,16 +59,16 @@ ENV NO_OVERFLOW_CHECKS=1
ENV WASM_TARGETS=wasm32-unknown-unknown
ENV WASM_SCRIPT python3 /checkout/x.py --stage 2 test --host='' --target $WASM_TARGETS \
src/test/run-make \
src/test/ui \
src/test/mir-opt \
src/test/codegen-units \
tests/run-make \
tests/ui \
tests/mir-opt \
tests/codegen-units \
library/core
ENV NVPTX_TARGETS=nvptx64-nvidia-cuda
ENV NVPTX_SCRIPT python3 /checkout/x.py --stage 2 test --host='' --target $NVPTX_TARGETS \
src/test/run-make \
src/test/assembly
tests/run-make \
tests/assembly
ENV MUSL_TARGETS=x86_64-unknown-linux-musl \
CC_x86_64_unknown_linux_musl=x86_64-linux-musl-gcc \

View File

@ -46,4 +46,4 @@ ENV RUST_CONFIGURE_ARGS \
ENV SCRIPT \
python3 ../x.py --stage 2 build && \
python3 ../x.py --stage 2 test src/test/run-make-fulldeps --test-args clang
python3 ../x.py --stage 2 test tests/run-make-fulldeps --test-args clang

View File

@ -45,5 +45,5 @@ ENV SCRIPT python2.7 ../x.py --stage 1 test --exclude src/tools/tidy && \
# the PR is approved and tested for merging.
# It will also detect tests lacking `// EMIT_MIR_FOR_EACH_BIT_WIDTH`,
# despite having different output on 32-bit vs 64-bit targets.
python2.7 ../x.py --stage 1 test src/test/mir-opt \
python2.7 ../x.py --stage 1 test tests/mir-opt \
--host='' --target=i686-unknown-linux-gnu

View File

@ -56,14 +56,14 @@ ENV SCRIPT ../x.py --stage 2 test --exclude src/tools/tidy && \
# the PR is approved and tested for merging.
# It will also detect tests lacking `// EMIT_MIR_FOR_EACH_BIT_WIDTH`,
# despite having different output on 32-bit vs 64-bit targets.
../x --stage 2 test src/test/mir-opt \
../x --stage 2 test tests/mir-opt \
--host='' --target=i686-unknown-linux-gnu && \
# Run the UI test suite again, but in `--pass=check` mode
#
# This is intended to make sure that both `--pass=check` continues to
# work.
#
../x.ps1 --stage 2 test src/test/ui --pass=check \
../x.ps1 --stage 2 test tests/ui --pass=check \
--host='' --target=i686-unknown-linux-gnu && \
# Run tidy at the very end, after all the other tests.
python2.7 ../x.py --stage 2 test src/tools/tidy

View File

@ -84,5 +84,5 @@ ENV RUST_CONFIGURE_ARGS \
--save-toolstates=/tmp/toolstate/toolstates.json
ENV SCRIPT /tmp/checktools.sh ../x.py && \
NODE_PATH=`npm root -g` python3 ../x.py test src/test/rustdoc-gui --stage 2 \
NODE_PATH=`npm root -g` python3 ../x.py test tests/rustdoc-gui --stage 2 \
--test-args "'--no-sandbox --jobs 1'"

View File

@ -511,7 +511,7 @@ jobs:
- name: x86_64-apple-1
env: &env-x86_64-apple-tests
SCRIPT: ./x.py --stage 2 test --exclude src/test/ui --exclude src/test/rustdoc --exclude src/test/run-make-fulldeps
SCRIPT: ./x.py --stage 2 test --exclude tests/ui --exclude tests/rustdoc --exclude tests/run-make-fulldeps
RUST_CONFIGURE_ARGS: --build=x86_64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
MACOSX_DEPLOYMENT_TARGET: 10.8
@ -523,7 +523,7 @@ jobs:
- name: x86_64-apple-2
env:
SCRIPT: ./x.py --stage 2 test src/test/ui src/test/rustdoc src/test/run-make-fulldeps
SCRIPT: ./x.py --stage 2 test tests/ui tests/rustdoc tests/run-make-fulldeps
<<: *env-x86_64-apple-tests
<<: *job-macos-xl

View File

@ -27,7 +27,7 @@ if [[ -n "${CI_ONLY_WHEN_SUBMODULES_CHANGED-}" ]]; then
# that breaks Miri.
echo "Tool subtrees were updated"
elif ! (git diff --quiet "$BASE_COMMIT" -- \
src/test/rustdoc-gui \
tests/rustdoc-gui \
src/librustdoc \
src/ci/docker/host-x86_64/x86_64-gnu-tools/Dockerfile \
src/ci/docker/host-x86_64/x86_64-gnu-tools/browser-ui-test.version \

View File

@ -705,7 +705,7 @@ Where `${RUST_SRC_PATH}/install` is the `prefix` set in `config.toml` and
Once our environment is started, we can run our tests using `x.py` as usual. The
test runner script will run the compiled tests on an emulated Fuchsia device. To
run the full `src/test/ui` test suite:
run the full `tests/ui` test suite:
```sh
( \
@ -713,7 +713,7 @@ run the full `src/test/ui` test suite:
./x.py \
--config config.toml \
--stage=2 \
test src/test/ui \
test tests/ui \
--target x86_64-unknown-fuchsia \
--run=always --jobs 1 \
--test-args --target-rustcflags \

View File

@ -12,7 +12,7 @@ backend. The library must be of crate type `dylib` and must contain a function
named `__rustc_codegen_backend` with a signature of `fn() -> Box<dyn rustc_codegen_ssa::traits::CodegenBackend>`.
## Example
See also the [`hotplug_codegen_backend`](https://github.com/rust-lang/rust/tree/master/src/test/run-make-fulldeps/hotplug_codegen_backend) test
See also the [`hotplug_codegen_backend`](https://github.com/rust-lang/rust/tree/master/tests/run-make-fulldeps/hotplug_codegen_backend) test
for a full example.
```rust,ignore (partial-example)

View File

@ -33,7 +33,7 @@ of a library.
Plugins can extend [Rust's lint
infrastructure](../../reference/attributes/diagnostics.md#lint-check-attributes) with
additional checks for code style, safety, etc. Now let's write a plugin
[`lint-plugin-test.rs`](https://github.com/rust-lang/rust/blob/master/src/test/ui-fulldeps/auxiliary/lint-plugin-test.rs)
[`lint-plugin-test.rs`](https://github.com/rust-lang/rust/blob/master/tests/ui-fulldeps/auxiliary/lint-plugin-test.rs)
that warns about any item named `lintme`.
```rust,ignore (requires-stage-2)

View File

@ -707,7 +707,7 @@ h2.small-section-header > .anchor {
/* In most contexts we use `overflow-wrap: anywhere` to ensure that we can wrap
as much as needed on mobile (see
src/test/rustdoc-gui/type-declaration-overflow.goml for an example of why
tests/rustdoc-gui/type-declaration-overflow.goml for an example of why
this matters). The `anywhere` value means:
"Soft wrap opportunities introduced by the word break are considered when

View File

@ -1,4 +1,4 @@
// originally from ./src/test/ui/pattern/usefulness/consts-opaque.rs
// originally from ./tests/ui/pattern/usefulness/consts-opaque.rs
// panicked at 'assertion failed: rows.iter().all(|r| r.len() == v.len())',
// compiler/rustc_mir_build/src/thir/pattern/_match.rs:2030:5

View File

@ -1,4 +1,4 @@
// originally from rustc ./src/test/ui/macros/issue-78325-inconsistent-resolution.rs
// originally from rustc ./tests/ui/macros/issue-78325-inconsistent-resolution.rs
// inconsistent resolution for a macro
macro_rules! define_other_core {

View File

@ -1,4 +1,4 @@
// originally from rustc ./src/test/ui/regions/issue-78262.rs
// originally from rustc ./tests/ui/regions/issue-78262.rs
// ICE: to get the signature of a closure, use substs.as_closure().sig() not fn_sig()
#![allow(clippy::upper_case_acronyms)]

View File

@ -240,7 +240,7 @@ pub struct Config {
pub mode: Mode,
/// The test suite (essentially which directory is running, but without the
/// directory prefix such as src/test)
/// directory prefix such as tests)
pub suite: String,
/// The debugger to use in debuginfo mode. Unset otherwise.

View File

@ -774,7 +774,7 @@ fn make_test_name(
revision: Option<&String>,
) -> test::TestName {
// Print the name of the file, relative to the repository root.
// `src_base` looks like `/path/to/rust/src/test/ui`
// `src_base` looks like `/path/to/rust/tests/ui`
let root_directory = config.src_base.parent().unwrap().parent().unwrap().parent().unwrap();
let path = testpaths.file.strip_prefix(root_directory).unwrap();
let debugger = match config.debugger {

View File

@ -2102,9 +2102,7 @@ impl<'test> TestCx<'test> {
.parent()
.unwrap() // chop off `ui`
.parent()
.unwrap() // chop off `test`
.parent()
.unwrap(); // chop off `src`
.unwrap(); // chop off `tests`
args.push(src.join("src/etc/wasm32-shim.js").display().to_string());
}
@ -2932,7 +2930,7 @@ impl<'test> TestCx<'test> {
fn run_rmake_test(&self) {
let cwd = env::current_dir().unwrap();
let src_root = self.config.src_base.parent().unwrap().parent().unwrap().parent().unwrap();
let src_root = self.config.src_base.parent().unwrap().parent().unwrap();
let src_root = cwd.join(&src_root);
let tmpdir = cwd.join(self.output_base_name());
@ -3548,8 +3546,8 @@ impl<'test> TestCx<'test> {
normalize_path(parent_dir, "$DIR");
let source_bases = &[
// Source base on the current filesystem (calculated as parent of `src/test/$suite`):
Some(self.config.src_base.parent().unwrap().parent().unwrap().parent().unwrap().into()),
// Source base on the current filesystem (calculated as parent of `tests/$suite`):
Some(self.config.src_base.parent().unwrap().parent().unwrap().into()),
// Source base on the sysroot (from the src components downloaded by `download-rustc`):
Some(self.config.sysroot_base.join("lib").join("rustlib").join("src").join("rust")),
// Virtual `/rustc/$sha` remapped paths (if `remap-debuginfo` is enabled):

View File

@ -94,7 +94,7 @@ macro_rules! m2 { () => ( ${invalid()} ) }
#[test]
fn test_rustc_issue_57597() {
// <https://github.com/rust-lang/rust/blob/master/src/test/ui/issues/issue-57597.rs>
// <https://github.com/rust-lang/rust/blob/master/tests/ui/issues/issue-57597.rs>
check(
r#"
macro_rules! m0 { ($($($i:ident)?)+) => {}; }

View File

@ -3624,7 +3624,7 @@ of a library.
Plugins can extend [Rust's lint
infrastructure](../../reference/attributes/diagnostics.md#lint-check-attributes) with
additional checks for code style, safety, etc. Now let's write a plugin
[`lint-plugin-test.rs`](https://github.com/rust-lang/rust/blob/master/src/test/ui-fulldeps/auxiliary/lint-plugin-test.rs)
[`lint-plugin-test.rs`](https://github.com/rust-lang/rust/blob/master/tests/ui-fulldeps/auxiliary/lint-plugin-test.rs)
that warns about any item named `lintme`.
```rust,ignore (requires-stage-2)

View File

@ -262,7 +262,7 @@ async function main(argv) {
console.log("");
console.log(
"`browser-ui-test` crashed unexpectedly. Please try again with adding `--test-args \
--no-sandbox` at the end. For example: `x.py test src/test/rustdoc-gui --test-args --no-sandbox`");
--no-sandbox` at the end. For example: `x.py test tests/rustdoc-gui --test-args --no-sandbox`");
console.log("");
}
};

View File

@ -1,6 +1,6 @@
test!(RunPassPretty {
// comment
path: "src/test/run-pass/pretty",
path: "tests/run-pass/pretty",
mode: "pretty",
suite: "run-pass",
default: false,
@ -9,7 +9,7 @@ test!(RunPassPretty {
test!(RunPassPretty {
// comment
path: "src/test/run-pass/pretty",
path: "tests/run-pass/pretty",
mode: "pretty",
suite: "run-pass",
default: false,

View File

@ -1,6 +1,6 @@
test!(RunPassPretty {
// comment
path: "src/test/run-pass/pretty",
path: "tests/run-pass/pretty",
mode: "pretty",
suite: "run-pass",
default: false,
@ -9,7 +9,7 @@ test!(RunPassPretty {
test!(RunPassPretty {
// comment
path: "src/test/run-pass/pretty",
path: "tests/run-pass/pretty",
mode: "pretty",
suite: "run-pass",
default: false,

View File

@ -1,14 +1,12 @@
//! Tidy check to prevent creation of unnecessary debug artifacts while running tests.
use crate::walk::{filter_dirs, walk};
use std::path::{Path, PathBuf};
use std::path::Path;
const GRAPHVIZ_POSTFLOW_MSG: &str = "`borrowck_graphviz_postflow` attribute in test";
pub fn check(path: &Path, bad: &mut bool) {
let test_dir: PathBuf = path.join("test");
walk(&test_dir, &mut filter_dirs, &mut |entry, contents| {
pub fn check(test_dir: &Path, bad: &mut bool) {
walk(test_dir, &mut filter_dirs, &mut |entry, contents| {
let filename = entry.path();
let is_rust = filename.extension().map_or(false, |ext| ext == "rs");
if !is_rust {

View File

@ -11,7 +11,10 @@ fn is_edition_2021(mut line: &str) -> bool {
pub fn check(path: &Path, bad: &mut bool) {
walk(
path,
&mut |path| filter_dirs(path) || path.ends_with("src/test"),
&mut |path| {
filter_dirs(path)
|| (path.ends_with("tests") && path.join("COMPILER_TESTS.md").exists())
},
&mut |entry, contents| {
let file = entry.path();
let filename = file.file_name().unwrap();

View File

@ -8,7 +8,7 @@
//! - The explanation is expected to contain a `doctest` that fails with the correct error code. (`EXEMPT_FROM_DOCTEST` *currently* bypasses this check)
//! - Note that other stylistic conventions for markdown files are checked in the `style.rs` tidy check.
//!
//! 3. We check that the error code has a UI test in `src/test/ui/error-codes/`.
//! 3. We check that the error code has a UI test in `tests/ui/error-codes/`.
//! - We ensure that there is both a `Exxxx.rs` file and a corresponding `Exxxx.stderr` file.
//! - We also ensure that the error code is used in the tests.
//! - *Currently*, it is possible to opt-out of this check with the `EXEMPTED_FROM_TEST` constant.
@ -24,7 +24,7 @@ use crate::walk::{filter_dirs, walk, walk_many};
const ERROR_CODES_PATH: &str = "compiler/rustc_error_codes/src/error_codes.rs";
const ERROR_DOCS_PATH: &str = "compiler/rustc_error_codes/src/error_codes/";
const ERROR_TESTS_PATH: &str = "src/test/ui/error-codes/";
const ERROR_TESTS_PATH: &str = "tests/ui/error-codes/";
// Error codes that (for some reason) can't have a doctest in their explanation. Error codes are still expected to provide a code example, even if untested.
const IGNORE_DOCTEST_CHECK: &[&str] =
@ -270,14 +270,14 @@ fn check_error_codes_tests(
if !test_path.exists() && !IGNORE_UI_TEST_CHECK.contains(&code.as_str()) {
verbose_print!(
verbose,
"warning: Error code `{code}` needs to have at least one UI test in the `src/test/ui/error-codes/` directory`!"
"warning: Error code `{code}` needs to have at least one UI test in the `tests/error-codes/` directory`!"
);
continue;
}
if IGNORE_UI_TEST_CHECK.contains(&code.as_str()) {
if test_path.exists() {
errors.push(format!(
"Error code `{code}` has a UI test in `src/test/ui/error-codes/{code}.rs`, it shouldn't be listed in `EXEMPTED_FROM_TEST`!"
"Error code `{code}` has a UI test in `tests/ui/error-codes/{code}.rs`, it shouldn't be listed in `EXEMPTED_FROM_TEST`!"
));
}
continue;

View File

@ -82,6 +82,7 @@ pub fn collect_lib_features(base_src_path: &Path) -> Features {
pub fn check(
src_path: &Path,
tests_path: &Path,
compiler_path: &Path,
lib_path: &Path,
bad: &mut bool,
@ -95,10 +96,10 @@ pub fn check(
walk_many(
&[
&src_path.join("test/ui"),
&src_path.join("test/ui-fulldeps"),
&src_path.join("test/rustdoc-ui"),
&src_path.join("test/rustdoc"),
&tests_path.join("ui"),
&tests_path.join("ui-fulldeps"),
&tests_path.join("rustdoc-ui"),
&tests_path.join("rustdoc"),
],
&mut filter_dirs,
&mut |entry, contents| {
@ -480,7 +481,7 @@ fn map_lib_features(
) {
walk(
base_src_path,
&mut |path| filter_dirs(path) || path.ends_with("src/test"),
&mut |path| filter_dirs(path) || path.ends_with("tests"),
&mut |entry, contents| {
let file = entry.path();
let filename = file.file_name().unwrap().to_string_lossy();

View File

@ -25,6 +25,7 @@ fn main() {
.expect("concurrency must be a number");
let src_path = root_path.join("src");
let tests_path = root_path.join("tests");
let library_path = root_path.join("library");
let compiler_path = root_path.join("compiler");
let librustdoc_path = src_path.join("librustdoc");
@ -68,16 +69,16 @@ fn main() {
}
}
check!(target_specific_tests, &src_path);
check!(target_specific_tests, &tests_path);
// Checks that are done on the cargo workspace.
check!(deps, &root_path, &cargo);
check!(extdeps, &root_path);
// Checks over tests.
check!(debug_artifacts, &src_path);
check!(ui_tests, &src_path);
check!(mir_opt_tests, &src_path, bless);
check!(debug_artifacts, &tests_path);
check!(ui_tests, &tests_path);
check!(mir_opt_tests, &tests_path, bless);
// Checks that only make sense for the compiler.
check!(error_codes, &root_path, &[&compiler_path, &librustdoc_path], verbose);
@ -88,6 +89,7 @@ fn main() {
// Checks that need to be done for both the compiler and std libraries.
check!(unit_tests, &src_path);
check!(unit_tests, &tests_path);
check!(unit_tests, &compiler_path);
check!(unit_tests, &library_path);
@ -96,14 +98,17 @@ fn main() {
}
check!(style, &src_path);
check!(style, &tests_path);
check!(style, &compiler_path);
check!(style, &library_path);
check!(edition, &src_path);
check!(edition, &compiler_path);
check!(edition, &library_path);
check!(edition, &tests_path);
check!(alphabetical, &src_path);
check!(alphabetical, &tests_path);
check!(alphabetical, &compiler_path);
check!(alphabetical, &library_path);
@ -113,7 +118,14 @@ fn main() {
drain_handles(&mut handles);
let mut flag = false;
let r = features::check(&src_path, &compiler_path, &library_path, &mut flag, verbose);
let r = features::check(
&src_path,
&tests_path,
&compiler_path,
&library_path,
&mut flag,
verbose,
);
if flag {
bad.store(true, Ordering::Relaxed);
}

View File

@ -6,7 +6,7 @@ use std::path::{Path, PathBuf};
fn check_unused_files(path: &Path, bless: bool, bad: &mut bool) {
let mut rs_files = Vec::<PathBuf>::new();
let mut output_files = HashSet::<PathBuf>::new();
let files = walkdir::WalkDir::new(&path.join("test/mir-opt")).into_iter();
let files = walkdir::WalkDir::new(&path.join("mir-opt")).into_iter();
for file in files.filter_map(Result::ok).filter(|e| e.file_type().is_file()) {
let filepath = file.path();
@ -41,7 +41,7 @@ fn check_unused_files(path: &Path, bless: bool, bad: &mut bool) {
}
fn check_dash_files(path: &Path, bless: bool, bad: &mut bool) {
for file in walkdir::WalkDir::new(&path.join("test/mir-opt"))
for file in walkdir::WalkDir::new(&path.join("mir-opt"))
.into_iter()
.filter_map(Result::ok)
.filter(|e| e.file_type().is_file())

View File

@ -246,7 +246,7 @@ pub fn check(path: &Path, bad: &mut bool) {
// This list should ideally be sourced from rustfmt.toml but we don't want to add a toml
// parser to tidy.
!file.ancestors().any(|a| {
a.ends_with("src/test") ||
(a.ends_with("tests") && a.join("COMPILER_TESTS.md").exists()) ||
a.ends_with("src/doc/book")
});
@ -324,9 +324,10 @@ pub fn check(path: &Path, bad: &mut bool) {
if trimmed.contains("dbg!")
&& !trimmed.starts_with("//")
&& !file
.ancestors()
.any(|a| a.ends_with("src/test") || a.ends_with("library/alloc/tests"))
&& !file.ancestors().any(|a| {
(a.ends_with("tests") && a.join("COMPILER_TESTS.md").exists())
|| a.ends_with("library/alloc/tests")
})
&& filename != "tests.rs"
{
suppressible_tidy_err!(

View File

@ -35,9 +35,8 @@ struct RevisionInfo<'a> {
}
pub fn check(path: &Path, bad: &mut bool) {
let tests = path.join("test");
crate::walk::walk(
&tests,
path,
&mut |path| path.extension().map(|p| p == "rs") == Some(false),
&mut |entry, content| {
let file = entry.path().display();

View File

@ -13,13 +13,13 @@ const ROOT_ENTRY_LIMIT: usize = 939;
const ISSUES_ENTRY_LIMIT: usize = 1998;
fn check_entries(path: &Path, bad: &mut bool) {
for dir in Walk::new(&path.join("test/ui")) {
for dir in Walk::new(&path.join("ui")) {
if let Ok(entry) = dir {
if entry.file_type().map(|ft| ft.is_dir()).unwrap_or(false) {
let dir_path = entry.path();
// Use special values for these dirs.
let is_root = path.join("test/ui") == dir_path;
let is_issues_dir = path.join("test/ui/issues") == dir_path;
let is_root = path.join("ui") == dir_path;
let is_issues_dir = path.join("ui/issues") == dir_path;
let limit = if is_root {
ROOT_ENTRY_LIMIT
} else if is_issues_dir {
@ -53,7 +53,7 @@ fn check_entries(path: &Path, bad: &mut bool) {
pub fn check(path: &Path, bad: &mut bool) {
check_entries(&path, bad);
for path in &[&path.join("test/ui"), &path.join("test/ui-fulldeps")] {
for path in &[&path.join("ui"), &path.join("ui-fulldeps")] {
crate::walk::walk_no_read(path, &mut |_| false, &mut |entry| {
let file_path = entry.path();
if let Some(ext) = file_path.extension() {

View File

@ -22,7 +22,7 @@ pub fn check(root_path: &Path, bad: &mut bool) {
let file_name = path.file_name().unwrap_or_default();
if path.is_dir() {
filter_dirs(path)
|| path.ends_with("src/test")
|| path.ends_with("tests")
|| path.ends_with("src/doc")
|| (file_name == "tests" || file_name == "benches") && !is_core(path)
} else {

View File

@ -14,7 +14,7 @@
// > LLVM ERROR: Cannot select: 0x7f00f400c010: i32,i32,ch = X86ISD::RDSEED 0x7f00f400bfa8:2
// > In function: foo
//
// See also src/test/codegen/target-feature-overrides.rs
// See also tests/codegen/target-feature-overrides.rs
#![feature(no_core, lang_items, link_llvm_intrinsics, abi_unadjusted)]
#![crate_type = "lib"]
#![no_core]

View File

@ -42,7 +42,7 @@ pub enum E2 {
}
// For optimized code we produce a switch with an unreachable target as the `otherwise` so LLVM
// knows the possible values. Compare with `src/test/codegen/match-unoptimized.rs`.
// knows the possible values. Compare with `tests/codegen/match-unoptimized.rs`.
// CHECK-LABEL: @exhaustive_match_2
#[no_mangle]

View File

@ -9,7 +9,7 @@ pub enum E2 {
}
// For unoptimized code we produce a `br` instead of a `switch`. Compare with
// `src/test/codegen/match-optimized.rs`
// `tests/codegen/match-optimized.rs`
// CHECK-LABEL: @exhaustive_match_2
#[no_mangle]

View File

@ -4,7 +4,7 @@
// [COMPAT] compile-flags: -Ctarget-feature=+avx2,+avx
// [INCOMPAT] compile-flags: -Ctarget-feature=-avx2,-avx
// See also src/test/assembly/target-feature-multiple.rs
// See also tests/assembly/target-feature-multiple.rs
#![feature(no_core, lang_items)]
#![crate_type = "lib"]
#![no_core]

View File

@ -1,6 +1,6 @@
// This was originally a regression test for #66975 - ensure that we do not generate never typed
// consts in codegen. We also have tests for this that catches the error, see
// src/test/ui/consts/const-eval/index-out-of-bounds-never-type.rs.
// tests/ui/consts/const-eval/index-out-of-bounds-never-type.rs.
// Force generation of optimized mir for functions that do not reach codegen.
// compile-flags: --emit mir,link

View File

@ -1,6 +1,6 @@
// This is meant as a test case for Issue 3961.
//
// Test via: rustc -Zunpretty normal src/test/pretty/block-comment-wchar.rs
// Test via: rustc -Zunpretty normal tests/pretty/block-comment-wchar.rs
// ignore-tidy-cr
// ignore-tidy-tab
// pp-exact:block-comment-wchar.pp

View File

@ -1,6 +1,6 @@
// This is meant as a test case for Issue 3961.
//
// Test via: rustc -Zunpretty normal src/test/pretty/block-comment-wchar.rs
// Test via: rustc -Zunpretty normal tests/pretty/block-comment-wchar.rs
// ignore-tidy-cr
// ignore-tidy-tab
// pp-exact:block-comment-wchar.pp

View File

@ -1,4 +1,4 @@
include ../tools.mk
all:
$(RUSTC) --edition=2021 -Dwarnings --crate-type=rlib ../../../../library/alloc/src/lib.rs --cfg no_global_oom_handling
$(RUSTC) --edition=2021 -Dwarnings --crate-type=rlib ../../../library/alloc/src/lib.rs --cfg no_global_oom_handling

View File

@ -1,4 +1,4 @@
include ../tools.mk
all:
$(RUSTC) --edition=2021 -Dwarnings --crate-type=rlib ../../../../library/alloc/src/lib.rs --cfg no_rc
$(RUSTC) --edition=2021 -Dwarnings --crate-type=rlib ../../../library/alloc/src/lib.rs --cfg no_rc

View File

@ -1,4 +1,4 @@
include ../tools.mk
all:
$(RUSTC) --edition=2021 -Dwarnings --crate-type=rlib ../../../../library/alloc/src/lib.rs --cfg no_sync
$(RUSTC) --edition=2021 -Dwarnings --crate-type=rlib ../../../library/alloc/src/lib.rs --cfg no_sync

View File

@ -1,4 +1,4 @@
include ../tools.mk
all:
$(RUSTC) --edition=2021 -Dwarnings --crate-type=rlib ../../../../library/core/src/lib.rs --cfg no_fp_fmt_parse
$(RUSTC) --edition=2021 -Dwarnings --crate-type=rlib ../../../library/core/src/lib.rs --cfg no_fp_fmt_parse

View File

@ -4,7 +4,7 @@ include ../tools.mk
# together with the borrow checker information.
# How to run this
# $ ./x.py test src/test/run-make-fulldeps/obtain-borrowck
# $ ./x.py test tests/run-make-fulldeps/obtain-borrowck
DRIVER_BINARY := "$(TMPDIR)"/driver
SYSROOT := $(shell $(RUSTC) --print sysroot)

View File

@ -1,3 +1,3 @@
# Directory "coverage" supports the tests at prefix ../coverage-*
# Use ./x.py [options] test src/test/run-make/coverage to run all related tests.
# Use ./x.py [options] test tests/run-make/coverage to run all related tests.

View File

@ -1,5 +1,5 @@
# ignore-windows
# This test should be replaced with one in src/test/debuginfo once GDB or LLDB support 128-bit
# This test should be replaced with one in tests/debuginfo once GDB or LLDB support 128-bit
# enums.
include ../../run-make-fulldeps/tools.mk

View File

@ -5,7 +5,7 @@ include ../../run-make-fulldeps/tools.mk
# ignore-gnux32
# How to manually run this
# $ ./x.py test --target x86_64-unknown-linux-[musl,gnu] src/test/run-make/static-pie
# $ ./x.py test --target x86_64-unknown-linux-[musl,gnu] tests/run-make/static-pie
all: test-clang test-gcc

View File

@ -2,7 +2,7 @@ include ../../run-make-fulldeps/tools.mk
# How to run this
# $ ./x.py clean
# $ ./x.py test --target thumbv6m-none-eabi,thumbv7m-none-eabi src/test/run-make
# $ ./x.py test --target thumbv6m-none-eabi,thumbv7m-none-eabi tests/run-make
# Supported targets:
# - thumbv6m-none-eabi (Bare Cortex-M0, M0+, M1)

View File

@ -4,7 +4,7 @@ include ../../run-make-fulldeps/tools.mk
# How to run this
# $ ./x.py clean
# $ ./x.py test --target thumbv7m-none-eabi src/test/run-make
# $ ./x.py test --target thumbv7m-none-eabi tests/run-make
# For cargo setting
export RUSTC := $(RUSTC_ORIGINAL)

View File

@ -11,14 +11,14 @@ You can find more information and its documentation in its [repository][browser-
If you need to have more information on the tests run, you can use `--test-args`:
```bash
$ ./x.py test src/test/rustdoc-gui --stage 1 --test-args --debug
$ ./x.py test tests/rustdoc-gui --stage 1 --test-args --debug
```
If you don't want to run in headless mode (helpful to debug sometimes), you can use
`--no-headless`:
```bash
$ ./x.py test src/test/rustdoc-gui --stage 1 --test-args --no-headless
$ ./x.py test tests/rustdoc-gui --stage 1 --test-args --no-headless
```
To see the supported options, use `--help`.
@ -27,7 +27,7 @@ Important to be noted: if the chromium instance crashes when you run it, you mig
use `--no-sandbox` to make it work:
```bash
$ ./x.py test src/test/rustdoc-gui --stage 1 --test-args --no-sandbox
$ ./x.py test tests/rustdoc-gui --stage 1 --test-args --no-sandbox
```
[browser-ui-test]: https://github.com/GuillaumeGomez/browser-UI-test/

View File

@ -1,6 +1,6 @@
// check-pass
// compile-flags:--test --test-args --test-threads=1
// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
// Crates like core have doctests gated on `cfg(not(test))` so we need to make

View File

@ -1,7 +1,7 @@
// check-pass
// compile-flags: --test --nocapture --check-cfg=values(feature,"test") -Z unstable-options
// normalize-stderr-test: "src/test/rustdoc-ui" -> "$$DIR"
// normalize-stdout-test: "src/test/rustdoc-ui" -> "$$DIR"
// normalize-stderr-test: "tests/rustdoc-ui" -> "$$DIR"
// normalize-stdout-test: "tests/rustdoc-ui" -> "$$DIR"
// normalize-stdout-test "finished in \d+\.\d+s" -> "finished in $$TIME"
/// The doctest will produce a warning because feature invalid is unexpected

View File

@ -1,7 +1,7 @@
+-------------------------------------+------------+------------+------------+------------+
| File | Documented | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| ...est/rustdoc-ui/coverage/basic.rs | 7 | 50.0% | 0 | 0.0% |
| ...sts/rustdoc-ui/coverage/basic.rs | 7 | 50.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+
| Total | 7 | 50.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+

View File

@ -1,7 +1,7 @@
+-------------------------------------+------------+------------+------------+------------+
| File | Documented | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| ...est/rustdoc-ui/coverage/empty.rs | 0 | 0.0% | 0 | 0.0% |
| ...sts/rustdoc-ui/coverage/empty.rs | 0 | 0.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+
| Total | 0 | 0.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+

View File

@ -1,7 +1,7 @@
+-------------------------------------+------------+------------+------------+------------+
| File | Documented | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| ...est/rustdoc-ui/coverage/enums.rs | 6 | 75.0% | 0 | 0.0% |
| ...sts/rustdoc-ui/coverage/enums.rs | 6 | 75.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+
| Total | 6 | 75.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+

View File

@ -1,7 +1,7 @@
+-------------------------------------+------------+------------+------------+------------+
| File | Documented | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| ...st/rustdoc-ui/coverage/exotic.rs | 3 | 100.0% | 0 | 0.0% |
| ...ts/rustdoc-ui/coverage/exotic.rs | 3 | 100.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+
| Total | 3 | 100.0% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+

View File

@ -1,7 +1,7 @@
+-------------------------------------+------------+------------+------------+------------+
| File | Documented | Percentage | Examples | Percentage |
+-------------------------------------+------------+------------+------------+------------+
| ...t/rustdoc-ui/coverage/private.rs | 4 | 57.1% | 0 | 0.0% |
| ...s/rustdoc-ui/coverage/private.rs | 4 | 57.1% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+
| Total | 4 | 57.1% | 0 | 0.0% |
+-------------------------------------+------------+------------+------------+------------+

Some files were not shown because too many files have changed in this diff Show More