mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 14:55:26 +00:00
Add run-make
test for -
for -o
option
This commit is contained in:
parent
e2fd0c0f9a
commit
7882575a8c
1
tests/run-make/rustdoc-output-stdout/foo.rs
Normal file
1
tests/run-make/rustdoc-output-stdout/foo.rs
Normal file
@ -0,0 +1 @@
|
||||
pub struct Foo;
|
25
tests/run-make/rustdoc-output-stdout/rmake.rs
Normal file
25
tests/run-make/rustdoc-output-stdout/rmake.rs
Normal file
@ -0,0 +1,25 @@
|
||||
// This test verifies that rustdoc `-o -` prints JSON on stdout and doesn't generate
|
||||
// a JSON file.
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
||||
use run_make_support::path_helpers::{cwd, has_extension, read_dir_entries_recursive};
|
||||
use run_make_support::rustdoc;
|
||||
|
||||
fn main() {
|
||||
// First we check that we generate the JSON in the stdout.
|
||||
rustdoc()
|
||||
.input("foo.rs")
|
||||
.output("-")
|
||||
.arg("-Zunstable-options")
|
||||
.output_format("json")
|
||||
.run()
|
||||
.assert_stdout_contains("{\"");
|
||||
|
||||
// Then we check it didn't generate any JSON file.
|
||||
read_dir_entries_recursive(cwd(), |path| {
|
||||
if path.is_file() && has_extension(path, "json") {
|
||||
panic!("Found a JSON file {path:?}");
|
||||
}
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue
Block a user