about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2021-05-02 16:50:14 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2021-05-11 20:56:16 +0200
commitd5a24b0a33bccb69e8ba19da42a15b5a69639e22 (patch)
tree07321fd2c084f2aadcdb5c5daa44fe6148d08dd7
parentfe62c6e2958abfe54a9410a24a5750baf4c157e0 (diff)
downloadrust-d5a24b0a33bccb69e8ba19da42a15b5a69639e22.tar.gz
rust-d5a24b0a33bccb69e8ba19da42a15b5a69639e22.zip
Move rustdoc-gui rust libraries into their own folder and prepare the field for more libraries
-rw-r--r--src/bootstrap/test.rs21
-rw-r--r--src/test/rustdoc-gui/basic-code.goml2
-rw-r--r--src/test/rustdoc-gui/basic.goml2
-rw-r--r--src/test/rustdoc-gui/check_info_sign_position.goml2
-rw-r--r--src/test/rustdoc-gui/code-sidebar-toggle.goml2
-rw-r--r--src/test/rustdoc-gui/hash-item-expansion.goml2
-rw-r--r--src/test/rustdoc-gui/impl-default-expansion.goml2
-rw-r--r--src/test/rustdoc-gui/list_code_block.goml2
-rw-r--r--src/test/rustdoc-gui/search-input-mobile.goml2
-rw-r--r--src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml6
-rw-r--r--src/test/rustdoc-gui/shortcuts.goml2
-rw-r--r--src/test/rustdoc-gui/source-code-page.goml4
-rw-r--r--src/test/rustdoc-gui/src/lib.rs (renamed from src/test/rustdoc-gui/lib.rs)0
-rw-r--r--src/test/rustdoc-gui/theme-change.goml2
-rw-r--r--src/test/rustdoc-gui/toggle-docs.goml2
-rw-r--r--src/test/rustdoc-gui/trait-sidebar-item-order.goml2
16 files changed, 34 insertions, 21 deletions
diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs
index 78163651158..de5eb7a2800 100644
--- a/src/bootstrap/test.rs
+++ b/src/bootstrap/test.rs
@@ -827,15 +827,28 @@ impl Step for RustdocGUI {
             }
 
             let out_dir = builder.test_out(self.target).join("rustdoc-gui");
-            let mut command = builder.rustdoc_cmd(self.compiler);
-            command.arg("src/test/rustdoc-gui/lib.rs").arg("-o").arg(&out_dir);
-            builder.run(&mut command);
 
+            // We remove existing folder to be sure there won't be artifacts remaining.
+            let _ = fs::remove_dir_all(&out_dir);
+
+            // We generate docs for the libraries present in the rustdoc-gui's src folder.
+            let libs_dir = Path::new("src/test/rustdoc-gui/src");
+            for entry in libs_dir.read_dir().expect("read_dir call failed") {
+                let entry = entry.expect("invalid entry");
+                let path = entry.path();
+                if path.extension().map(|e| e == "rs").unwrap_or(false) {
+                    let mut command = builder.rustdoc_cmd(self.compiler);
+                    command.arg(path).arg("-o").arg(&out_dir);
+                    builder.run(&mut command);
+                }
+            }
+
+            // We now run GUI tests.
             let mut command = Command::new(&nodejs);
             command
                 .arg("src/tools/rustdoc-gui/tester.js")
                 .arg("--doc-folder")
-                .arg(out_dir.join("test_docs"))
+                .arg(out_dir)
                 .arg("--tests-folder")
                 .arg("src/test/rustdoc-gui");
             builder.run(&mut command);
diff --git a/src/test/rustdoc-gui/basic-code.goml b/src/test/rustdoc-gui/basic-code.goml
index 8da46566254..d014ed60eb0 100644
--- a/src/test/rustdoc-gui/basic-code.goml
+++ b/src/test/rustdoc-gui/basic-code.goml
@@ -1,3 +1,3 @@
-goto: file://|DOC_PATH|/index.html
+goto: file://|DOC_PATH|/test_docs/index.html
 click: ".srclink"
 assert: (".line-numbers", 1)
diff --git a/src/test/rustdoc-gui/basic.goml b/src/test/rustdoc-gui/basic.goml
index ed23300860b..44fcec33937 100644
--- a/src/test/rustdoc-gui/basic.goml
+++ b/src/test/rustdoc-gui/basic.goml
@@ -1,4 +1,4 @@
-goto: file://|DOC_PATH|/index.html
+goto: file://|DOC_PATH|/test_docs/index.html
 assert: ("#functions")
 goto: ./struct.Foo.html
 assert: ("div.type-decl")
