Skip to content

Commit 3c2cf2e

Browse files
Migrate run-make/doctests-runtool to rmake
1 parent a56ba91 commit 3c2cf2e

File tree

3 files changed

+39
-21
lines changed

3 files changed

+39
-21
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ run-make/dep-graph/Makefile
4444
run-make/dep-info-doesnt-run-much/Makefile
4545
run-make/dep-info-spaces/Makefile
4646
run-make/dep-info/Makefile
47-
run-make/doctests-runtool/Makefile
4847
run-make/dump-ice-to-disk/Makefile
4948
run-make/dump-mono-stats/Makefile
5049
run-make/duplicate-output-flavors/Makefile

tests/run-make/doctests-runtool/Makefile

-20
This file was deleted.
+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// Tests behavior of rustdoc `--runtool`.
2+
3+
use run_make_support::{rustc, rustdoc, tmp_dir};
4+
use std::env::current_dir;
5+
use std::fs::{create_dir, remove_dir_all};
6+
use std::path::PathBuf;
7+
8+
fn mkdir(name: &str) -> PathBuf {
9+
let dir = tmp_dir().join(name);
10+
create_dir(&dir).expect("failed to create doctests folder");
11+
dir
12+
}
13+
14+
// Behavior with --runtool with relative paths and --test-run-directory.
15+
fn main() {
16+
let run_dir_name = "rundir";
17+
let run_dir = mkdir(run_dir_name);
18+
let run_tool = mkdir("runtool");
19+
let run_tool_binary = run_tool.join("runtool");
20+
21+
rustc().input("t.rs").crate_type("rlib").run();
22+
rustc().input("runtool.rs").arg("-o").arg(&run_tool_binary).run();
23+
24+
rustdoc()
25+
.input(current_dir().unwrap().join("t.rs"))
26+
.arg("-Zunstable-options")
27+
.arg("--test")
28+
.arg("--test-run-directory")
29+
.arg(run_dir_name)
30+
.arg("--runtool")
31+
.arg(&run_tool_binary)
32+
.arg("--extern")
33+
.arg("t=libt.rlib")
34+
.current_dir(tmp_dir())
35+
.run();
36+
37+
remove_dir_all(run_dir);
38+
remove_dir_all(run_tool);
39+
}

0 commit comments

Comments
 (0)