Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check in GUI test for file loading failure #104201

Merged
merged 3 commits into from
Nov 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.12.7
0.13.1
4 changes: 4 additions & 0 deletions src/test/rustdoc-gui/code-tags.goml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
// This test ensures that items and documentation code blocks are wrapped in <pre><code>

// We need to disable this check because `implementors/test_docs/trait.AnotherOne.js`
// doesn't exist.
fail-on-request-error: false
goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
size: (1080, 600)
// There should be four doc codeblocks.
Expand Down
5 changes: 5 additions & 0 deletions src/test/rustdoc-gui/item-decl-colors.goml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
// This test ensures that the color of the items in the type decl are working as expected.

// We need to disable this check because `implementors/test_docs/trait.TraitWithoutGenerics.js`
// doesn't exist.
fail-on-request-error: false

define-function: (
"check-colors",
(
Expand Down
5 changes: 5 additions & 0 deletions src/test/rustdoc-gui/no-docblock.goml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
// This test checks that there are margins applied to methods with no docblocks.

// We need to disable this check because `implementors/test_docs/trait.TraitWithNoDocblock.js`
// doesn't exist.
fail-on-request-error: false

goto: "file://" + |DOC_PATH| + "/test_docs/trait.TraitWithNoDocblocks.html"
// Check that the two methods are more than 24px apart.
compare-elements-position-near-false: ("//*[@id='tymethod.first_fn']", "//*[@id='tymethod.second_fn']", {"y": 24})
Expand Down
5 changes: 5 additions & 0 deletions src/test/rustdoc-gui/trait-sidebar-item-order.goml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
// Checks that the elements in the sidebar are alphabetically sorted.

// We need to disable this check because `implementors/test_docs/trait.AnotherOne.js`
// doesn't exist.
fail-on-request-error: false

goto: "file://" + |DOC_PATH| + "/test_docs/trait.AnotherOne.html"
assert-text: (".sidebar-elems section .block li:nth-of-type(1) > a", "another")
assert-text: (".sidebar-elems section .block li:nth-of-type(2) > a", "func1")
Expand Down
6 changes: 6 additions & 0 deletions src/test/rustdoc-gui/type-declation-overflow.goml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
// This test ensures that the items declaration content overflow is handled inside the <pre> directly.

// We need to disable this check because
// `implementors/test_docs/trait.ALongNameBecauseItHelpsTestingTheCurrentProblem.js`
// doesn't exist.
fail-on-request-error: false

goto: "file://" + |DOC_PATH| + "/lib2/long_trait/trait.ALongNameBecauseItHelpsTestingTheCurrentProblem.html"
// We set a fixed size so there is no chance of "random" resize.
size: (1100, 800)
Expand Down
1 change: 1 addition & 0 deletions src/tools/rustdoc-gui/tester.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ async function main(argv) {
// This is more convenient that setting fields one by one.
let args = [
"--variable", "DOC_PATH", opts["doc_folder"], "--enable-fail-on-js-error",
"--allow-file-access-from-files",
];
if (opts["debug"]) {
debug = true;
Expand Down