Skip to content

Commit 96a1453

Browse files
committed
add rfc#3662 tests, plus multi letter test crates
* Adds tests for the behavior in rfc#3662 * Renames single variable test crate names to multi letter crate names in tests/rustdoc/cross-crate-info (i.e. s.rs -> sierra.rs)
1 parent 469da4c commit 96a1453

File tree

41 files changed

+501
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+501
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//@ doc-flags:--merge=shared
2+
//@ doc-flags:--enable-index-page
3+
//@ doc-flags:-Zunstable-options
4+
5+
pub struct Quebec;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//@ aux-build:quebec.rs
2+
//@ build-aux-docs
3+
//@ doc-flags:--merge=shared
4+
//@ doc-flags:--enable-index-page
5+
//@ doc-flags:-Zunstable-options
6+
7+
extern crate quebec;
8+
pub trait Tango {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//@ aux-build:tango.rs
2+
//@ build-aux-docs
3+
//@ doc-flags:--merge=shared
4+
//@ doc-flags:--enable-index-page
5+
//@ doc-flags:-Zunstable-options
6+
7+
//@ has index.html
8+
//@ has index.html '//h1' 'List of all crates'
9+
//@ has index.html '//ul[@class="all-items"]//a[@href="quebec/index.html"]' 'quebec'
10+
//@ has index.html '//ul[@class="all-items"]//a[@href="sierra/index.html"]' 'sierra'
11+
//@ has index.html '//ul[@class="all-items"]//a[@href="tango/index.html"]' 'tango'
12+
//@ has quebec/struct.Quebec.html
13+
//@ has sierra/struct.Sierra.html
14+
//@ has tango/trait.Tango.html
15+
//@ hasraw sierra/struct.Sierra.html 'Tango'
16+
//@ hasraw trait.impl/tango/trait.Tango.js 'struct.Sierra.html'
17+
//@ hasraw search-index.js 'Tango'
18+
//@ hasraw search-index.js 'Sierra'
19+
//@ hasraw search-index.js 'Quebec'
20+
21+
// similar to cargo-workflow-transitive, but we use --merge=read-write,
22+
// which is the default.
23+
extern crate tango;
24+
pub struct Sierra;
25+
impl tango::Tango for Sierra {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//@ unique-doc-out-dir
2+
//@ doc-flags:--merge=none
3+
//@ doc-flags:--parts-out-dir=info/doc.parts/quebec
4+
//@ doc-flags:--enable-index-page
5+
//@ doc-flags:-Zunstable-options
6+
7+
pub struct Quebec;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//@ aux-build:sierra.rs
2+
//@ build-aux-docs
3+
//@ unique-doc-out-dir
4+
//@ doc-flags:--merge=none
5+
//@ doc-flags:--parts-out-dir=info/doc.parts/romeo
6+
//@ doc-flags:--enable-index-page
7+
//@ doc-flags:-Zunstable-options
8+
9+
extern crate sierra;
10+
pub type Romeo = sierra::Sierra;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//@ aux-build:tango.rs
2+
//@ build-aux-docs
3+
//@ unique-doc-out-dir
4+
//@ doc-flags:--merge=none
5+
//@ doc-flags:--parts-out-dir=info/doc.parts/sierra
6+
//@ doc-flags:--enable-index-page
7+
//@ doc-flags:-Zunstable-options
8+
9+
extern crate tango;
10+
pub struct Sierra;
11+
impl tango::Tango for Sierra {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//@ aux-build:quebec.rs
2+
//@ build-aux-docs
3+
//@ unique-doc-out-dir
4+
//@ doc-flags:--merge=none
5+
//@ doc-flags:--parts-out-dir=info/doc.parts/tango
6+
//@ doc-flags:--enable-index-page
7+
//@ doc-flags:-Zunstable-options
8+
9+
extern crate quebec;
10+
pub trait Tango {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
//@ aux-build:tango.rs
2+
//@ aux-build:romeo.rs
3+
//@ aux-build:quebec.rs
4+
//@ aux-build:sierra.rs
5+
//@ build-aux-docs
6+
//@ doc-flags:--merge=finalize
7+
//@ doc-flags:--include-parts-dir=info/doc.parts/tango
8+
//@ doc-flags:--include-parts-dir=info/doc.parts/romeo
9+
//@ doc-flags:--include-parts-dir=info/doc.parts/quebec
10+
//@ doc-flags:--include-parts-dir=info/doc.parts/sierra
11+
//@ doc-flags:--enable-index-page
12+
//@ doc-flags:-Zunstable-options
13+
14+
//@ has index.html '//h1' 'List of all crates'
15+
//@ has index.html
16+
//@ has index.html '//ul[@class="all-items"]//a[@href="indigo/index.html"]' 'indigo'
17+
//@ has index.html '//ul[@class="all-items"]//a[@href="quebec/index.html"]' 'quebec'
18+
//@ has index.html '//ul[@class="all-items"]//a[@href="romeo/index.html"]' 'romeo'
19+
//@ has index.html '//ul[@class="all-items"]//a[@href="sierra/index.html"]' 'sierra'
20+
//@ has index.html '//ul[@class="all-items"]//a[@href="tango/index.html"]' 'tango'
21+
//@ !has quebec/struct.Quebec.html
22+
//@ !has romeo/type.Romeo.html
23+
//@ !has sierra/struct.Sierra.html
24+
//@ !has tango/trait.Tango.html
25+
//@ hasraw trait.impl/tango/trait.Tango.js 'struct.Sierra.html'
26+
//@ hasraw search-index.js 'Quebec'
27+
//@ hasraw search-index.js 'Romeo'
28+
//@ hasraw search-index.js 'Sierra'
29+
//@ hasraw search-index.js 'Tango'
30+
//@ has type.impl/sierra/struct.Sierra.js
31+
//@ hasraw type.impl/sierra/struct.Sierra.js 'Tango'
32+
//@ hasraw type.impl/sierra/struct.Sierra.js 'Romeo'
33+
34+
// document everything in the default mode, there are separate out
35+
// directories that are linked together
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//@ unique-doc-out-dir
2+
//@ doc-flags:--merge=none
3+
//@ doc-flags:--enable-index-page
4+
//@ doc-flags:-Zunstable-options
5+
6+
pub struct Quebec;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//@ aux-build:quebec.rs
2+
//@ build-aux-docs
3+
//@ unique-doc-out-dir
4+
//@ doc-flags:--merge=none
5+
//@ doc-flags:--enable-index-page
6+
//@ doc-flags:-Zunstable-options
7+
8+
extern crate quebec;
9+
pub trait Tango {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
//@ aux-build:tango.rs
2+
//@ build-aux-docs
3+
//@ doc-flags:--merge=none
4+
//@ doc-flags:--enable-index-page
5+
//@ doc-flags:-Zunstable-options
6+
7+
//@ !has index.html
8+
//@ has sierra/struct.Sierra.html
9+
//@ hasraw sierra/struct.Sierra.html 'Tango'
10+
//@ !has trait.impl/tango/trait.Tango.js
11+
//@ !has search-index.js
12+
13+
// we don't generate any cross-crate info if --merge=none, even if we
14+
// document crates separately
15+
extern crate tango;
16+
pub struct Sierra;
17+
impl tango::Tango for Sierra {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//@ doc-flags:--merge=none
2+
//@ doc-flags:--parts-out-dir=info/doc.parts/quebec
3+
//@ doc-flags:--enable-index-page
4+
//@ doc-flags:-Zunstable-options
5+
6+
pub struct Quebec;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//@ aux-build:quebec.rs
2+
//@ build-aux-docs
3+
//@ doc-flags:--merge=none
4+
//@ doc-flags:--parts-out-dir=info/doc.parts/tango
5+
//@ doc-flags:--enable-index-page
6+
//@ doc-flags:-Zunstable-options
7+
8+
extern crate quebec;
9+
pub trait Tango {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//@ aux-build:tango.rs
2+
//@ build-aux-docs
3+
//@ doc-flags:--merge=none
4+
//@ doc-flags:--parts-out-dir=info/doc.parts/sierra
5+
//@ doc-flags:--enable-index-page
6+
//@ doc-flags:-Zunstable-options
7+
8+
//@ !has index.html
9+
//@ has sierra/struct.Sierra.html
10+
//@ has tango/trait.Tango.html
11+
//@ hasraw sierra/struct.Sierra.html 'Tango'
12+
//@ !has trait.impl/tango/trait.Tango.js
13+
//@ !has search-index.js
14+
15+
// we --merge=none, so --parts-out-dir doesn't do anything
16+
extern crate tango;
17+
pub struct Sierra;
18+
impl tango::Tango for Sierra {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
//@ doc-flags:--merge=none
2+
//@ doc-flags:--parts-out-dir=info/doc.parts/quebec
3+
//@ doc-flags:--enable-index-page
4+
//@ doc-flags:-Zunstable-options
5+
6+
pub struct Quebec;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
//@ aux-build:quebec.rs
2+
//@ build-aux-docs
3+
//@ doc-flags:--merge=none
4+
//@ doc-flags:--parts-out-dir=info/doc.parts/tango
5+
//@ doc-flags:--enable-index-page
6+
//@ doc-flags:-Zunstable-options
7+
8+
extern crate quebec;
9+
pub trait Tango {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
//@ aux-build:tango.rs
2+
//@ build-aux-docs
3+
//@ doc-flags:--merge=finalize
4+
//@ doc-flags:--include-parts-dir=info/doc.parts/tango
5+
//@ doc-flags:--enable-index-page
6+
//@ doc-flags:-Zunstable-options
7+
8+
//@ has quebec/struct.Quebec.html
9+
//@ has sierra/struct.Sierra.html
10+
//@ has tango/trait.Tango.html
11+
//@ hasraw sierra/struct.Sierra.html 'Tango'
12+
//@ hasraw trait.impl/tango/trait.Tango.js 'struct.Sierra.html'
13+
//@ hasraw search-index.js 'Tango'
14+
//@ hasraw search-index.js 'Sierra'
15+
//@ !hasraw search-index.js 'Quebec'
16+
17+
// we overwrite quebec and tango's cross-crate information, but we
18+
// include the info from tango meaning that it should appear in the out
19+
// dir
20+
extern crate tango;
21+
pub struct Sierra;
22+
impl tango::Tango for Sierra {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//@ unique-doc-out-dir
2+
//@ doc-flags:--merge=none
3+
//@ doc-flags:--parts-out-dir=info/doc.parts/quebec
4+
//@ doc-flags:--enable-index-page
5+
//@ doc-flags:-Zunstable-options
6+
7+
pub struct Quebec;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//@ aux-build:quebec.rs
2+
//@ build-aux-docs
3+
//@ unique-doc-out-dir
4+
//@ doc-flags:--merge=none
5+
//@ doc-flags:--parts-out-dir=info/doc.parts/tango
6+
//@ doc-flags:--enable-index-page
7+
//@ doc-flags:-Zunstable-options
8+
9+
extern crate quebec;
10+
pub trait Tango {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//@ aux-build:tango.rs
2+
//@ build-aux-docs
3+
//@ doc-flags:--merge=finalize
4+
//@ doc-flags:--include-parts-dir=info/doc.parts/tango
5+
//@ doc-flags:--include-parts-dir=info/doc.parts/quebec
6+
//@ doc-flags:--enable-index-page
7+
//@ doc-flags:-Zunstable-options
8+
9+
//@ has index.html
10+
//@ has index.html '//h1' 'List of all crates'
11+
//@ has index.html '//ul[@class="all-items"]//a[@href="quebec/index.html"]' 'quebec'
12+
//@ has index.html '//ul[@class="all-items"]//a[@href="sierra/index.html"]' 'sierra'
13+
//@ has index.html '//ul[@class="all-items"]//a[@href="tango/index.html"]' 'tango'
14+
//@ has sierra/struct.Sierra.html
15+
//@ hasraw trait.impl/tango/trait.Tango.js 'struct.Sierra.html'
16+
//@ hasraw search-index.js 'Tango'
17+
//@ hasraw search-index.js 'Sierra'
18+
//@ hasraw search-index.js 'Quebec'
19+
20+
// If these were documeted into the same directory, the info would be
21+
// overwritten. However, since they are merged, we can still recover all
22+
// of the cross-crate information
23+
extern crate tango;
24+
pub struct Sierra;
25+
impl tango::Tango for Sierra {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//@ doc-flags:--merge=none
2+
//@ doc-flags:--enable-index-page
3+
//@ doc-flags:-Zunstable-options
4+
5+
pub struct Quebec;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//@ aux-build:quebec.rs
2+
//@ build-aux-docs
3+
//@ doc-flags:--merge=finalize
4+
//@ doc-flags:--enable-index-page
5+
//@ doc-flags:-Zunstable-options
6+
7+
extern crate quebec;
8+
pub trait Tango {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//@ aux-build:tango.rs
2+
//@ build-aux-docs
3+
//@ doc-flags:--merge=shared
4+
//@ doc-flags:--enable-index-page
5+
//@ doc-flags:-Zunstable-options
6+
7+
//@ has quebec/struct.Quebec.html
8+
//@ has sierra/struct.Sierra.html
9+
//@ has tango/trait.Tango.html
10+
//@ hasraw sierra/struct.Sierra.html 'Tango'
11+
//@ hasraw trait.impl/tango/trait.Tango.js 'struct.Sierra.html'
12+
//@ hasraw search-index.js 'Tango'
13+
//@ hasraw search-index.js 'Sierra'
14+
//@ !hasraw search-index.js 'Quebec'
15+
16+
// since tango is documented with --merge=finalize, we overwrite q's
17+
// cross-crate information
18+
extern crate tango;
19+
pub struct Sierra;
20+
impl tango::Tango for Sierra {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@ doc-flags:--merge=finalize
2+
//@ doc-flags:--enable-index-page
3+
//@ doc-flags:-Zunstable-options
4+
5+
//@ has index.html
6+
//@ has index.html '//h1' 'List of all crates'
7+
//@ has index.html '//ul[@class="all-items"]//a[@href="quebec/index.html"]' 'quebec'
8+
//@ has quebec/struct.Quebec.html
9+
//@ hasraw search-index.js 'Quebec'
10+
11+
// there is nothing to read from the output directory if we use a single
12+
// crate
13+
pub struct Quebec;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//@ doc-flags:--merge=shared
2+
//@ doc-flags:--enable-index-page
3+
//@ doc-flags:-Zunstable-options
4+
5+
//@ has index.html
6+
//@ has index.html '//h1' 'List of all crates'
7+
//@ has index.html '//ul[@class="all-items"]//a[@href="quebec/index.html"]' 'quebec'
8+
//@ has quebec/struct.Quebec.html
9+
//@ hasraw search-index.js 'Quebec'
10+
11+
// read-write is the default and this does the same as `single-crate`
12+
pub struct Quebec;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@ doc-flags:--parts-out-dir=info/doc.parts/quebec
2+
//@ doc-flags:--enable-index-page
3+
//@ doc-flags:-Zunstable-options
4+
5+
//@ has index.html
6+
//@ has index.html '//h1' 'List of all crates'
7+
//@ has index.html '//ul[@class="all-items"]//a[@href="quebec/index.html"]' 'quebec'
8+
//@ has quebec/struct.Quebec.html
9+
//@ hasraw search-index.js 'Quebec'
10+
11+
// we can --parts-out-dir, but that doesn't do anything other than create
12+
// the file
13+
pub struct Quebec;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//@ doc-flags:--merge=none
2+
//@ doc-flags:--parts-out-dir=info/doc.parts/quebec
3+
//@ doc-flags:--enable-index-page
4+
//@ doc-flags:-Zunstable-options
5+
6+
//@ !has index.html
7+
//@ has quebec/struct.Quebec.html
8+
//@ !has search-index.js
9+
10+
// --merge=none doesn't write anything, despite --parts-out-dir
11+
pub struct Quebec;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//@ doc-flags:--merge=finalize
2+
//@ doc-flags:--enable-index-page
3+
//@ doc-flags:-Zunstable-options
4+
5+
pub struct Quebec;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//@ aux-build:quebec.rs
2+
//@ build-aux-docs
3+
//@ doc-flags:--merge=finalize
4+
//@ doc-flags:--enable-index-page
5+
//@ doc-flags:-Zunstable-options
6+
7+
extern crate quebec;
8+
pub trait Tango {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//@ aux-build:tango.rs
2+
//@ build-aux-docs
3+
//@ doc-flags:--merge=finalize
4+
//@ doc-flags:--enable-index-page
5+
//@ doc-flags:-Zunstable-options
6+
7+
//@ has index.html
8+
//@ has index.html '//h1' 'List of all crates'
9+
//@ has index.html '//ul[@class="all-items"]//a[@href="sierra/index.html"]' 'sierra'
10+
//@ has index.html '//ul[@class="all-items"]//a[@href="tango/index.html"]' 'tango'
11+
//@ has sierra/struct.Sierra.html
12+
//@ has tango/trait.Tango.html
13+
//@ hasraw sierra/struct.Sierra.html 'Tango'
14+
//@ hasraw trait.impl/tango/trait.Tango.js 'struct.Sierra.html'
15+
//@ hasraw search-index.js 'Sierra'
16+
17+
// write only overwrites stuff in the output directory
18+
extern crate tango;
19+
pub struct Sierra;
20+
impl tango::Tango for Sierra {}

0 commit comments

Comments
 (0)