diff --git a/src/tools/tidy/src/allowed_run_make_makefiles.txt b/src/tools/tidy/src/allowed_run_make_makefiles.txt index a56ea8df6cc..d4d6c1460ce 100644 --- a/src/tools/tidy/src/allowed_run_make_makefiles.txt +++ b/src/tools/tidy/src/allowed_run_make_makefiles.txt @@ -245,7 +245,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-determinism/Makefile run-make/rustdoc-error-lines/Makefile run-make/rustdoc-io-error/Makefile run-make/rustdoc-map-file/Makefile diff --git a/tests/run-make/rustdoc-determinism/Makefile b/tests/run-make/rustdoc-determinism/Makefile deleted file mode 100644 index a3ef1690671..00000000000 --- a/tests/run-make/rustdoc-determinism/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -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/tests/run-make/rustdoc-determinism/rmake.rs b/tests/run-make/rustdoc-determinism/rmake.rs new file mode 100644 index 00000000000..38ae75199fd --- /dev/null +++ b/tests/run-make/rustdoc-determinism/rmake.rs @@ -0,0 +1,18 @@ +use run_make_support::{diff, rustc, rustdoc, tmp_dir}; + +/// Assert that the search index is generated deterministically, regardless of the +/// order that crates are documented in. +fn main() { + let dir_first = tmp_dir().join("first"); + rustdoc().out_dir(&dir_first).input("foo.rs").run(); + rustdoc().out_dir(&dir_first).input("bar.rs").run(); + + let dir_second = tmp_dir().join("second"); + rustdoc().out_dir(&dir_second).input("bar.rs").run(); + rustdoc().out_dir(&dir_second).input("foo.rs").run(); + + diff() + .expected_file(dir_first.join("search-index.js")) + .actual_file(dir_second.join("search-index.js")) + .run(); +}