Skip to content

Commit

Permalink
add exclude to config.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
Shourya742 committed Feb 16, 2025
1 parent 54a0f38 commit e9a9186
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 16 deletions.
3 changes: 3 additions & 0 deletions config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,9 @@
# a specific version.
#ccache = false

# List of tests or directories to exclude from the test suite. For example, exclude = ["tests/ui", "tests/debuginfo"];
#exclude = []

# =============================================================================
# General install configuration options
# =============================================================================
Expand Down
38 changes: 22 additions & 16 deletions src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,7 @@ define_config! {
jobs: Option<u32> = "jobs",
compiletest_diff_tool: Option<String> = "compiletest-diff-tool",
ccache: Option<StringOrBool> = "ccache",
exclude: Option<Vec<PathBuf>> = "exclude",
}
}

Expand Down Expand Up @@ -1365,22 +1366,6 @@ impl Config {
"flags.exclude" = ?flags.exclude
);

config.skip = flags
.skip
.into_iter()
.chain(flags.exclude)
.map(|p| {
// Never return top-level path here as it would break `--skip`
// logic on rustc's internal test framework which is utilized
// by compiletest.
if cfg!(windows) {
PathBuf::from(p.to_str().unwrap().replace('/', "\\"))
} else {
p
}
})
.collect();

#[cfg(feature = "tracing")]
span!(
target: "CONFIG_HANDLING",
Expand Down Expand Up @@ -1625,8 +1610,29 @@ impl Config {
jobs,
compiletest_diff_tool,
mut ccache,
exclude,
} = toml.build.unwrap_or_default();

let mut paths: Vec<PathBuf> = flags.skip.into_iter().chain(flags.exclude).collect();

if let Some(exclude) = exclude {
paths.extend(exclude);
}

config.skip = paths
.into_iter()
.map(|p| {
// Never return top-level path here as it would break `--skip`
// logic on rustc's internal test framework which is utilized
// by compiletest.
if cfg!(windows) {
PathBuf::from(p.to_str().unwrap().replace('/', "\\"))
} else {
p
}
})
.collect();

config.jobs = Some(threads_from_config(flags.jobs.unwrap_or(jobs.unwrap_or(0))));

if let Some(file_build) = build {
Expand Down

0 comments on commit e9a9186

Please sign in to comment.