Skip to content

Commit b2a8d34

Browse files
committed
add exclude to config.toml
1 parent f44efbf commit b2a8d34

File tree

2 files changed

+25
-16
lines changed

2 files changed

+25
-16
lines changed

config.example.toml

+3
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,9 @@
425425
# a specific version.
426426
#ccache = false
427427

428+
# List of tests or directories to exclude from the test suite. For example, exclude = ["tests/ui", "tests/debuginfo"];
429+
#exclude = []
430+
428431
# =============================================================================
429432
# General install configuration options
430433
# =============================================================================

src/bootstrap/src/core/config/config.rs

+22-16
Original file line numberDiff line numberDiff line change
@@ -940,6 +940,7 @@ define_config! {
940940
jobs: Option<u32> = "jobs",
941941
compiletest_diff_tool: Option<String> = "compiletest-diff-tool",
942942
ccache: Option<StringOrBool> = "ccache",
943+
exclude: Option<Vec<PathBuf>> = "exclude",
943944
}
944945
}
945946

@@ -1370,22 +1371,6 @@ impl Config {
13701371
"flags.exclude" = ?flags.exclude
13711372
);
13721373

1373-
config.skip = flags
1374-
.skip
1375-
.into_iter()
1376-
.chain(flags.exclude)
1377-
.map(|p| {
1378-
// Never return top-level path here as it would break `--skip`
1379-
// logic on rustc's internal test framework which is utilized
1380-
// by compiletest.
1381-
if cfg!(windows) {
1382-
PathBuf::from(p.to_str().unwrap().replace('/', "\\"))
1383-
} else {
1384-
p
1385-
}
1386-
})
1387-
.collect();
1388-
13891374
#[cfg(feature = "tracing")]
13901375
span!(
13911376
target: "CONFIG_HANDLING",
@@ -1630,8 +1615,29 @@ impl Config {
16301615
jobs,
16311616
compiletest_diff_tool,
16321617
mut ccache,
1618+
exclude,
16331619
} = toml.build.unwrap_or_default();
16341620

1621+
let mut paths: Vec<PathBuf> = flags.skip.into_iter().chain(flags.exclude).collect();
1622+
1623+
if let Some(exclude) = exclude {
1624+
paths.extend(exclude);
1625+
}
1626+
1627+
config.skip = paths
1628+
.into_iter()
1629+
.map(|p| {
1630+
// Never return top-level path here as it would break `--skip`
1631+
// logic on rustc's internal test framework which is utilized
1632+
// by compiletest.
1633+
if cfg!(windows) {
1634+
PathBuf::from(p.to_str().unwrap().replace('/', "\\"))
1635+
} else {
1636+
p
1637+
}
1638+
})
1639+
.collect();
1640+
16351641
config.jobs = Some(threads_from_config(flags.jobs.unwrap_or(jobs.unwrap_or(0))));
16361642

16371643
if let Some(file_build) = build {

0 commit comments

Comments
 (0)