diff --git a/src/test/rustdoc-gui/check_info_sign_position.goml b/src/test/rustdoc-gui/check_info_sign_position.goml
index 9aa72a3ad53..d64ee026137 100644
--- a/src/test/rustdoc-gui/check_info_sign_position.goml
+++ b/src/test/rustdoc-gui/check_info_sign_position.goml
@@ -1,4 +1,4 @@
-goto: file://|DOC_PATH|/index.html
+goto: file://|DOC_PATH|/test_docs/index.html
 goto: ./fn.check_list_code_block.html
 // If the codeblock is the first element of the docblock, the information tooltip must have
 // have some top margin to avoid going over the toggle (the "[+]").
diff --git a/src/test/rustdoc-gui/code-sidebar-toggle.goml b/src/test/rustdoc-gui/code-sidebar-toggle.goml
index 69fc860244b..7e7003d4340 100644
--- a/src/test/rustdoc-gui/code-sidebar-toggle.goml
+++ b/src/test/rustdoc-gui/code-sidebar-toggle.goml
@@ -1,4 +1,4 @@
-goto: file://|DOC_PATH|/index.html
+goto: file://|DOC_PATH|/test_docs/index.html
 click: ".srclink"
 click: "#sidebar-toggle"
 wait-for: 500
diff --git a/src/test/rustdoc-gui/hash-item-expansion.goml b/src/test/rustdoc-gui/hash-item-expansion.goml
index d736d15d184..1248d11200e 100644
--- a/src/test/rustdoc-gui/hash-item-expansion.goml
+++ b/src/test/rustdoc-gui/hash-item-expansion.goml
@@ -1,5 +1,5 @@
 // This test ensures that the element corresponding to the hash is displayed.
-goto: file://|DOC_PATH|/struct.Foo.html#method.borrow
+goto: file://|DOC_PATH|/test_docs/struct.Foo.html#method.borrow
 // In the blanket implementations list, "Borrow" is the second one, hence the ":nth(2)".
 assert: ("#blanket-implementations-list > details:nth-child(2)", "open", "")
 // Please note the "\" below is needed because otherwise ".borrow" would be interpreted as
diff --git a/src/test/rustdoc-gui/impl-default-expansion.goml b/src/test/rustdoc-gui/impl-default-expansion.goml
index 686d98f9736..3f1e7ec4a78 100644
--- a/src/test/rustdoc-gui/impl-default-expansion.goml
+++ b/src/test/rustdoc-gui/impl-default-expansion.goml
@@ -1,3 +1,3 @@
 // This test ensures that the impl blocks are open by default.
-goto: file://|DOC_PATH|/struct.Foo.html
+goto: file://|DOC_PATH|/test_docs/struct.Foo.html
 assert: ("#main > details.implementors-toggle", "open", "")
diff --git a/src/test/rustdoc-gui/list_code_block.goml b/src/test/rustdoc-gui/list_code_block.goml
index 6f2465a5587..7d3490e9d94 100644
--- a/src/test/rustdoc-gui/list_code_block.goml
+++ b/src/test/rustdoc-gui/list_code_block.goml
@@ -1,3 +1,3 @@
-goto: file://|DOC_PATH|/index.html
+goto: file://|DOC_PATH|/test_docs/index.html
 goto: ./fn.check_list_code_block.html
 assert: ("pre.rust.fn")
diff --git a/src/test/rustdoc-gui/search-input-mobile.goml b/src/test/rustdoc-gui/search-input-mobile.goml
index 3eec3459a63..5c95db70aec 100644
--- a/src/test/rustdoc-gui/search-input-mobile.goml
+++ b/src/test/rustdoc-gui/search-input-mobile.goml
@@ -1,6 +1,6 @@
 // Test to ensure that you can click on the search input, whatever the width.
 // The PR which fixed it is: https://github.com/rust-lang/rust/pull/81592
-goto: file://|DOC_PATH|/index.html
+goto: file://|DOC_PATH|/test_docs/index.html
 size: (463, 700)
 // We first check that the search input isn't already focused.
 assert-false: ("input.search-input:focus")
diff --git a/src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml b/src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml
index a4df102d245..c828c72e910 100644
--- a/src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml
+++ b/src/test/rustdoc-gui/search-tab-selection-if-current-is-empty.goml
@@ -1,11 +1,11 @@
-goto: file://|DOC_PATH|/index.html
+goto: file://|DOC_PATH|/test_docs/index.html
 write: (".search-input", "Foo")
 // Waiting for the search results to appear...
 wait-for: "#titles"
 assert: ("#titles > button:nth-of-type(1)", "class", "selected")
 
 // To go back to the original "state"
