Skip to content

Commit 472721b

Browse files
committed
bootstrap: rustdoc-js tests can now be filtered by js files
1 parent 76c5ed2 commit 472721b

File tree

1 file changed

+15
-1
lines changed
  • src/bootstrap/src/core/build_steps

1 file changed

+15
-1
lines changed

src/bootstrap/src/core/build_steps/test.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2086,11 +2086,25 @@ HELP: You can add it into `bootstrap.toml` in `rust.codegen-backends = [{name:?}
20862086
}
20872087

20882088
// Get paths from cmd args
2089-
let paths = match &builder.config.cmd {
2089+
let mut paths = match &builder.config.cmd {
20902090
Subcommand::Test { .. } => &builder.config.paths[..],
20912091
_ => &[],
20922092
};
20932093

2094+
// in rustdoc-js mode, allow filters to be rs files or js files.
2095+
// use a late-initialized Vec to avoid cloning for other modes.
2096+
let mut paths_v;
2097+
if mode == "rustdoc-js" {
2098+
paths_v = paths.to_vec();
2099+
for p in &mut paths_v {
2100+
if let Some(ext) = p.extension()
2101+
&& ext == "js"
2102+
{
2103+
p.set_extension("rs");
2104+
}
2105+
}
2106+
paths = &paths_v;
2107+
}
20942108
// Get test-args by striping suite path
20952109
let mut test_args: Vec<&str> = paths
20962110
.iter()

0 commit comments

Comments
 (0)