about summary refs log tree commit diff
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2020-07-16 11:18:40 -0700
committerGitHub <noreply@github.com>2020-07-16 11:18:40 -0700
commit6dc12fb5d5a7a1c912f73589ee6303bb32bc491b (patch)
tree242b877cbaca36ece43998e98bc1a8da061cf099
parent1cc37b6ece7ce1f93732fb27418d3987e1e8ec87 (diff)
parent95bf7b7dacca320d0965e3f9052ecbb9c4fc59bd (diff)
downloadrust-6dc12fb5d5a7a1c912f73589ee6303bb32bc491b.tar.gz
rust-6dc12fb5d5a7a1c912f73589ee6303bb32bc491b.zip
Rollup merge of #73998 - euclio:search-index-determinism, r=nikomatsakis
add regression test for #61216

Fixes #61216.
-rw-r--r--src/test/run-make-fulldeps/rustdoc-determinism/Makefile16
-rw-r--r--src/test/run-make-fulldeps/rustdoc-determinism/bar.rs1
-rw-r--r--src/test/run-make-fulldeps/rustdoc-determinism/foo.rs1
3 files changed, 18 insertions, 0 deletions
diff --git a/src/test/run-make-fulldeps/rustdoc-determinism/Makefile b/src/test/run-make-fulldeps/rustdoc-determinism/Makefile
new file mode 100644
index 00000000000..0534c2c3831
--- /dev/null
+++ b/src/test/run-make-fulldeps/rustdoc-determinism/Makefile
@@ -0,0 +1,16 @@
+-include ../tools.mk
+
+# Assert that the search index is generated deterministically, regardless of the
+# order that crates are documented in.
+
+# ignore-windows
+# Uses `diff`.
+
+all:
+	$(RUSTDOC) foo.rs -o $(TMPDIR)/foo_first
+	$(RUSTDOC) bar.rs -o $(TMPDIR)/foo_first
+
+	$(RUSTDOC) bar.rs -o $(TMPDIR)/bar_first
+	$(RUSTDOC) foo.rs -o $(TMPDIR)/bar_first
+
+	diff $(TMPDIR)/foo_first/search-index.js $(TMPDIR)/bar_first/search-index.js
diff --git a/src/test/run-make-fulldeps/rustdoc-determinism/bar.rs b/src/test/run-make-fulldeps/rustdoc-determinism/bar.rs
new file mode 100644
index 00000000000..ca05a6a9076
--- /dev/null
+++ b/src/test/run-make-fulldeps/rustdoc-determinism/bar.rs
@@ -0,0 +1 @@
+pub struct Bar;
diff --git a/src/test/run-make-fulldeps/rustdoc-determinism/foo.rs b/src/test/run-make-fulldeps/rustdoc-determinism/foo.rs
new file mode 100644
index 00000000000..4a835673a59
--- /dev/null
+++ b/src/test/run-make-fulldeps/rustdoc-determinism/foo.rs
@@ -0,0 +1 @@
+pub struct Foo;