Skip to content

Commit

Permalink
Add test that a new RustwideBuilder sees the existing toolchain version
Browse files Browse the repository at this point in the history
  • Loading branch information
Nemo157 committed Nov 8, 2023
1 parent 624628a commit 2dd86d1
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/docbuilder/rustwide_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1329,4 +1329,25 @@ mod tests {
Ok(())
})
}

#[test]
#[ignore]
fn test_new_builder_detects_existing_rustc() {
wrapper(|env: &TestEnvironment| {
let mut builder = RustwideBuilder::init(env)?;
builder.update_toolchain()?;
drop(builder);

// new builder should detect the existing rustc version from the previous builder
// (simulating running `update-toolchain` and `build crate` in separate invocations)
let mut builder = RustwideBuilder::init(env)?;
assert!(builder.build_package(
DUMMY_CRATE_NAME,
DUMMY_CRATE_VERSION,
PackageKind::CratesIo
)?);

Ok(())
})
}
}

0 comments on commit 2dd86d1

Please sign in to comment.