Skip to content

Commit d5e042b

Browse files
committed
Add snapshot test for x install
1 parent f22b12f commit d5e042b

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
@@ -2188,6 +2188,72 @@ mod snapshot {
21882188
.path("bootstrap")
21892189
.render_steps(), @"[clippy] rustc 0 <host> -> bootstrap 1 <host>");
21902190
}
2191+
2192+
#[test]
2193+
fn install_extended() {
2194+
let ctx = TestCtx::new();
2195+
insta::assert_snapshot!(
2196+
ctx.config("install")
2197+
.args(&[
2198+
"--set", &format!("install.prefix={}", ctx.dir().display()),
2199+
"--set", &format!("install.sysconfdir={}", ctx.dir().display()),
2200+
"--set", "build.extended=true"
2201+
])
2202+
.render_steps(), @r"
2203+
[build] llvm <host>
2204+
[build] rustc 0 <host> -> rustc 1 <host>
2205+
[build] rustc 0 <host> -> WasmComponentLd 1 <host>
2206+
[build] rustc 1 <host> -> std 1 <host>
2207+
[build] rustc 1 <host> -> rustc 2 <host>
2208+
[build] rustc 1 <host> -> WasmComponentLd 2 <host>
2209+
[build] rustc 0 <host> -> UnstableBookGen 1 <host>
2210+
[build] rustc 0 <host> -> Rustbook 1 <host>
2211+
[doc] unstable-book (book) <host>
2212+
[doc] book (book) <host>
2213+
[doc] book/first-edition (book) <host>
2214+
[doc] book/second-edition (book) <host>
2215+
[doc] book/2018-edition (book) <host>
2216+
[build] rustdoc 1 <host>
2217+
[doc] rustc 1 <host> -> standalone 2 <host>
2218+
[build] rustdoc 2 <host>
2219+
[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]
2220+
[build] rustc 1 <host> -> error-index 2 <host>
2221+
[doc] rustc 1 <host> -> error-index 2 <host>
2222+
[doc] nomicon (book) <host>
2223+
[doc] rustc 1 <host> -> reference (book) 2 <host>
2224+
[doc] rustdoc (book) <host>
2225+
[doc] rust-by-example (book) <host>
2226+
[build] rustc 0 <host> -> LintDocs 1 <host>
2227+
[doc] rustc (book) <host>
2228+
[doc] cargo (book) <host>
2229+
[doc] clippy (book) <host>
2230+
[doc] embedded-book (book) <host>
2231+
[doc] edition-guide (book) <host>
2232+
[doc] style-guide (book) <host>
2233+
[doc] rustc 1 <host> -> releases 2 <host>
2234+
[build] rustc 0 <host> -> RustInstaller 1 <host>
2235+
[dist] docs <host>
2236+
[build] rustc 2 <host> -> std 2 <host>
2237+
[dist] rustc 2 <host> -> std 2 <host>
2238+
[build] rustc 1 <host> -> rust-analyzer-proc-macro-srv 2 <host>
2239+
[build] rustc 0 <host> -> GenerateCopyright 1 <host>
2240+
[dist] rustc <host>
2241+
[build] rustc 2 <host> -> cargo 3 <host>
2242+
[dist] rustc 2 <host> -> cargo 3 <host>
2243+
[build] rustc 2 <host> -> rustc 3 <host>
2244+
[build] rustc 2 <host> -> WasmComponentLd 3 <host>
2245+
[build] rustc 2 <host> -> rust-analyzer 3 <host>
2246+
[dist] rustc 2 <host> -> rust-analyzer 3 <host>
2247+
[build] rustc 2 <host> -> rustfmt 3 <host>
2248+
[build] rustc 2 <host> -> cargo-fmt 3 <host>
2249+
[build] rustc 2 <host> -> clippy-driver 3 <host>
2250+
[build] rustc 2 <host> -> cargo-clippy 3 <host>
2251+
[dist] rustc 2 <host> -> clippy 3 <host>
2252+
[build] rustc 2 <host> -> miri 3 <host>
2253+
[build] rustc 2 <host> -> cargo-miri 3 <host>
2254+
[dist] src <>
2255+
");
2256+
}
21912257
}
21922258

21932259
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)