Skip to content

Commit 87e4b12

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 87e4b12

File tree

89 files changed

+807
-195
lines changed

Some content is hidden

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

89 files changed

+807
-195
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
//@ unique-doc-out-dir
2+
pub struct Quebec;

tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/t.rs

-4
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//@ aux-build:quebec.rs
2+
//@ build-aux-docs
3+
//@ unique-doc-out-dir
4+
extern crate quebec;
5+
pub trait Tango {}

tests/rustdoc/cross-crate-info/cargo-transitive-no-index/s.rs

-16
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
//@ aux-build:tango.rs
2+
//@ build-aux-docs
3+
//@ !has index.html
4+
//@ !has quebec/struct.Quebec.html
5+
//@ !has tango/trait.Tango.html
6+
//@ has sierra/struct.Sierra.html
7+
//@ hasraw sierra/struct.Sierra.html 'Tango'
8+
//@ hasraw trait.impl/tango/trait.Tango.js 'struct.Sierra.html'
9+
//@ !hasraw search-index.js 'Tango'
10+
//@ !hasraw search-index.js 'Quebec'
11+
//@ hasraw search-index.js 'Sierra'
12+
13+
// We use the regular and transitive dependencies.Both should appear in
14+
// the item docs for the final crate. The index page is not generated,
15+
// however.
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,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 {}

tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/q.rs tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/quebec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//@ build-aux-docs
1+
//@ unique-doc-out-dir
22
//@ doc-flags:--enable-index-page
33
//@ doc-flags:-Zunstable-options
44

Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
//@ aux-build:q.rs
1+
//@ aux-build:quebec.rs
22
//@ build-aux-docs
3+
//@ unique-doc-out-dir
34
//@ doc-flags:--enable-index-page
45
//@ doc-flags:-Zunstable-options
56

6-
extern crate q;
7+
extern crate quebec;
78
pub trait Tango {}

tests/rustdoc/cross-crate-info/cargo-transitive/s.rs

-24
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
//@ aux-build:tango.rs
2+
//@ build-aux-docs
3+
//@ doc-flags:--enable-index-page
4+
//@ doc-flags:-Zunstable-options
5+
6+
//@ has index.html
7+
//@ has index.html '//h1' 'List of all crates'
8+
//@ !has index.html '//ul[@class="all-items"]//a[@href="quebec/index.html"]' 'quebec'
9+
//@ !has index.html '//ul[@class="all-items"]//a[@href="tango/index.html"]' 'tango'
10+
//@ has index.html '//ul[@class="all-items"]//a[@href="sierra/index.html"]' 'sierra'
11+
//@ !has quebec/struct.Quebec.html
12+
//@ !has tango/trait.Tango.html
13+
//@ has sierra/struct.Sierra.html
14+
//@ hasraw sierra/struct.Sierra.html 'Tango'
15+
//@ hasraw trait.impl/tango/trait.Tango.js 'struct.Sierra.html'
16+
//@ !hasraw search-index.js 'Tango'
17+
//@ !hasraw search-index.js 'Quebec'
18+
//@ hasraw search-index.js 'Sierra'
19+
20+
// We use the regular and transitive dependencies. Both should appear in
21+
// the item docs for the final crate.
22+
extern crate tango;
23+
pub struct Sierra;
24+
impl tango::Tango for Sierra {}
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
//@ build-aux-docs
21
pub trait Foxtrot {}

tests/rustdoc/cross-crate-info/cargo-two-no-index/e.rs

-14
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//@ aux-build:foxtrot.rs
2+
//@ build-aux-docs
3+
//@ has echo/enum.Echo.html
4+
//@ has foxtrot/trait.Foxtrot.html
5+
//@ hasraw echo/enum.Echo.html 'Foxtrot'
6+
//@ hasraw trait.impl/foxtrot/trait.Foxtrot.js 'enum.Echo.html'
7+
//@ hasraw search-index.js 'Foxtrot'
8+
//@ hasraw search-index.js 'Echo'
9+
10+
// document two crates in the same way that cargo does. do not provide
11+
// --enable-index-page
12+
extern crate foxtrot;
13+
pub enum Echo {}
14+
impl foxtrot::Foxtrot for Echo {}

