Skip to content

Commit 2f4861c

Browse files
committed
Rewrite rustdoc-determinism test in Rust
1 parent 09cd00f commit 2f4861c

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

src/tools/tidy/src/allowed_run_make_makefiles.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@ run-make/rlib-format-packed-bundled-libs-3/Makefile
246246
run-make/rlib-format-packed-bundled-libs/Makefile
247247
run-make/rmeta-preferred/Makefile
248248
run-make/rustc-macro-dep-files/Makefile
249-
run-make/rustdoc-determinism/Makefile
250249
run-make/rustdoc-error-lines/Makefile
251250
run-make/rustdoc-io-error/Makefile
252251
run-make/rustdoc-map-file/Makefile

tests/run-make/rustdoc-determinism/Makefile

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
use run_make_support::{diff, rustc, rustdoc, tmp_dir};
2+
3+
/// Assert that the search index is generated deterministically, regardless of the
4+
/// order that crates are documented in.
5+
fn main() {
6+
let dir_first = tmp_dir().join("first");
7+
rustdoc().out_dir(&dir_first).input("foo.rs").run();
8+
rustdoc().out_dir(&dir_first).input("bar.rs").run();
9+
10+
let dir_second = tmp_dir().join("second");
11+
rustdoc().out_dir(&dir_second).input("bar.rs").run();
12+
rustdoc().out_dir(&dir_second).input("foo.rs").run();
13+
14+
diff()
15+
.expected_file(dir_first.join("search-index.js"))
16+
.actual_file(dir_second.join("search-index.js"))
17+
.run();
18+
}

0 commit comments

Comments
 (0)