refact: Distribute unwrap()
This gives us better error messages in case it does go wrong. (cherry picked from commit 0fec573d82b6c51e72183ae5a19c922a53863d5b)
This commit is contained in:
parent
625d17b0db
commit
a2686c31b2
1 changed files with 10 additions and 13 deletions
|
|
@ -248,20 +248,17 @@ mod tests {
|
||||||
|
|
||||||
#[ctor]
|
#[ctor]
|
||||||
fn setup() {
|
fn setup() {
|
||||||
(|| -> Result<()> {
|
init().unwrap();
|
||||||
init()?;
|
|
||||||
// During development, we encountered a problem where the build hook
|
|
||||||
// would cause the test suite to reinvokes itself, causing an infinite loop.
|
|
||||||
// While _NIX_TEST_NO_SANDBOX=1 should prevent this, we may also set the
|
|
||||||
// build hook to "" to prevent this.
|
|
||||||
// settings::set("build-hook", "")?;
|
|
||||||
|
|
||||||
// When testing in the sandbox, the default build dir would be a parent of the storeDir,
|
// During development, we encountered a problem where the build hook
|
||||||
// which causes an error. So we set a custom build dir here.
|
// would cause the test suite to reinvokes itself, causing an infinite loop.
|
||||||
settings::set("sandbox-build-dir", "/custom-build-dir-for-test")?;
|
// While _NIX_TEST_NO_SANDBOX=1 should prevent this, we may also set the
|
||||||
Ok(())
|
// build hook to "" to prevent this.
|
||||||
})()
|
// settings::set("build-hook", "")?;
|
||||||
.unwrap();
|
|
||||||
|
// When testing in the sandbox, the default build dir would be a parent of the storeDir,
|
||||||
|
// which causes an error. So we set a custom build dir here.
|
||||||
|
settings::set("sandbox-build-dir", "/custom-build-dir-for-test").unwrap();
|
||||||
std::env::set_var("_NIX_TEST_NO_SANDBOX", "1");
|
std::env::set_var("_NIX_TEST_NO_SANDBOX", "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue