Skip to content

Commit 6b7b775

Browse files
committed
Include better context for "already exists" error in compiletest
1 parent 3603a84 commit 6b7b775

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

Cargo.lock

+1
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,7 @@ dependencies = [
723723
name = "compiletest"
724724
version = "0.0.0"
725725
dependencies = [
726+
"anyhow",
726727
"build_helper",
727728
"colored",
728729
"diff",

src/tools/compiletest/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ once_cell = "1.16.0"
2020
walkdir = "2"
2121
glob = "0.3.0"
2222
lazycell = "1.3.0"
23+
anyhow = "1"
2324

2425
[target.'cfg(unix)'.dependencies]
2526
libc = "0.2"

src/tools/compiletest/src/runtest.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ use std::process::{Child, Command, ExitStatus, Output, Stdio};
3232
use std::str;
3333
use std::sync::Arc;
3434

35+
use anyhow::Context;
3536
use glob::glob;
3637
use once_cell::sync::Lazy;
3738
use tracing::*;
@@ -131,7 +132,11 @@ pub fn run(config: Arc<Config>, testpaths: &TestPaths, revision: Option<&str>) {
131132
}
132133

133134
let cx = TestCx { config: &config, props: &props, testpaths, revision };
134-
create_dir_all(&cx.output_base_dir()).unwrap();
135+
create_dir_all(&cx.output_base_dir())
136+
.with_context(|| {
137+
format!("failed to create output base directory {}", cx.output_base_dir().display())
138+
})
139+
.unwrap();
135140
if props.incremental {
136141
cx.init_incremental_test();
137142
}

0 commit comments

Comments
 (0)