Skip to content

Commit 5c03710

Browse files
committed
Add snapshot test for x install
1 parent fc4bf13 commit 5c03710

File tree

2 files changed

+70
-0
lines changed

2 files changed

+70
-0
lines changed

src/bootstrap/src/core/builder/tests.rs

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2265,6 +2265,72 @@ mod snapshot {
22652265
.path("bootstrap")
22662266
.render_steps(), @"[clippy] rustc 0 <host> -> bootstrap 1 <host>");
22672267
}
2268+
2269+
#[test]
2270+
fn install_extended() {
2271+
let ctx = TestCtx::new();
2272+
insta::assert_snapshot!(
2273+
ctx.config("install")
2274+
.args(&[
2275+
"--set", &format!("install.prefix={}", ctx.dir().display()),
2276+
"--set", &format!("install.sysconfdir={}", ctx.dir().display()),
2277+
"--set", "build.extended=true"
2278+
])
2279+
.render_steps(), @r"
2280+
[build] llvm <host>
2281+
[build] rustc 0 <host> -> rustc 1 <host>
2282+
[build] rustc 0 <host> -> WasmComponentLd 1 <host>
2283+
[build] rustc 1 <host> -> std 1 <host>
2284+
[build] rustc 1 <host> -> rustc 2 <host>
2285+
[build] rustc 1 <host> -> WasmComponentLd 2 <host>
2286+
[build] rustc 0 <host> -> UnstableBookGen 1 <host>
2287+
[build] rustc 0 <host> -> Rustbook 1 <host>
2288+
[doc] unstable-book (book) <host>
2289+
[doc] book (book) <host>
2290+
[doc] book/first-edition (book) <host>
2291+
[doc] book/second-edition (book) <host>
2292+
[doc] book/2018-edition (book) <host>
2293+
[build] rustdoc 1 <host>
2294+
[doc] rustc 1 <host> -> standalone 2 <host>
2295+
[build] rustdoc 2 <host>
2296+
[doc] rustc 2 <host> -> std 2 <host> crates=[alloc,compiler_builtins,core,panic_abort,panic_unwind,proc_macro,rustc-std-workspace-core,std,std_detect,sysroot,test,unwind]
2297+
[build] rustc 1 <host> -> error-index 2 <host>
2298+
[doc] rustc 1 <host> -> error-index 2 <host>
2299+
[doc] nomicon (book) <host>
2300+
[doc] rustc 1 <host> -> reference (book) 2 <host>
2301+
[doc] rustdoc (book) <host>
2302+
[doc] rust-by-example (book) <host>
2303+
[build] rustc 0 <host> -> LintDocs 1 <host>
2304+
[doc] rustc (book) <host>
2305+
[doc] cargo (book) <host>
2306+
[doc] clippy (book) <host>
2307+
[doc] embedded-book (book) <host>
2308+
[doc] edition-guide (book) <host>
2309+
[doc] style-guide (book) <host>
2310+
[doc] rustc 1 <host> -> releases 2 <host>
2311+
[build] rustc 0 <host> -> RustInstaller 1 <host>
2312+
[dist] docs <host>
2313+
[build] rustc 2 <host> -> std 2 <host>
2314+
[dist] rustc 2 <host> -> std 2 <host>
2315+
[build] rustc 1 <host> -> rust-analyzer-proc-macro-srv 2 <host>
2316+
[build] rustc 0 <host> -> GenerateCopyright 1 <host>
2317+
[dist] rustc <host>
2318+
[build] rustc 2 <host> -> cargo 3 <host>
2319+
[dist] rustc 2 <host> -> cargo 3 <host>
2320+
[build] rustc 2 <host> -> rustc 3 <host>
2321+
[build] rustc 2 <host> -> WasmComponentLd 3 <host>
2322+
[build] rustc 2 <host> -> rust-analyzer 3 <host>
2323+
[dist] rustc 2 <host> -> rust-analyzer 3 <host>
2324+
[build] rustc 2 <host> -> rustfmt 3 <host>
2325+
[build] rustc 2 <host> -> cargo-fmt 3 <host>
2326+
[build] rustc 2 <host> -> clippy-driver 3 <host>
2327+
[build] rustc 2 <host> -> cargo-clippy 3 <host>
2328+
[dist] rustc 2 <host> -> clippy 3 <host>
2329+
[build] rustc 2 <host> -> miri 3 <host>
2330+
[build] rustc 2 <host> -> cargo-miri 3 <host>
2331+
[dist] src <>
2332+
");
2333+
}
22682334
}
22692335

22702336
struct ExecutedSteps {

src/bootstrap/src/utils/tests/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ impl TestCtx {
3131
Self { directory }
3232
}
3333

34+
pub fn dir(&self) -> &Path {
35+
self.directory.path()
36+
}
37+
3438
/// Starts a new invocation of bootstrap that executes `kind` as its top level command
3539
/// (i.e. `x <kind>`). Returns a builder that configures the created config through CLI flags.
3640
pub fn config(&self, kind: &str) -> ConfigBuilder {

0 commit comments

Comments
 (0)