Skip to content

Commit 489c506

Browse files
Make rustdoc-tempdir-removal run-make tests work on other platforms than linux
1 parent 1973872 commit 489c506

File tree

1 file changed

+10
-4
lines changed
  • tests/run-make/rustdoc-tempdir-removal

1 file changed

+10
-4
lines changed

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

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

3-
//@ only-linux
4-
53
use std::path::Path;
64

75
use run_make_support::{path, rfs, rustdoc};
86

97
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();
8+
let mut runner = rustdoc();
9+
runner.input(doctest).arg("--test").edition(edition);
10+
let output = if cfg!(unix) {
11+
runner.env("TMPDIR", tmp_dir)
12+
} else if cfg!(windows) {
13+
runner.env("TEMP", tmp_dir).env("TMP", tmp_dir)
14+
} else {
15+
panic!("unsupported OS")
16+
}
17+
.run_fail();
1218

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

0 commit comments

Comments
 (0)