• Home
  • Raw
  • Download

Lines Matching +full:test +full:- +full:crates

1 //! Implementation of compiling the compiler and standard library, in "check"-based modes.
17 /// Whether to build only a subset of crates.
22 crates: Interned<Vec<String>>, field
26 fn args(builder: &Builder<'_>) -> Vec<String> { in args()
27 fn strings<'a>(arr: &'a [&str]) -> impl Iterator<Item = String> + 'a { in args()
46 "--fix", "-Zunstable-options", in args()
47 // FIXME: currently, `--fix` gives an error while checking tests for libtest, in args()
49 // As a workaround, avoid checking tests and benches when passed --fix. in args()
50 "--lib", "--bins", "--examples", in args()
53 args.extend(strings(&["--", "--cap-lints", "warn"])); in args()
54 args.extend(ignored_lints.iter().map(|lint| format!("-Aclippy::{}", lint))); in args()
56 allow.iter().for_each(|v| clippy_lint_levels.push(format!("-A{}", v))); in args()
57 deny.iter().for_each(|v| clippy_lint_levels.push(format!("-D{}", v))); in args()
58 warn.iter().for_each(|v| clippy_lint_levels.push(format!("-W{}", v))); in args()
59 forbid.iter().for_each(|v| clippy_lint_levels.push(format!("-F{}", v))); in args()
68 fn cargo_subcommand(kind: Kind) -> &'static str { in cargo_subcommand()
78 pub fn new(target: TargetSelection) -> Self { in new()
79 Self { target, crates: INTERNER.intern_list(vec![]) } in new()
87 fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { in should_run()
92 let crates = make_run_crates(&run, "library"); in make_run() localVariable
93 run.builder.ensure(Std { target: run.target, crates }); in make_run()
111 …, cargo tries to fix all targets. Tell it not to fix tests until we've added `test` to the sysroot. in run()
112 cargo.arg("--lib"); in run()
115 for krate in &*self.crates { in run()
116 cargo.arg("-p").arg(krate); in run()
120 format_args!("library artifacts{}", crate_description(&self.crates)), in run()
133 // We skip populating the sysroot in non-zero stage because that'll lead in run()
142 // don't check test dependencies if we haven't built libtest in run()
143 if builder.kind == Kind::Clippy || !self.crates.is_empty() { in run()
148 // crates into the sysroot. This is needed because e.g., core's tests in run()
149 // depend on `libtest` -- Cargo presumes it will exist, but it doesn't in run()
152 // Currently only the "libtest" tree of crates does this. in run()
165 cargo.arg("--all-targets"); in run()
170 // Explicitly pass -p for all dependencies krates -- this will force cargo in run()
171 // to also check the tests/benches/examples for these crates, rather in run()
173 for krate in &*self.crates { in run()
174 cargo.arg("-p").arg(krate); in run()
177 let _guard = builder.msg_check("library test/bench/example targets", target); in run()
193 /// Whether to build only a subset of crates.
198 crates: Interned<Vec<String>>, field
202 pub fn new(target: TargetSelection, builder: &Builder<'_>) -> Self { in new()
203 let mut crates = vec![]; in new() localVariable
204 for krate in builder.in_tree_crates("rustc-main", None) { in new()
205 crates.push(krate.name.to_string()); in new()
207 Self { target, crates: INTERNER.intern_list(crates) } in new()
216 fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { in should_run()
217 run.crate_or_deps("rustc-main").path("compiler") in should_run()
221 let crates = make_run_crates(&run, "compiler"); in make_run() localVariable
222 run.builder.ensure(Rustc { target: run.target, crates }); in make_run()
238 // fail when building crates that need to generate code (e.g., build in run()
255 // For ./x.py clippy, don't run with --all-targets because in run()
258 cargo.arg("--all-targets"); in run()
261 // Explicitly pass -p for all compiler crates -- this will force cargo in run()
262 // to also check the tests/benches/examples for these crates, rather in run()
264 for krate in &*self.crates { in run()
265 cargo.arg("-p").arg(krate); in run()
269 format_args!("compiler artifacts{}", crate_description(&self.crates)), in run()
299 fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { in should_run()
324 .arg("--manifest-path") in run()
352 fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> { in should_run()
353 run.path("src/tools/rust-analyzer") in should_run()
372 "src/tools/rust-analyzer", in run()
374 &["rust-analyzer/in-rust-tree".to_owned()], in run()
382 // can't use `--all-targets` because `--examples` doesn't work well in run()
383 cargo.arg("--bins"); in run()
384 cargo.arg("--tests"); in run()
385 cargo.arg("--benches"); in run()
388 let _guard = builder.msg_check("rust-analyzer artifacts", target); in run()
401 fn stamp(builder: &Builder<'_>, compiler: Compiler, target: TargetSelection) -> PathBuf { in run()
402 builder.cargo_out(compiler, Mode::ToolStd, target).join(".rust-analyzer-check.stamp") in run()
417 // don't ever check out-of-tree tools by default, they'll fail when toolstate is broken
420 fn should_run(run: ShouldRun<'_>) -> ShouldRun<'_> {
445 // For ./x.py clippy, don't run with --all-targets because
448 cargo.arg("--all-targets");
453 // See https://github.com/rust-lang/rust/pull/80573#issuecomment-754010776
454 cargo.rustflag("-Zunstable-options");
472 ) -> PathBuf {
475 .join(format!(".{}-check.stamp", stringify!($name).to_lowercase()))
484 // of a submodule. Since the SourceType only drives the deny-warnings
485 // behavior, treat it as in-tree so that any new warnings in clippy will be
489 tool_check_step!(CargoMiri, "src/tools/miri/cargo-miri", SourceType::InTree);
492 tool_check_step!(MiroptTestTools, "src/tools/miropt-test-tools", SourceType::InTree);
498 fn libstd_stamp(builder: &Builder<'_>, compiler: Compiler, target: TargetSelection) -> PathBuf { in libstd_stamp()
499 builder.cargo_out(compiler, Mode::Std, target).join(".libstd-check.stamp") in libstd_stamp()
508 ) -> PathBuf { in libstd_test_stamp()
509 builder.cargo_out(compiler, Mode::Std, target).join(".libstd-check-test.stamp") in libstd_test_stamp()
514 fn librustc_stamp(builder: &Builder<'_>, compiler: Compiler, target: TargetSelection) -> PathBuf { in librustc_stamp()
515 builder.cargo_out(compiler, Mode::Rustc, target).join(".librustc-check.stamp") in librustc_stamp()
525 ) -> PathBuf { in codegen_backend_stamp()
528 .join(format!(".librustc_codegen_{}-check.stamp", backend)) in codegen_backend_stamp()