Skip to content

Commit 985fa02

Browse files
Rollup merge of #104201 - GuillaumeGomez:gui-test-check-file-errors, r=notriddle
Add check in GUI test for file loading failure Since #101702, some resources location need to be updated in case their content changed because then their hash will change too. This will prevent errors like #104114 to happen again. The second commit is to prevent CORS errors: when a file is linked from a file itself imported, the web browser considers they come from a different domain and therefore triggers the error. The option tells the web browser to ignore this case. cc ```@jsha``` r? ```@notriddle```
2 parents 41c8a62 + 9f0e376 commit 985fa02

File tree

7 files changed

+27
-1
lines changed

7 files changed

+27
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.12.7
1+
0.13.1

src/test/rustdoc-gui/code-tags.goml

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
// This test ensures that items and documentation code blocks are wrapped in <pre><code>
2+
3+
// We need to disable this check because `implementors/test_docs/trait.AnotherOne.js`
4+
// doesn't exist.
5+
fail-on-request-error: false
26
goto: "file://" + |DOC_PATH| + "/test_docs/fn.foo.html"
37
size: (1080, 600)
48
// There should be four doc codeblocks.

src/test/rustdoc-gui/item-decl-colors.goml

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
// This test ensures that the color of the items in the type decl are working as expected.
2+
3+
// We need to disable this check because `implementors/test_docs/trait.TraitWithoutGenerics.js`
4+
// doesn't exist.
5+
fail-on-request-error: false
6+
27
define-function: (
38
"check-colors",
49
(

src/test/rustdoc-gui/no-docblock.goml

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
// This test checks that there are margins applied to methods with no docblocks.
2+
3+
// We need to disable this check because `implementors/test_docs/trait.TraitWithNoDocblock.js`
4+
// doesn't exist.
5+
fail-on-request-error: false
6+
27
goto: "file://" + |DOC_PATH| + "/test_docs/trait.TraitWithNoDocblocks.html"
38
// Check that the two methods are more than 24px apart.
49
compare-elements-position-near-false: ("//*[@id='tymethod.first_fn']", "//*[@id='tymethod.second_fn']", {"y": 24})

src/test/rustdoc-gui/trait-sidebar-item-order.goml

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
// Checks that the elements in the sidebar are alphabetically sorted.
2+
3+
// We need to disable this check because `implementors/test_docs/trait.AnotherOne.js`
4+
// doesn't exist.
5+
fail-on-request-error: false
6+
27
goto: "file://" + |DOC_PATH| + "/test_docs/trait.AnotherOne.html"
38
assert-text: (".sidebar-elems section .block li:nth-of-type(1) > a", "another")
49
assert-text: (".sidebar-elems section .block li:nth-of-type(2) > a", "func1")

src/test/rustdoc-gui/type-declation-overflow.goml

+6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
// This test ensures that the items declaration content overflow is handled inside the <pre> directly.
2+
3+
// We need to disable this check because
4+
// `implementors/test_docs/trait.ALongNameBecauseItHelpsTestingTheCurrentProblem.js`
5+
// doesn't exist.
6+
fail-on-request-error: false
7+
28
goto: "file://" + |DOC_PATH| + "/lib2/long_trait/trait.ALongNameBecauseItHelpsTestingTheCurrentProblem.html"
39
// We set a fixed size so there is no chance of "random" resize.
410
size: (1100, 800)

src/tools/rustdoc-gui/tester.js

+1
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ async function main(argv) {
149149
// This is more convenient that setting fields one by one.
150150
let args = [
151151
"--variable", "DOC_PATH", opts["doc_folder"], "--enable-fail-on-js-error",
152+
"--allow-file-access-from-files",
152153
];
153154
if (opts["debug"]) {
154155
debug = true;

0 commit comments

Comments
 (0)