File tree 15 files changed +74
-15
lines changed
15 files changed +74
-15
lines changed Original file line number Diff line number Diff line change @@ -734,9 +734,24 @@ impl Step for RustdocGUI {
734
734
}
735
735
736
736
let out_dir = builder. test_out ( self . target ) . join ( "rustdoc-gui" ) ;
737
- let mut command = builder. rustdoc_cmd ( self . compiler ) ;
738
- command. arg ( "src/test/rustdoc-gui/lib.rs" ) . arg ( "-o" ) . arg ( & out_dir) ;
739
- builder. run ( & mut command) ;
737
+
738
+ for file in fs:: read_dir ( "src/test/rustdoc-gui" ) . unwrap ( ) {
739
+ let file = file. unwrap ( ) ;
740
+ let file_name = file. file_name ( ) ;
741
+
742
+ if !file_name. to_str ( ) . unwrap ( ) . ends_with ( ".rs" ) {
743
+ continue ;
744
+ }
745
+
746
+ let mut command = builder. rustdoc_cmd ( self . compiler ) ;
747
+ command
748
+ . arg ( & Path :: new ( "src/test/rustdoc-gui" ) . join ( file_name) )
749
+ . arg ( "-o" )
750
+ . arg ( & out_dir)
751
+ . arg ( "-Zunstable-options" )
752
+ . arg ( "--generate-case-insensitive" ) ;
753
+ builder. run ( & mut command) ;
754
+ }
740
755
741
756
for file in fs:: read_dir ( "src/test/rustdoc-gui" ) . unwrap ( ) {
742
757
let file = file. unwrap ( ) ;
@@ -750,7 +765,7 @@ impl Step for RustdocGUI {
750
765
command
751
766
. arg ( "src/tools/rustdoc-gui/tester.js" )
752
767
. arg ( "--doc-folder" )
753
- . arg ( out_dir. join ( "test_docs" ) )
768
+ . arg ( & out_dir)
754
769
. arg ( "--test-file" )
755
770
. arg ( file_path) ;
756
771
builder. run ( & mut command) ;
Original file line number Diff line number Diff line change 1
- goto: file://|DOC_PATH|/index.html
1
+ goto: file://|DOC_PATH|/test_docs/ index.html
2
2
click: ".srclink"
3
3
assert: (".line-numbers", 1)
Original file line number Diff line number Diff line change 1
- goto: file://|DOC_PATH|/index.html
1
+ goto: file://|DOC_PATH|/test_docs/ index.html
2
2
assert: ("#functions")
3
3
goto: ./struct.Foo.html
4
4
assert: ("div.type-decl")
Original file line number Diff line number Diff line change 1
- goto: file://|DOC_PATH|/index.html
1
+ goto: file://|DOC_PATH|/test_docs/ index.html
2
2
goto: ./fn.check_list_code_block.html
3
3
// If the codeblock is the first element of the docblock, the information tooltip must have
4
4
// have some top margin to avoid going over the toggle (the "[+]").
Original file line number Diff line number Diff line change 1
- goto: file://|DOC_PATH|/index.html
1
+ goto: file://|DOC_PATH|/test_docs/ index.html
2
2
click: ".srclink"
3
3
click: "#sidebar-toggle"
4
4
wait-for: 500
Original file line number Diff line number Diff line change
1
+ goto: file://|DOC_PATH|/insensitive_case_docs/struct.ab.html
2
+ // Checks that the sidebar was filled.
3
+ wait-for: ".sidebar-elems > .items > .sidebar-title"
4
+ // Checks that the content has been loaded
5
+ assert: ".impl-items > h4"
6
+ // Checks that the collapse toggles have been generated as expected
7
+ assert: ".impl-items > h4 > .collapse-toggle"
Original file line number Diff line number Diff line change
1
+ //! The point of this crate is to test the insensitive case handling.
2
+
3
+ #![ crate_name = "insensitive_case_docs" ]
4
+
5
+ #![ allow( non_camel_case_types) ]
6
+
7
+ /// This is ab.
8
+ pub struct ab ;
9
+
10
+ impl ab {
11
+ pub fn foo ( & self ) { }
12
+ }
13
+
14
+ /// This is another Ab!
15
+ pub struct Ab ;
16
+
17
+ impl Ab {
18
+ pub fn bar ( & self ) { }
19
+ }
Original file line number Diff line number Diff line change 1
- goto: file://|DOC_PATH|/index.html
1
+ goto: file://|DOC_PATH|/test_docs/ index.html
2
2
goto: ./fn.check_list_code_block.html
3
3
assert: ("pre.rust.fn")
Original file line number Diff line number Diff line change 1
1
// Check that the attributes are well positioned when javascript is disabled (since
2
2
// there is no toggle to display)
3
3
javascript: false
4
- goto: file://|DOC_PATH|/struct.Foo.html
4
+ goto: file://|DOC_PATH|/test_docs/ struct.Foo.html
5
5
assert: (".attributes", {"margin-left": "0px"})
Original file line number Diff line number Diff line change 1
1
// Test to ensure that you can click on the search input, whatever the width.
2
2
// The PR which fixed it is: https://github.com/rust-lang/rust/pull/81592
3
- goto: file://|DOC_PATH|/index.html
3
+ goto: file://|DOC_PATH|/test_docs/ index.html
4
4
size: (463, 700)
5
5
// We first check that the search input isn't already focused.
6
6
assert-false: ("input.search-input:focus")
Original file line number Diff line number Diff line change 1
1
// Check that the various shortcuts are working.
2
- goto: file://|DOC_PATH|/index.html
2
+ goto: file://|DOC_PATH|/test_docs/ index.html
3
3
// We first check that the search input isn't already focused.
4
4
assert-false: "input.search-input:focus"
5
5
press-key: "s"
Original file line number Diff line number Diff line change 1
- goto: file://|DOC_PATH|/index.html
1
+ goto: file://|DOC_PATH|/test_docs/ index.html
2
2
click: "#theme-picker"
3
3
click: "#theme-choices > button:first-child"
4
4
wait-for: 500
Original file line number Diff line number Diff line change 1
- goto: file://|DOC_PATH|/index.html
1
+ goto: file://|DOC_PATH|/test_docs/ index.html
2
2
click: "#toggle-all-docs"
3
3
wait-for: 5000
4
4
assert: ("#main > div.docblock.hidden-by-usual-hider")
Original file line number Diff line number Diff line change 1
- goto: file://|DOC_PATH|/trait.AnotherOne.html
1
+ goto: file://|DOC_PATH|/test_docs/ trait.AnotherOne.html
2
2
assert: (".sidebar-links a:nth-of-type(1)", "another")
3
3
assert: (".sidebar-links a:nth-of-type(2)", "func1")
4
4
assert: (".sidebar-links a:nth-of-type(3)", "func2")
Original file line number Diff line number Diff line change
1
+ // compile-flags: -Zunstable-options --generate-case-insensitive
2
+
3
+ #![ crate_name = "foo" ]
4
+
5
+ // @!has 'foo/struct.Aa.html'
6
+ // @has 'foo/struct.aa.html'
7
+ // @!has 'foo/struct.aa.html' '//h4[@id="method.new"]'
8
+ pub struct aa ;
9
+
10
+ impl aa {
11
+ pub fn foo ( & self ) { }
12
+ }
13
+
14
+ pub struct Aa ;
15
+
16
+ impl Aa {
17
+ pub fn foo ( & self ) { }
18
+ }
You can’t perform that action at this time.
0 commit comments