Skip to content

Commit

Permalink
add rfc#3662 tests, plus multi letter test crates
Browse files Browse the repository at this point in the history
* 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)
  • Loading branch information
EtomicBomb committed Aug 20, 2024
1 parent fdd7a0f commit b528d6e
Show file tree
Hide file tree
Showing 89 changed files with 807 additions and 195 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//@ unique-doc-out-dir
pub struct Quebec;

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//@ aux-build:quebec.rs
//@ build-aux-docs
//@ unique-doc-out-dir
extern crate quebec;
pub trait Tango {}
16 changes: 0 additions & 16 deletions tests/rustdoc/cross-crate-info/cargo-transitive-no-index/s.rs

This file was deleted.

18 changes: 18 additions & 0 deletions tests/rustdoc/cross-crate-info/cargo-transitive-no-index/sierra.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//@ aux-build:tango.rs
//@ build-aux-docs
//@ !has index.html
//@ !has quebec/struct.Quebec.html
//@ !has tango/trait.Tango.html
//@ has sierra/struct.Sierra.html
//@ hasraw sierra/struct.Sierra.html 'Tango'
//@ hasraw trait.impl/tango/trait.Tango.js 'struct.Sierra.html'
//@ !hasraw search-index.js 'Tango'
//@ !hasraw search-index.js 'Quebec'
//@ hasraw search-index.js 'Sierra'

