2024-05-04 09:18:36 -05:00
|
|
|
// Tests behavior of rustdoc `--runtool`.
|
|
|
|
|
|
|
|
use std::path::PathBuf;
|
2024-07-28 17:13:50 -05:00
|
|
|
|
2024-07-17 08:31:38 -05:00
|
|
|
use run_make_support::rfs::{create_dir, remove_dir_all};
|
2024-06-06 14:34:34 -05:00
|
|
|
use run_make_support::{rustc, rustdoc};
|
2024-05-04 09:18:36 -05:00
|
|
|
|
|
|
|
fn mkdir(name: &str) -> PathBuf {
|
2024-06-06 14:34:34 -05:00
|
|
|
let dir = PathBuf::from(name);
|
2024-06-06 13:47:00 -05:00
|
|
|
create_dir(&dir);
|
2024-05-04 09:18:36 -05:00
|
|
|
dir
|
|
|
|
}
|
|
|
|
|
|
|
|
// Behavior with --runtool with relative paths and --test-run-directory.
|
|
|
|
fn main() {
|
|
|
|
let run_dir_name = "rundir";
|
|
|
|
let run_dir = mkdir(run_dir_name);
|
|
|
|
let run_tool = mkdir("runtool");
|
|
|
|
let run_tool_binary = run_tool.join("runtool");
|
|
|
|
|
|
|
|
rustc().input("t.rs").crate_type("rlib").run();
|
2024-05-05 09:26:35 -05:00
|
|
|
rustc().input("runtool.rs").output(&run_tool_binary).run();
|
2024-05-04 09:18:36 -05:00
|
|
|
|
|
|
|
rustdoc()
|
2024-06-06 14:34:34 -05:00
|
|
|
.input("t.rs")
|
2024-05-04 09:18:36 -05:00
|
|
|
.arg("-Zunstable-options")
|
|
|
|
.arg("--test")
|
|
|
|
.arg("--test-run-directory")
|
|
|
|
.arg(run_dir_name)
|
|
|
|
.arg("--runtool")
|
|
|
|
.arg(&run_tool_binary)
|
2024-05-14 06:39:40 -05:00
|
|
|
.extern_("t", "libt.rlib")
|
2024-05-04 09:18:36 -05:00
|
|
|
.run();
|
|
|
|
|
|
|
|
remove_dir_all(run_dir);
|
|
|
|
remove_dir_all(run_tool);
|
|
|
|
}
|