about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume.gomez@huawei.com>2024-05-05 17:07:32 +0200
committerGuillaume Gomez <guillaume.gomez@huawei.com>2024-05-06 09:16:35 +0200
commit34fe2172b16fb9d80c76e51ab4703bd297d630fe (patch)
treeaa8cf5f55e89f5af0b87410bc02e36e5a7185a3d
parent823b423d4c789a2282dc6d25fd8182e845e351ff (diff)
downloadrust-34fe2172b16fb9d80c76e51ab4703bd297d630fe.tar.gz
rust-34fe2172b16fb9d80c76e51ab4703bd297d630fe.zip
Migrate `run-make/rustdoc-error-lines` to `rmake.rs`
-rw-r--r--src/tools/tidy/src/allowed_run_make_makefiles.txt1
-rw-r--r--tests/run-make/rustdoc-error-lines/Makefile13
-rw-r--r--tests/run-make/rustdoc-error-lines/rmake.rs22
3 files changed, 22 insertions, 14 deletions
diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt
index f96386a143d..f4ae7b06cdb 100644
--- a/src/tools/tidy/src/allowed_run_make_makefiles.txt
+++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt
@@ -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
diff --git a/tests/run-make/rustdoc-error-lines/Makefile b/tests/run-make/rustdoc-error-lines/Makefile
deleted file mode 100644
index 2dc30f56b83..00000000000
--- a/tests/run-make/rustdoc-error-lines/Makefile
+++ /dev/null
@@ -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
diff --git a/tests/run-make/rustdoc-error-lines/rmake.rs b/tests/run-make/rustdoc-error-lines/rmake.rs
new file mode 100644
index 00000000000..31536c78dd4
--- /dev/null
+++ b/tests/run-make/rustdoc-error-lines/rmake.rs
@@ -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);
+    }
+}