Skip to content

Commit a84016a

Browse files
authored
Rollup merge of rust-lang#140800 - GuillaumeGomez:rustdoc-tempdir-removal, r=jieyouxu
Make `rustdoc-tempdir-removal` run-make tests work on other platforms than linux Follow-up of rust-lang#140706. r? ``@jieyouxu``
2 parents a7308ac + 41ff588 commit a84016a

File tree

1 file changed

+11
-3
lines changed
  • tests/run-make/rustdoc-tempdir-removal

1 file changed

+11
-3
lines changed

tests/run-make/rustdoc-tempdir-removal/rmake.rs

+11-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
// This test ensures that no temporary folder is "left behind" when doctests fail for any reason.
22

3-
//@ only-linux
3+
//@ ignore-cross-compile
44

55
use std::path::Path;
66

77
use run_make_support::{path, rfs, rustdoc};
88

99
fn run_doctest_and_check_tmpdir(tmp_dir: &Path, doctest: &str, edition: &str) {
10-
let output =
11-
rustdoc().input(doctest).env("TMPDIR", tmp_dir).arg("--test").edition(edition).run_fail();
10+
let mut runner = rustdoc();
11+
runner.input(doctest).arg("--test").edition(edition);
12+
let output = if cfg!(unix) {
13+
runner.env("TMPDIR", tmp_dir)
14+
} else if cfg!(windows) {
15+
runner.env("TEMP", tmp_dir).env("TMP", tmp_dir)
16+
} else {
17+
panic!("unsupported OS")
18+
}
19+
.run_fail();
1220

1321
output.assert_exit_code(101).assert_stdout_contains(
1422
"test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out",

0 commit comments

Comments
 (0)