Skip to content

Commit e9a9186

Browse files
committed
add exclude to config.toml
1 parent 54a0f38 commit e9a9186

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
@@ -936,6 +936,7 @@ define_config! {
936936
jobs: Option<u32> = "jobs",
937937
compiletest_diff_tool: Option<String> = "compiletest-diff-tool",
938938
ccache: Option<StringOrBool> = "ccache",
939+
exclude: Option<Vec<PathBuf>> = "exclude",
939940
}
940941
}
941942

@@ -1365,22 +1366,6 @@ impl Config {
13651366
"flags.exclude" = ?flags.exclude
13661367
);
13671368

1368-
config.skip = flags
1369-
.skip
1370-
.into_iter()
1371-
.chain(flags.exclude)
1372-
.map(|p| {
1373-
// Never return top-level path here as it would break `--skip`
1374-
// logic on rustc's internal test framework which is utilized
1375-
// by compiletest.
1376-
if cfg!(windows) {
1377-
PathBuf::from(p.to_str().unwrap().replace('/', "\\"))
1378-
} else {
1379-
p
1380-
}
1381-
})
1382-
.collect();
1383-
13841369
#[cfg(feature = "tracing")]
13851370
span!(
13861371
target: "CONFIG_HANDLING",
@@ -1625,8 +1610,29 @@ impl Config {
16251610
jobs,
16261611
compiletest_diff_tool,
16271612
mut ccache,
1613+
exclude,
16281614
} = toml.build.unwrap_or_default();
16291615

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

16321638
if let Some(file_build) = build {

0 commit comments

Comments
 (0)