tests/rustdoc/cross-crate-info/cargo-two/auxiliary/f.rs tests/rustdoc/cross-crate-info/cargo-two/auxiliary/foxtrot.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//@ build-aux-docs
21
//@ doc-flags:--enable-index-page
32
//@ doc-flags:-Zunstable-options
43

tests/rustdoc/cross-crate-info/cargo-two/e.rs

-21
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
//@ aux-build:foxtrot.rs
2+
//@ build-aux-docs
3+
//@ doc-flags:--enable-index-page
4+
//@ doc-flags:-Zunstable-options
5+
6+
//@ has index.html
7+
//@ has index.html '//h1' 'List of all crates'
8+
//@ has index.html '//ul[@class="all-items"]//a[@href="foxtrot/index.html"]' 'foxtrot'
9+
//@ has index.html '//ul[@class="all-items"]//a[@href="echo/index.html"]' 'echo'
10+
//@ has echo/enum.Echo.html
11+
//@ has foxtrot/trait.Foxtrot.html
12+
//@ hasraw echo/enum.Echo.html 'Foxtrot'
13+
//@ hasraw trait.impl/foxtrot/trait.Foxtrot.js 'enum.Echo.html'
14+
//@ hasraw search-index.js 'Foxtrot'
15+
//@ hasraw search-index.js 'Echo'
16+
17+
// document two crates in the same way that cargo does, writing them both
18+
// into the same output directory
19+
extern crate foxtrot;
20+
pub enum Echo {}
21+
impl foxtrot::Foxtrot for Echo {}
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
//@ build-aux-docs
21
pub trait Foxtrot {}

tests/rustdoc/cross-crate-info/index-on-last/e.rs

-20
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
//@ aux-build:foxtrot.rs
2+
//@ build-aux-docs
3+
//@ doc-flags:--enable-index-page
4+
//@ doc-flags:-Zunstable-options
5+
6+
//@ has index.html
7+
//@ has index.html '//h1' 'List of all crates'
8+
//@ has index.html '//ul[@class="all-items"]//a[@href="foxtrot/index.html"]' 'foxtrot'
9+
//@ has index.html '//ul[@class="all-items"]//a[@href="echo/index.html"]' 'echo'
10+
//@ has echo/enum.Echo.html
11+
//@ has foxtrot/trait.Foxtrot.html
12+
//@ hasraw echo/enum.Echo.html 'Foxtrot'
13+
//@ hasraw trait.impl/foxtrot/trait.Foxtrot.js 'enum.Echo.html'
14+
//@ hasraw search-index.js 'Foxtrot'
15+
//@ hasraw search-index.js 'Echo'
16+
17+
// only declare --enable-index-page to the last rustdoc invocation
18+
extern crate foxtrot;
19+
pub enum Echo {}
20+
impl foxtrot::Foxtrot for Echo {}
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:sierra.rs
2+
//@ aux-build:tango.rs
3+
//@ aux-build:romeo.rs
4+
//@ aux-build:quebec.rs
5+
//@ build-aux-docs
6+
//@ doc-flags:--merge=finalize
7+
//@ doc-flags:--include-parts-dir=info/doc.parts/sierra
8+
//@ doc-flags:--include-parts-dir=info/doc.parts/tango
9+
//@ doc-flags:--include-parts-dir=info/doc.parts/romeo
10+
//@ doc-flags:--include-parts-dir=info/doc.parts/quebec
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

tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/q.rs tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/quebec.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//@ build-aux-docs
21
//@ doc-flags:--enable-index-page
32
//@ doc-flags:-Zunstable-options
43

tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/r.rs

-7
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//@ aux-build:sierra.rs
2+
//@ build-aux-docs
3+
//@ doc-flags:--enable-index-page
4+
//@ doc-flags:-Zunstable-options
5+
6+
extern crate sierra;
7+
pub type Romeo = sierra::Sierra;
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
//@ aux-build:t.rs
1+
//@ aux-build:tango.rs
22
//@ build-aux-docs
33
//@ doc-flags:--enable-index-page
44
//@ doc-flags:-Zunstable-options
55

6-
extern crate t;
6+
extern crate tango;
77
pub struct Sierra;
8-
impl t::Tango for Sierra {}
8+
impl tango::Tango for Sierra {}

0 commit comments

Comments
 (0)