Rollup merge of #112562 - klensy:rd-gui-test-win, r=GuillaumeGomez
rustdoc-gui: allow running on Windows This adds few fixes to allow running `python x.py test rustdoc-gui` on Windows. * path to npm required to be `npm.cmd` on Windows (otherwise don't work for me) * properly parse node module version on Windows * properly provide path to browser-ui-test runner (fixed in #112613) r? `@GuillaumeGomez`
This commit is contained in:
commit
9fe4630797
2 changed files with 18 additions and 5 deletions
|
|
@ -250,6 +250,13 @@ changelog-seen = 2
|
|||
# target when running tests, otherwise this can be omitted.
|
||||
#nodejs = "node"
|
||||
|
||||
# The npm executable to use. Note that this is used for rustdoc-gui tests,
|
||||
# otherwise this can be omitted.
|
||||
#
|
||||
# Under Windows this should be `npm.cmd` or path to it (verified on nodejs v18.06), or
|
||||
# error will be emitted.
|
||||
#npm = "npm"
|
||||
|
||||
# Python interpreter to use for various tasks throughout the build, notably
|
||||
# rustdoc tests, the lldb python interpreter, and some dist bits and pieces.
|
||||
#
|
||||
|
|
|
|||
|
|
@ -14,13 +14,19 @@ fn get_browser_ui_test_version_inner(npm: &Path, global: bool) -> Option<String>
|
|||
if global {
|
||||
command.arg("--global");
|
||||
}
|
||||
let lines = command
|
||||
.output()
|
||||
.map(|output| String::from_utf8_lossy(&output.stdout).into_owned())
|
||||
.unwrap_or(String::new());
|
||||
let lines = match command.output() {
|
||||
Ok(output) => String::from_utf8_lossy(&output.stdout).into_owned(),
|
||||
Err(e) => {
|
||||
eprintln!(
|
||||
"path to npm can be wrong, provided path: {npm:?}. Try to set npm path \
|
||||
in config.toml in [build.npm]",
|
||||
);
|
||||
panic!("{:?}", e)
|
||||
}
|
||||
};
|
||||
lines
|
||||
.lines()
|
||||
.find_map(|l| l.split(':').nth(1)?.strip_prefix("browser-ui-test@"))
|
||||
.find_map(|l| l.rsplit(':').next()?.strip_prefix("browser-ui-test@"))
|
||||
.map(|v| v.to_owned())
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue