Migrate run-make/rustdoc-error-lines to rmake.rs

This commit is contained in:
Guillaume Gomez 2024-05-05 17:07:32 +02:00
parent 823b423d4c
commit 34fe2172b1
3 changed files with 22 additions and 14 deletions

View File

@ -244,7 +244,6 @@ run-make/rlib-format-packed-bundled-libs-3/Makefile
run-make/rlib-format-packed-bundled-libs/Makefile
run-make/rmeta-preferred/Makefile
run-make/rustc-macro-dep-files/Makefile
run-make/rustdoc-error-lines/Makefile
run-make/rustdoc-io-error/Makefile
run-make/rustdoc-map-file/Makefile
run-make/rustdoc-output-path/Makefile

View File

@ -1,13 +0,0 @@
include ../tools.mk
# Test that hir-tree output doesn't crash and includes
# the string constant we would expect to see.
all:
$(RUSTDOC) --test input.rs > $(TMPDIR)/output || true
$(CGREP) 'input.rs - foo (line 5)' < $(TMPDIR)/output
$(CGREP) 'input.rs:7:15' < $(TMPDIR)/output
$(CGREP) 'input.rs - bar (line 15)' < $(TMPDIR)/output
$(CGREP) 'input.rs:17:15' < $(TMPDIR)/output
$(CGREP) 'input.rs - bar (line 24)' < $(TMPDIR)/output
$(CGREP) 'input.rs:26:15' < $(TMPDIR)/output

View File

@ -0,0 +1,22 @@
// Assert that the search index is generated deterministically, regardless of the
// order that crates are documented in.
use run_make_support::rustdoc;
fn main() {
let output =
String::from_utf8(rustdoc().input("input.rs").arg("--test").command_output().stdout)
.unwrap();
let should_contain = &[
"input.rs - foo (line 5)",
"input.rs:7:15",
"input.rs - bar (line 15)",
"input.rs:17:15",
"input.rs - bar (line 24)",
"input.rs:26:15",
];
for text in should_contain {
assert!(output.contains(text), "output doesn't contains {:?}", text);
}
}