-goto: file://|DOC_PATH|/index.html
+goto: file://|DOC_PATH|/test_docs/index.html
 write: (".search-input", "-> String")
 // Waiting for the search results to appear...
 wait-for: "#titles"
@@ -13,7 +13,7 @@ wait-for: "#titles"
 assert: ("#titles > button:nth-of-type(3)", "class", "selected")
 
 // To go back to the original "state"
-goto: file://|DOC_PATH|/index.html
+goto: file://|DOC_PATH|/test_docs/index.html
 write: (".search-input", "-> Something")
 // Waiting for the search results to appear...
 wait-for: "#titles"
diff --git a/src/test/rustdoc-gui/shortcuts.goml b/src/test/rustdoc-gui/shortcuts.goml
index c35b48f57f4..884c38d85fb 100644
--- a/src/test/rustdoc-gui/shortcuts.goml
+++ b/src/test/rustdoc-gui/shortcuts.goml
@@ -1,5 +1,5 @@
 // Check that the various shortcuts are working.
-goto: file://|DOC_PATH|/index.html
+goto: file://|DOC_PATH|/test_docs/index.html
 // We first check that the search input isn't already focused.
 assert-false: "input.search-input:focus"
 press-key: "s"
diff --git a/src/test/rustdoc-gui/source-code-page.goml b/src/test/rustdoc-gui/source-code-page.goml
index f11c41e8bd5..ff33a541a18 100644
--- a/src/test/rustdoc-gui/source-code-page.goml
+++ b/src/test/rustdoc-gui/source-code-page.goml
@@ -1,11 +1,11 @@
-goto: file://|DOC_PATH|/../src/test_docs/lib.rs.html
+goto: file://|DOC_PATH|/src/test_docs/lib.rs.html
 // Check that we can click on the line number.
 click: (40, 224) // This is the position of the span for line 4.
 // Unfortunately, "#4" isn't a valid query selector, so we have to go around that limitation
 // by instead getting the nth span.
 assert: (".line-numbers > span:nth-child(4)", "class", "line-highlighted")
 // We now check that the good spans are highlighted
-goto: file://|DOC_PATH|/../src/test_docs/lib.rs.html#4-6
+goto: file://|DOC_PATH|/src/test_docs/lib.rs.html#4-6
 assert-false: (".line-numbers > span:nth-child(3)", "class", "line-highlighted")
 assert: (".line-numbers > span:nth-child(4)", "class", "line-highlighted")
 assert: (".line-numbers > span:nth-child(5)", "class", "line-highlighted")
diff --git a/src/test/rustdoc-gui/lib.rs b/src/test/rustdoc-gui/src/lib.rs
index eeba3e3f907..eeba3e3f907 100644
--- a/src/test/rustdoc-gui/lib.rs
+++ b/src/test/rustdoc-gui/src/lib.rs
diff --git a/src/test/rustdoc-gui/theme-change.goml b/src/test/rustdoc-gui/theme-change.goml
index 5bd65f61f49..bc9063edd1e 100644
--- a/src/test/rustdoc-gui/theme-change.goml
+++ b/src/test/rustdoc-gui/theme-change.goml
@@ -1,4 +1,4 @@
-goto: file://|DOC_PATH|/index.html
+goto: file://|DOC_PATH|/test_docs/index.html
 click: "#theme-picker"
 click: "#theme-choices > button:first-child"
 wait-for: 500
diff --git a/src/test/rustdoc-gui/toggle-docs.goml b/src/test/rustdoc-gui/toggle-docs.goml
index 1ded33f659d..93bdf41a6a0 100644
--- a/src/test/rustdoc-gui/toggle-docs.goml
+++ b/src/test/rustdoc-gui/toggle-docs.goml
@@ -1,4 +1,4 @@
-goto: file://|DOC_PATH|/index.html
+goto: file://|DOC_PATH|/test_docs/index.html
 click: "#toggle-all-docs"
 wait-for: 5000
 assert: ("#main > div.docblock.hidden-by-usual-hider")
diff --git a/src/test/rustdoc-gui/trait-sidebar-item-order.goml b/src/test/rustdoc-gui/trait-sidebar-item-order.goml
index 914486e1c28..2e9f85336ec 100644
--- a/src/test/rustdoc-gui/trait-sidebar-item-order.goml
+++ b/src/test/rustdoc-gui/trait-sidebar-item-order.goml
@@ -1,4 +1,4 @@
-goto: file://|DOC_PATH|/trait.AnotherOne.html
+goto: file://|DOC_PATH|/test_docs/trait.AnotherOne.html
 assert: (".sidebar-links a:nth-of-type(1)", "another")
 assert: (".sidebar-links a:nth-of-type(2)", "func1")
 assert: (".sidebar-links a:nth-of-type(3)", "func2")