// We use the regular and transitive dependencies.Both should appear in
// the item docs for the final crate. The index page is not generated,
// however.
extern crate tango;
pub struct Sierra;
impl tango::Tango for Sierra {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//@ doc-flags:--merge=shared
//@ doc-flags:--enable-index-page
//@ doc-flags:-Zunstable-options

pub struct Quebec;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//@ aux-build:quebec.rs
//@ build-aux-docs
//@ doc-flags:--merge=shared
//@ doc-flags:--enable-index-page
//@ doc-flags:-Zunstable-options

extern crate quebec;
pub trait Tango {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//@ aux-build:tango.rs
//@ build-aux-docs
//@ doc-flags:--merge=shared
//@ 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="quebec/index.html"]' 'quebec'
//@ has index.html '//ul[@class="all-items"]//a[@href="sierra/index.html"]' 'sierra'
//@ has index.html '//ul[@class="all-items"]//a[@href="tango/index.html"]' 'tango'
//@ has quebec/struct.Quebec.html
//@ has sierra/struct.Sierra.html
//@ has tango/trait.Tango.html
//@ hasraw sierra/struct.Sierra.html 'Tango'
//@ hasraw trait.impl/tango/trait.Tango.js 'struct.Sierra.html'
//@ hasraw search-index.js 'Tango'
//@ hasraw search-index.js 'Sierra'
//@ hasraw search-index.js 'Quebec'

// similar to cargo-workflow-transitive, but we use --merge=read-write,
// which is the default.
extern crate tango;
pub struct Sierra;
impl tango::Tango for Sierra {}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ build-aux-docs
//@ unique-doc-out-dir
//@ doc-flags:--enable-index-page
//@ doc-flags:-Zunstable-options

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
//@ aux-build:q.rs
//@ aux-build:quebec.rs
//@ build-aux-docs
//@ unique-doc-out-dir
//@ doc-flags:--enable-index-page
//@ doc-flags:-Zunstable-options

extern crate q;
extern crate quebec;
pub trait Tango {}
24 changes: 0 additions & 24 deletions tests/rustdoc/cross-crate-info/cargo-transitive/s.rs

This file was deleted.

24 changes: 24 additions & 0 deletions tests/rustdoc/cross-crate-info/cargo-transitive/sierra.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
//@ aux-build:tango.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="quebec/index.html"]' 'quebec'
//@ !has index.html '//ul[@class="all-items"]//a[@href="tango/index.html"]' 'tango'
//@ has index.html '//ul[@class="all-items"]//a[@href="sierra/index.html"]' 'sierra'
//@ !has quebec/struct.Quebec.html
//@ !has tango/trait.Tango.html
//@ has sierra/struct.Sierra.html
//@ hasraw sierra/struct.Sierra.html 'Tango'
//@ hasraw trait.impl/tango/trait.Tango.js 'struct.Sierra.html'
//@ !hasraw search-index.js 'Tango'
//@ !hasraw search-index.js 'Quebec'
//@ hasraw search-index.js 'Sierra'

// We use the regular and transitive dependencies. Both should appear in
// the item docs for the final crate.
extern crate tango;
pub struct Sierra;
impl tango::Tango for Sierra {}
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
//@ build-aux-docs
pub trait Foxtrot {}
14 changes: 0 additions & 14 deletions tests/rustdoc/cross-crate-info/cargo-two-no-index/e.rs

This file was deleted.

14 changes: 14 additions & 0 deletions tests/rustdoc/cross-crate-info/cargo-two-no-index/echo.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//@ aux-build:foxtrot.rs
//@ build-aux-docs
//@ has echo/enum.Echo.html
//@ has foxtrot/trait.Foxtrot.html
//@ hasraw echo/enum.Echo.html 'Foxtrot'
//@ hasraw trait.impl/foxtrot/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 foxtrot;
pub enum Echo {}
impl foxtrot::Foxtrot for Echo {}
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//@ build-aux-docs
//@ doc-flags:--enable-index-page
//@ doc-flags:-Zunstable-options

Expand Down
21 changes: 0 additions & 21 deletions tests/rustdoc/cross-crate-info/cargo-two/e.rs

This file was deleted.

21 changes: 21 additions & 0 deletions tests/rustdoc/cross-crate-info/cargo-two/echo.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//@ aux-build:foxtrot.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="foxtrot/index.html"]' 'foxtrot'
//@ has index.html '//ul[@class="all-items"]//a[@href="echo/index.html"]' 'echo'
//@ has echo/enum.Echo.html
//@ has foxtrot/trait.Foxtrot.html
//@ hasraw echo/enum.Echo.html 'Foxtrot'
//@ hasraw trait.impl/foxtrot/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, writing them both
// into the same output directory
extern crate foxtrot;
pub enum Echo {}
impl foxtrot::Foxtrot for Echo {}
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
//@ build-aux-docs
pub trait Foxtrot {}
20 changes: 0 additions & 20 deletions tests/rustdoc/cross-crate-info/index-on-last/e.rs

This file was deleted.

20 changes: 20 additions & 0 deletions tests/rustdoc/cross-crate-info/index-on-last/echo.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//@ aux-build:foxtrot.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="foxtrot/index.html"]' 'foxtrot'
//@ has index.html '//ul[@class="all-items"]//a[@href="echo/index.html"]' 'echo'
//@ has echo/enum.Echo.html
//@ has foxtrot/trait.Foxtrot.html
//@ hasraw echo/enum.Echo.html 'Foxtrot'
//@ hasraw trait.impl/foxtrot/trait.Foxtrot.js 'enum.Echo.html'
//@ hasraw search-index.js 'Foxtrot'
//@ hasraw search-index.js 'Echo'

// only declare --enable-index-page to the last rustdoc invocation
extern crate foxtrot;
pub enum Echo {}
impl foxtrot::Foxtrot for Echo {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//@ unique-doc-out-dir
//@ doc-flags:--merge=none
//@ doc-flags:--parts-out-dir=info/doc.parts/quebec
//@ doc-flags:--enable-index-page
//@ doc-flags:-Zunstable-options

pub struct Quebec;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//@ aux-build:sierra.rs
//@ build-aux-docs
//@ unique-doc-out-dir
//@ doc-flags:--merge=none
//@ doc-flags:--parts-out-dir=info/doc.parts/romeo
//@ doc-flags:--enable-index-page
//@ doc-flags:-Zunstable-options

extern crate sierra;
pub type Romeo = sierra::Sierra;
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//@ aux-build:tango.rs
//@ build-aux-docs
//@ unique-doc-out-dir
//@ doc-flags:--merge=none
//@ doc-flags:--parts-out-dir=info/doc.parts/sierra
//@ doc-flags:--enable-index-page
//@ doc-flags:-Zunstable-options

extern crate tango;
pub struct Sierra;
impl tango::Tango for Sierra {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//@ aux-build:quebec.rs
//@ build-aux-docs
//@ unique-doc-out-dir
//@ doc-flags:--merge=none
//@ doc-flags:--parts-out-dir=info/doc.parts/tango
//@ doc-flags:--enable-index-page
//@ doc-flags:-Zunstable-options

extern crate quebec;
pub trait Tango {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
//@ aux-build:sierra.rs
//@ aux-build:tango.rs
//@ aux-build:romeo.rs
//@ aux-build:quebec.rs
//@ build-aux-docs
//@ doc-flags:--merge=finalize
//@ doc-flags:--include-parts-dir=info/doc.parts/sierra
//@ doc-flags:--include-parts-dir=info/doc.parts/tango
//@ doc-flags:--include-parts-dir=info/doc.parts/romeo
//@ doc-flags:--include-parts-dir=info/doc.parts/quebec
//@ doc-flags:--enable-index-page
//@ doc-flags:-Zunstable-options

//@ has index.html '//h1' 'List of all crates'
//@ has index.html
//@ has index.html '//ul[@class="all-items"]//a[@href="indigo/index.html"]' 'indigo'
//@ has index.html '//ul[@class="all-items"]//a[@href="quebec/index.html"]' 'quebec'
//@ has index.html '//ul[@class="all-items"]//a[@href="romeo/index.html"]' 'romeo'
//@ has index.html '//ul[@class="all-items"]//a[@href="sierra/index.html"]' 'sierra'
//@ has index.html '//ul[@class="all-items"]//a[@href="tango/index.html"]' 'tango'
//@ !has quebec/struct.Quebec.html
//@ !has romeo/type.Romeo.html
//@ !has sierra/struct.Sierra.html
//@ !has tango/trait.Tango.html
//@ hasraw trait.impl/tango/trait.Tango.js 'struct.Sierra.html'
//@ hasraw search-index.js 'Quebec'
//@ hasraw search-index.js 'Romeo'
//@ hasraw search-index.js 'Sierra'
//@ hasraw search-index.js 'Tango'
//@ has type.impl/sierra/struct.Sierra.js
//@ hasraw type.impl/sierra/struct.Sierra.js 'Tango'
//@ hasraw type.impl/sierra/struct.Sierra.js 'Romeo'

// document everything in the default mode, there are separate out
// directories that are linked together
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
//@ build-aux-docs
//@ doc-flags:--enable-index-page
//@ doc-flags:-Zunstable-options

Expand Down
7 changes: 0 additions & 7 deletions tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/r.rs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//@ aux-build:sierra.rs
//@ build-aux-docs
//@ doc-flags:--enable-index-page
//@ doc-flags:-Zunstable-options

extern crate sierra;
pub type Romeo = sierra::Sierra;
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//@ aux-build:t.rs
//@ aux-build:tango.rs
//@ build-aux-docs
//@ doc-flags:--enable-index-page
//@ doc-flags:-Zunstable-options

extern crate t;
extern crate tango;
pub struct Sierra;
impl t::Tango for Sierra {}
impl tango::Tango for Sierra {}
Loading

0 comments on commit b528d6e

Please sign in to comment.