forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#128161 - EtomicBomb:just-compiletest, r=notriddle nested aux-build in tests/rustdoc/ tests * Fixes bug that prevented using nested aux-build in `tests/rustdoc/` tests. Before, `fn document` and the auxiliary builder disagreed about where to find the nested aux-build source file (`auxiliary/auxiliary/aux.rs` vs `auxiliary/aux.rs`), preventing them from building. Picked the latter in line with other builders in compiletest. * Adds `//@ doc-flags` header, which forwards flags to rustdoc and not rustc. * Adds `//@ unique-doc-out-dir` header, which sets the --out-dir for the rustdoc invocation to a unique directory: `<root out dir>/docs/<test name>/doc` * Changes working directory of the rustdoc invocation to the root out directory (common among all aux-builds). Prior art: exec_compiled_test in runtest.rs * Adds tests that use nested aux builds and new headers These changes provide useful capabilities for writing rustdoc tests on their own. They are also needed to test the implementation for the [mergable-rustdoc-cross-crate-info](rust-lang/rfcs#3662) RFC. try-job: x86_64-msvc
- Loading branch information
Showing
31 changed files
with
318 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/q.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
//@ build-aux-docs | ||
pub struct Quebec; |
4 changes: 4 additions & 0 deletions
4
tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/t.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//@ aux-build:q.rs | ||
//@ build-aux-docs | ||
extern crate q; | ||
pub trait Tango {} |
16 changes: 16 additions & 0 deletions
16
tests/rustdoc/cross-crate-info/cargo-transitive-no-index/s.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//@ aux-build:t.rs | ||
//@ build-aux-docs | ||
//@ has q/struct.Quebec.html | ||
//@ has s/struct.Sierra.html | ||
//@ has t/trait.Tango.html | ||
//@ hasraw s/struct.Sierra.html 'Tango' | ||
//@ hasraw trait.impl/t/trait.Tango.js 'struct.Sierra.html' | ||
//@ hasraw search-index.js 'Tango' | ||
//@ hasraw search-index.js 'Sierra' | ||
//@ hasraw search-index.js 'Quebec' | ||
|
||
// We document multiple crates into the same output directory, which | ||
// merges the cross-crate information. Everything is available. | ||
extern crate t; | ||
pub struct Sierra; | ||
impl t::Tango for Sierra {} |
5 changes: 5 additions & 0 deletions
5
tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/q.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//@ build-aux-docs | ||
//@ doc-flags:--enable-index-page | ||
//@ doc-flags:-Zunstable-options | ||
|
||
pub struct Quebec; |
7 changes: 7 additions & 0 deletions
7
tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/t.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
//@ aux-build:q.rs | ||
//@ build-aux-docs | ||
//@ doc-flags:--enable-index-page | ||
//@ doc-flags:-Zunstable-options | ||
|
||
extern crate q; | ||
pub trait Tango {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
//@ aux-build:t.rs | ||
//@ build-aux-docs | ||
//@ doc-flags:--enable-index-page | ||
//@ doc-flags:-Zunstable-options | ||
|
||
//@ has index.html | ||
//@ has index.html '//h1' 'List of all crates' | ||
//@ has index.html '//ul[@class="all-items"]//a[@href="q/index.html"]' 'q' | ||
//@ has index.html '//ul[@class="all-items"]//a[@href="s/index.html"]' 's' | ||
//@ has index.html '//ul[@class="all-items"]//a[@href="t/index.html"]' 't' | ||
//@ has q/struct.Quebec.html | ||
//@ has s/struct.Sierra.html | ||
//@ has t/trait.Tango.html | ||
//@ hasraw s/struct.Sierra.html 'Tango' | ||
//@ hasraw trait.impl/t/trait.Tango.js 'struct.Sierra.html' | ||
//@ hasraw search-index.js 'Tango' | ||
//@ hasraw search-index.js 'Sierra' | ||
//@ hasraw search-index.js 'Quebec' | ||
|
||
// We document multiple crates into the same output directory, which | ||
// merges the cross-crate information. Everything is available. | ||
extern crate t; | ||
pub struct Sierra; | ||
impl t::Tango for Sierra {} |
2 changes: 2 additions & 0 deletions
2
tests/rustdoc/cross-crate-info/cargo-two-no-index/auxiliary/f.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
//@ build-aux-docs | ||
pub trait Foxtrot {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
//@ aux-build:f.rs | ||
//@ build-aux-docs | ||
//@ has e/enum.Echo.html | ||
//@ has f/trait.Foxtrot.html | ||
//@ hasraw e/enum.Echo.html 'Foxtrot' | ||
//@ hasraw trait.impl/f/trait.Foxtrot.js 'enum.Echo.html' | ||
//@ hasraw search-index.js 'Foxtrot' | ||
//@ hasraw search-index.js 'Echo' | ||
|
||
// document two crates in the same way that cargo does. do not provide | ||
// --enable-index-page | ||
extern crate f; | ||
pub enum Echo {} | ||
impl f::Foxtrot for Echo {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//@ build-aux-docs | ||
//@ doc-flags:--enable-index-page | ||
//@ doc-flags:-Zunstable-options | ||
|
||
pub trait Foxtrot {} |
Oops, something went wrong.