diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/quebec.rs b/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/quebec.rs new file mode 100644 index 0000000000000..a4d9575550962 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/quebec.rs @@ -0,0 +1,2 @@ +//@ unique-doc-out-dir +pub struct Quebec; diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/t.rs b/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/t.rs deleted file mode 100644 index fab9ec4a92b96..0000000000000 --- a/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/t.rs +++ /dev/null @@ -1,4 +0,0 @@ -//@ aux-build:q.rs -//@ build-aux-docs -extern crate q; -pub trait Tango {} diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/tango.rs b/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/tango.rs new file mode 100644 index 0000000000000..3935de2caf85f --- /dev/null +++ b/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/tango.rs @@ -0,0 +1,5 @@ +//@ aux-build:quebec.rs +//@ build-aux-docs +//@ unique-doc-out-dir +extern crate quebec; +pub trait Tango {} diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/s.rs b/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/s.rs deleted file mode 100644 index 85c460ace642f..0000000000000 --- a/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/s.rs +++ /dev/null @@ -1,16 +0,0 @@ -//@ 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 {} diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/sierra.rs b/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/sierra.rs new file mode 100644 index 0000000000000..c43c314b1fda0 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/sierra.rs @@ -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 {} diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive-read-write/auxiliary/quebec.rs b/tests/rustdoc/cross-crate-info/cargo-transitive-read-write/auxiliary/quebec.rs new file mode 100644 index 0000000000000..fdafb3b7ac341 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/cargo-transitive-read-write/auxiliary/quebec.rs @@ -0,0 +1,5 @@ +//@ doc-flags:--merge=shared +//@ doc-flags:--enable-index-page +//@ doc-flags:-Zunstable-options + +pub struct Quebec; diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive-read-write/auxiliary/tango.rs b/tests/rustdoc/cross-crate-info/cargo-transitive-read-write/auxiliary/tango.rs new file mode 100644 index 0000000000000..ff12fe98d82c2 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/cargo-transitive-read-write/auxiliary/tango.rs @@ -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 {} diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive-read-write/sierra.rs b/tests/rustdoc/cross-crate-info/cargo-transitive-read-write/sierra.rs new file mode 100644 index 0000000000000..665f9567ba2d2 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/cargo-transitive-read-write/sierra.rs @@ -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 {} diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/q.rs b/tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/quebec.rs similarity index 79% rename from tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/q.rs rename to tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/quebec.rs index 932a0b17206d6..89b34aaff88e5 100644 --- a/tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/q.rs +++ b/tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/quebec.rs @@ -1,4 +1,4 @@ -//@ build-aux-docs +//@ unique-doc-out-dir //@ doc-flags:--enable-index-page //@ doc-flags:-Zunstable-options diff --git a/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/t.rs b/tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/tango.rs similarity index 60% rename from tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/t.rs rename to tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/tango.rs index c21a59c65188f..fc737afa9ff45 100644 --- a/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/t.rs +++ b/tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/tango.rs @@ -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 {} diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive/s.rs b/tests/rustdoc/cross-crate-info/cargo-transitive/s.rs deleted file mode 100644 index 68bfc34883bd8..0000000000000 --- a/tests/rustdoc/cross-crate-info/cargo-transitive/s.rs +++ /dev/null @@ -1,24 +0,0 @@ -//@ 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 {} diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive/sierra.rs b/tests/rustdoc/cross-crate-info/cargo-transitive/sierra.rs new file mode 100644 index 0000000000000..2f3915e43ce96 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/cargo-transitive/sierra.rs @@ -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 {} diff --git a/tests/rustdoc/cross-crate-info/cargo-two-no-index/auxiliary/f.rs b/tests/rustdoc/cross-crate-info/cargo-two-no-index/auxiliary/foxtrot.rs similarity index 52% rename from tests/rustdoc/cross-crate-info/cargo-two-no-index/auxiliary/f.rs rename to tests/rustdoc/cross-crate-info/cargo-two-no-index/auxiliary/foxtrot.rs index abc580a388cd2..390cef74d4730 100644 --- a/tests/rustdoc/cross-crate-info/cargo-two-no-index/auxiliary/f.rs +++ b/tests/rustdoc/cross-crate-info/cargo-two-no-index/auxiliary/foxtrot.rs @@ -1,2 +1 @@ -//@ build-aux-docs pub trait Foxtrot {} diff --git a/tests/rustdoc/cross-crate-info/cargo-two-no-index/e.rs b/tests/rustdoc/cross-crate-info/cargo-two-no-index/e.rs deleted file mode 100644 index c93298f969eab..0000000000000 --- a/tests/rustdoc/cross-crate-info/cargo-two-no-index/e.rs +++ /dev/null @@ -1,14 +0,0 @@ -//@ 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 {} diff --git a/tests/rustdoc/cross-crate-info/cargo-two-no-index/echo.rs b/tests/rustdoc/cross-crate-info/cargo-two-no-index/echo.rs new file mode 100644 index 0000000000000..7ccc98038609f --- /dev/null +++ b/tests/rustdoc/cross-crate-info/cargo-two-no-index/echo.rs @@ -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 {} diff --git a/tests/rustdoc/cross-crate-info/cargo-two/auxiliary/f.rs b/tests/rustdoc/cross-crate-info/cargo-two/auxiliary/foxtrot.rs similarity index 82% rename from tests/rustdoc/cross-crate-info/cargo-two/auxiliary/f.rs rename to tests/rustdoc/cross-crate-info/cargo-two/auxiliary/foxtrot.rs index a2a7033b13112..30b0ce253c9c1 100644 --- a/tests/rustdoc/cross-crate-info/cargo-two/auxiliary/f.rs +++ b/tests/rustdoc/cross-crate-info/cargo-two/auxiliary/foxtrot.rs @@ -1,4 +1,3 @@ -//@ build-aux-docs //@ doc-flags:--enable-index-page //@ doc-flags:-Zunstable-options diff --git a/tests/rustdoc/cross-crate-info/cargo-two/e.rs b/tests/rustdoc/cross-crate-info/cargo-two/e.rs deleted file mode 100644 index 00f86cbc34889..0000000000000 --- a/tests/rustdoc/cross-crate-info/cargo-two/e.rs +++ /dev/null @@ -1,21 +0,0 @@ -//@ aux-build:f.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="f/index.html"]' 'f' -//@ has index.html '//ul[@class="all-items"]//a[@href="e/index.html"]' 'e' -//@ 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, writing them both -// into the same output directory -extern crate f; -pub enum Echo {} -impl f::Foxtrot for Echo {} diff --git a/tests/rustdoc/cross-crate-info/cargo-two/echo.rs b/tests/rustdoc/cross-crate-info/cargo-two/echo.rs new file mode 100644 index 0000000000000..09ba32119b0d0 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/cargo-two/echo.rs @@ -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 {} diff --git a/tests/rustdoc/cross-crate-info/index-on-last/auxiliary/f.rs b/tests/rustdoc/cross-crate-info/index-on-last/auxiliary/foxtrot.rs similarity index 52% rename from tests/rustdoc/cross-crate-info/index-on-last/auxiliary/f.rs rename to tests/rustdoc/cross-crate-info/index-on-last/auxiliary/foxtrot.rs index abc580a388cd2..390cef74d4730 100644 --- a/tests/rustdoc/cross-crate-info/index-on-last/auxiliary/f.rs +++ b/tests/rustdoc/cross-crate-info/index-on-last/auxiliary/foxtrot.rs @@ -1,2 +1 @@ -//@ build-aux-docs pub trait Foxtrot {} diff --git a/tests/rustdoc/cross-crate-info/index-on-last/e.rs b/tests/rustdoc/cross-crate-info/index-on-last/e.rs deleted file mode 100644 index ffee898cd966d..0000000000000 --- a/tests/rustdoc/cross-crate-info/index-on-last/e.rs +++ /dev/null @@ -1,20 +0,0 @@ -//@ aux-build:f.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="f/index.html"]' 'f' -//@ has index.html '//ul[@class="all-items"]//a[@href="e/index.html"]' 'e' -//@ 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' - -// only declare --enable-index-page to the last rustdoc invocation -extern crate f; -pub enum Echo {} -impl f::Foxtrot for Echo {} diff --git a/tests/rustdoc/cross-crate-info/index-on-last/echo.rs b/tests/rustdoc/cross-crate-info/index-on-last/echo.rs new file mode 100644 index 0000000000000..b8a60e130af2b --- /dev/null +++ b/tests/rustdoc/cross-crate-info/index-on-last/echo.rs @@ -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 {} diff --git a/tests/rustdoc/cross-crate-info/kitchen-sink-separate-dirs/auxiliary/quebec.rs b/tests/rustdoc/cross-crate-info/kitchen-sink-separate-dirs/auxiliary/quebec.rs new file mode 100644 index 0000000000000..d10bc0316ccad --- /dev/null +++ b/tests/rustdoc/cross-crate-info/kitchen-sink-separate-dirs/auxiliary/quebec.rs @@ -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; diff --git a/tests/rustdoc/cross-crate-info/kitchen-sink-separate-dirs/auxiliary/romeo.rs b/tests/rustdoc/cross-crate-info/kitchen-sink-separate-dirs/auxiliary/romeo.rs new file mode 100644 index 0000000000000..6d0c8651db53f --- /dev/null +++ b/tests/rustdoc/cross-crate-info/kitchen-sink-separate-dirs/auxiliary/romeo.rs @@ -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; diff --git a/tests/rustdoc/cross-crate-info/kitchen-sink-separate-dirs/auxiliary/sierra.rs b/tests/rustdoc/cross-crate-info/kitchen-sink-separate-dirs/auxiliary/sierra.rs new file mode 100644 index 0000000000000..10898f3886477 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/kitchen-sink-separate-dirs/auxiliary/sierra.rs @@ -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 {} diff --git a/tests/rustdoc/cross-crate-info/kitchen-sink-separate-dirs/auxiliary/tango.rs b/tests/rustdoc/cross-crate-info/kitchen-sink-separate-dirs/auxiliary/tango.rs new file mode 100644 index 0000000000000..3c3721ee6eb7d --- /dev/null +++ b/tests/rustdoc/cross-crate-info/kitchen-sink-separate-dirs/auxiliary/tango.rs @@ -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 {} diff --git a/tests/rustdoc/cross-crate-info/kitchen-sink-separate-dirs/indigo.rs b/tests/rustdoc/cross-crate-info/kitchen-sink-separate-dirs/indigo.rs new file mode 100644 index 0000000000000..ab3d626305e42 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/kitchen-sink-separate-dirs/indigo.rs @@ -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 diff --git a/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/q.rs b/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/quebec.rs similarity index 82% rename from tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/q.rs rename to tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/quebec.rs index 932a0b17206d6..c4b3ce498576c 100644 --- a/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/q.rs +++ b/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/quebec.rs @@ -1,4 +1,3 @@ -//@ build-aux-docs //@ doc-flags:--enable-index-page //@ doc-flags:-Zunstable-options diff --git a/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/r.rs b/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/r.rs deleted file mode 100644 index 2c0db2abc53d9..0000000000000 --- a/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/r.rs +++ /dev/null @@ -1,7 +0,0 @@ -//@ aux-build:s.rs -//@ build-aux-docs -//@ doc-flags:--enable-index-page -//@ doc-flags:-Zunstable-options - -extern crate s; -pub type Romeo = s::Sierra; diff --git a/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/romeo.rs b/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/romeo.rs new file mode 100644 index 0000000000000..bb03c748e5d34 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/romeo.rs @@ -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; diff --git a/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/s.rs b/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/sierra.rs similarity index 58% rename from tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/s.rs rename to tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/sierra.rs index 355d3f1aaa883..0d630a0d20661 100644 --- a/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/s.rs +++ b/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/sierra.rs @@ -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 {} diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/t.rs b/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/tango.rs similarity index 70% rename from tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/t.rs rename to tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/tango.rs index c21a59c65188f..299a673418713 100644 --- a/tests/rustdoc/cross-crate-info/cargo-transitive/auxiliary/t.rs +++ b/tests/rustdoc/cross-crate-info/kitchen-sink/auxiliary/tango.rs @@ -1,7 +1,7 @@ -//@ aux-build:q.rs +//@ aux-build:quebec.rs //@ build-aux-docs //@ doc-flags:--enable-index-page //@ doc-flags:-Zunstable-options -extern crate q; +extern crate quebec; pub trait Tango {} diff --git a/tests/rustdoc/cross-crate-info/kitchen-sink/i.rs b/tests/rustdoc/cross-crate-info/kitchen-sink/i.rs deleted file mode 100644 index bcb9464795af2..0000000000000 --- a/tests/rustdoc/cross-crate-info/kitchen-sink/i.rs +++ /dev/null @@ -1,30 +0,0 @@ -//@ aux-build:r.rs -//@ aux-build:q.rs -//@ aux-build:t.rs -//@ aux-build:s.rs -//@ build-aux-docs -//@ 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="i/index.html"]' 'i' -//@ has index.html '//ul[@class="all-items"]//a[@href="q/index.html"]' 'q' -//@ has index.html '//ul[@class="all-items"]//a[@href="r/index.html"]' 'r' -//@ 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 r/type.Romeo.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 'Quebec' -//@ hasraw search-index.js 'Romeo' -//@ hasraw search-index.js 'Sierra' -//@ hasraw search-index.js 'Tango' -//@ has type.impl/s/struct.Sierra.js -//@ hasraw type.impl/s/struct.Sierra.js 'Tango' -//@ hasraw type.impl/s/struct.Sierra.js 'Romeo' - -// document everything in the default mode diff --git a/tests/rustdoc/cross-crate-info/kitchen-sink/indigo.rs b/tests/rustdoc/cross-crate-info/kitchen-sink/indigo.rs new file mode 100644 index 0000000000000..f0090a9cb24fd --- /dev/null +++ b/tests/rustdoc/cross-crate-info/kitchen-sink/indigo.rs @@ -0,0 +1,30 @@ +//@ aux-build:sierra.rs +//@ aux-build:tango.rs +//@ aux-build:romeo.rs +//@ aux-build:quebec.rs +//@ build-aux-docs +//@ 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 sierra/struct.Sierra.html 'Tango' +//@ 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 diff --git a/tests/rustdoc/cross-crate-info/no-merge-separate/auxiliary/quebec.rs b/tests/rustdoc/cross-crate-info/no-merge-separate/auxiliary/quebec.rs new file mode 100644 index 0000000000000..61210529fa6bc --- /dev/null +++ b/tests/rustdoc/cross-crate-info/no-merge-separate/auxiliary/quebec.rs @@ -0,0 +1,6 @@ +//@ unique-doc-out-dir +//@ doc-flags:--merge=none +//@ doc-flags:--enable-index-page +//@ doc-flags:-Zunstable-options + +pub struct Quebec; diff --git a/tests/rustdoc/cross-crate-info/no-merge-separate/auxiliary/tango.rs b/tests/rustdoc/cross-crate-info/no-merge-separate/auxiliary/tango.rs new file mode 100644 index 0000000000000..70d8a4b91f549 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/no-merge-separate/auxiliary/tango.rs @@ -0,0 +1,9 @@ +//@ aux-build:quebec.rs +//@ build-aux-docs +//@ unique-doc-out-dir +//@ doc-flags:--merge=none +//@ doc-flags:--enable-index-page +//@ doc-flags:-Zunstable-options + +extern crate quebec; +pub trait Tango {} diff --git a/tests/rustdoc/cross-crate-info/no-merge-separate/sierra.rs b/tests/rustdoc/cross-crate-info/no-merge-separate/sierra.rs new file mode 100644 index 0000000000000..7eac207e51886 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/no-merge-separate/sierra.rs @@ -0,0 +1,17 @@ +//@ aux-build:tango.rs +//@ build-aux-docs +//@ doc-flags:--merge=none +//@ doc-flags:--enable-index-page +//@ doc-flags:-Zunstable-options + +//@ !has index.html +//@ has sierra/struct.Sierra.html +//@ hasraw sierra/struct.Sierra.html 'Tango' +//@ !has trait.impl/tango/trait.Tango.js +//@ !has search-index.js + +// we don't generate any cross-crate info if --merge=none, even if we +// document crates separately +extern crate tango; +pub struct Sierra; +impl tango::Tango for Sierra {} diff --git a/tests/rustdoc/cross-crate-info/no-merge-write-anyway/auxiliary/quebec.rs b/tests/rustdoc/cross-crate-info/no-merge-write-anyway/auxiliary/quebec.rs new file mode 100644 index 0000000000000..6ab921533b037 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/no-merge-write-anyway/auxiliary/quebec.rs @@ -0,0 +1,6 @@ +//@ 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; diff --git a/tests/rustdoc/cross-crate-info/no-merge-write-anyway/auxiliary/tango.rs b/tests/rustdoc/cross-crate-info/no-merge-write-anyway/auxiliary/tango.rs new file mode 100644 index 0000000000000..9fa99d3be8af4 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/no-merge-write-anyway/auxiliary/tango.rs @@ -0,0 +1,9 @@ +//@ aux-build:quebec.rs +//@ build-aux-docs +//@ 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 {} diff --git a/tests/rustdoc/cross-crate-info/no-merge-write-anyway/sierra.rs b/tests/rustdoc/cross-crate-info/no-merge-write-anyway/sierra.rs new file mode 100644 index 0000000000000..f3340a80c848b --- /dev/null +++ b/tests/rustdoc/cross-crate-info/no-merge-write-anyway/sierra.rs @@ -0,0 +1,18 @@ +//@ aux-build:tango.rs +//@ build-aux-docs +//@ doc-flags:--merge=none +//@ doc-flags:--parts-out-dir=info/doc.parts/sierra +//@ doc-flags:--enable-index-page +//@ doc-flags:-Zunstable-options + +//@ !has index.html +//@ has sierra/struct.Sierra.html +//@ has tango/trait.Tango.html +//@ hasraw sierra/struct.Sierra.html 'Tango' +//@ !has trait.impl/tango/trait.Tango.js +//@ !has search-index.js + +// we --merge=none, so --parts-out-dir doesn't do anything +extern crate tango; +pub struct Sierra; +impl tango::Tango for Sierra {} diff --git a/tests/rustdoc/cross-crate-info/overwrite-but-include/auxiliary/quebec.rs b/tests/rustdoc/cross-crate-info/overwrite-but-include/auxiliary/quebec.rs new file mode 100644 index 0000000000000..6ab921533b037 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/overwrite-but-include/auxiliary/quebec.rs @@ -0,0 +1,6 @@ +//@ 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; diff --git a/tests/rustdoc/cross-crate-info/overwrite-but-include/auxiliary/tango.rs b/tests/rustdoc/cross-crate-info/overwrite-but-include/auxiliary/tango.rs new file mode 100644 index 0000000000000..9fa99d3be8af4 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/overwrite-but-include/auxiliary/tango.rs @@ -0,0 +1,9 @@ +//@ aux-build:quebec.rs +//@ build-aux-docs +//@ 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 {} diff --git a/tests/rustdoc/cross-crate-info/overwrite-but-include/sierra.rs b/tests/rustdoc/cross-crate-info/overwrite-but-include/sierra.rs new file mode 100644 index 0000000000000..8eb0f1d049831 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/overwrite-but-include/sierra.rs @@ -0,0 +1,22 @@ +//@ aux-build:tango.rs +//@ build-aux-docs +//@ doc-flags:--merge=finalize +//@ doc-flags:--include-parts-dir=info/doc.parts/tango +//@ doc-flags:--enable-index-page +//@ doc-flags:-Zunstable-options + +//@ 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' + +// we overwrite quebec and tango's cross-crate information, but we +// include the info from tango meaning that it should appear in the out +// dir +extern crate tango; +pub struct Sierra; +impl tango::Tango for Sierra {} diff --git a/tests/rustdoc/cross-crate-info/overwrite-but-separate/auxiliary/quebec.rs b/tests/rustdoc/cross-crate-info/overwrite-but-separate/auxiliary/quebec.rs new file mode 100644 index 0000000000000..d10bc0316ccad --- /dev/null +++ b/tests/rustdoc/cross-crate-info/overwrite-but-separate/auxiliary/quebec.rs @@ -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; diff --git a/tests/rustdoc/cross-crate-info/overwrite-but-separate/auxiliary/tango.rs b/tests/rustdoc/cross-crate-info/overwrite-but-separate/auxiliary/tango.rs new file mode 100644 index 0000000000000..3c3721ee6eb7d --- /dev/null +++ b/tests/rustdoc/cross-crate-info/overwrite-but-separate/auxiliary/tango.rs @@ -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 {} diff --git a/tests/rustdoc/cross-crate-info/overwrite-but-separate/sierra.rs b/tests/rustdoc/cross-crate-info/overwrite-but-separate/sierra.rs new file mode 100644 index 0000000000000..4ee036238b4b1 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/overwrite-but-separate/sierra.rs @@ -0,0 +1,25 @@ +//@ aux-build:tango.rs +//@ build-aux-docs +//@ doc-flags:--merge=finalize +//@ doc-flags:--include-parts-dir=info/doc.parts/tango +//@ doc-flags:--include-parts-dir=info/doc.parts/quebec +//@ 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 sierra/struct.Sierra.html +//@ 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' + +// If these were documeted into the same directory, the info would be +// overwritten. However, since they are merged, we can still recover all +// of the cross-crate information +extern crate tango; +pub struct Sierra; +impl tango::Tango for Sierra {} diff --git a/tests/rustdoc/cross-crate-info/overwrite/auxiliary/quebec.rs b/tests/rustdoc/cross-crate-info/overwrite/auxiliary/quebec.rs new file mode 100644 index 0000000000000..0e28d8e646647 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/overwrite/auxiliary/quebec.rs @@ -0,0 +1,5 @@ +//@ doc-flags:--merge=none +//@ doc-flags:--enable-index-page +//@ doc-flags:-Zunstable-options + +pub struct Quebec; diff --git a/tests/rustdoc/cross-crate-info/overwrite/auxiliary/tango.rs b/tests/rustdoc/cross-crate-info/overwrite/auxiliary/tango.rs new file mode 100644 index 0000000000000..363b2d5508e63 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/overwrite/auxiliary/tango.rs @@ -0,0 +1,8 @@ +//@ aux-build:quebec.rs +//@ build-aux-docs +//@ doc-flags:--merge=finalize +//@ doc-flags:--enable-index-page +//@ doc-flags:-Zunstable-options + +extern crate quebec; +pub trait Tango {} diff --git a/tests/rustdoc/cross-crate-info/overwrite/sierra.rs b/tests/rustdoc/cross-crate-info/overwrite/sierra.rs new file mode 100644 index 0000000000000..11e61dd2744b6 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/overwrite/sierra.rs @@ -0,0 +1,20 @@ +//@ aux-build:tango.rs +//@ build-aux-docs +//@ doc-flags:--merge=shared +//@ doc-flags:--enable-index-page +//@ doc-flags:-Zunstable-options + +//@ 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' + +// since tango is documented with --merge=finalize, we overwrite q's +// cross-crate information +extern crate tango; +pub struct Sierra; +impl tango::Tango for Sierra {} diff --git a/tests/rustdoc/cross-crate-info/proc-macro-link-separate/auxiliary/charlie.rs b/tests/rustdoc/cross-crate-info/proc-macro-link-separate/auxiliary/charlie.rs new file mode 100644 index 0000000000000..79f1722787238 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/proc-macro-link-separate/auxiliary/charlie.rs @@ -0,0 +1,5 @@ +//@ unique-doc-out-dir +//@ doc-flags:--enable-index-page +//@ doc-flags:-Zunstable-options + +pub const CHARLIE: &'static str = "const"; diff --git a/tests/rustdoc/cross-crate-info/proc-macro-link-separate/march.rs b/tests/rustdoc/cross-crate-info/proc-macro-link-separate/march.rs new file mode 100644 index 0000000000000..c3a72849e70a9 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/proc-macro-link-separate/march.rs @@ -0,0 +1,28 @@ +//@ aux-build:charlie.rs +//@ build-aux-docs +//@ force-host +//@ no-prefer-dynamic +//@ doc-flags:--enable-index-page +//@ doc-flags:--crate-type=proc-macro +//@ doc-flags:--extern=proc_macro +//@ doc-flags:-Zunstable-options + +//@ has index.html +//@ has index.html '//h1' 'List of all crates' +//@ !has index.html '//ul[@class="all-items"]//a[@href="charlie/index.html"]' 'charlie' +//@ !has charlie/constant.CHARLIE.html +//@ !hasraw search-index.js 'CHARLIE' +//@ has index.html '//ul[@class="all-items"]//a[@href="march/index.html"]' 'march' +//@ has march/macro.make_constant.html +//@ hasraw search-index.js 'make_constant' + +// checks that we can build a proc macro that uses another crate. Use +// separate out dirs as we are not testing merging. +#![crate_type = "proc-macro"] +extern crate charlie; +extern crate proc_macro; +use proc_macro::TokenStream; +#[proc_macro] +pub fn make_constant(_item: TokenStream) -> TokenStream { + format!("pub {} NOVEMBER: () = ();", charlie::CHARLIE).parse().unwrap() +} diff --git a/tests/rustdoc/cross-crate-info/proc-macro-link/auxiliary/charlie.rs b/tests/rustdoc/cross-crate-info/proc-macro-link/auxiliary/charlie.rs new file mode 100644 index 0000000000000..048d2335fae29 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/proc-macro-link/auxiliary/charlie.rs @@ -0,0 +1,4 @@ +//@ doc-flags:--enable-index-page +//@ doc-flags:-Zunstable-options + +pub const CHARLIE: &'static str = "const"; diff --git a/tests/rustdoc/cross-crate-info/proc-macro-link/march.rs b/tests/rustdoc/cross-crate-info/proc-macro-link/march.rs new file mode 100644 index 0000000000000..4cc2da53c3c7d --- /dev/null +++ b/tests/rustdoc/cross-crate-info/proc-macro-link/march.rs @@ -0,0 +1,27 @@ +//@ aux-build:charlie.rs +//@ build-aux-docs +//@ force-host +//@ no-prefer-dynamic +//@ doc-flags:--enable-index-page +//@ doc-flags:--crate-type=proc-macro +//@ doc-flags:--extern=proc_macro +//@ doc-flags:-Zunstable-options + +//@ has index.html +//@ has index.html '//h1' 'List of all crates' +//@ has index.html '//ul[@class="all-items"]//a[@href="charlie/index.html"]' 'charlie' +//@ has charlie/constant.CHARLIE.html +//@ hasraw search-index.js 'CHARLIE' +//@ has index.html '//ul[@class="all-items"]//a[@href="march/index.html"]' 'march' +//@ has march/macro.make_constant.html +//@ hasraw search-index.js 'make_constant' + +// checks that we can build a proc macro that use another crate +#![crate_type = "proc-macro"] +extern crate charlie; +extern crate proc_macro; +use proc_macro::TokenStream; +#[proc_macro] +pub fn make_constant(_item: TokenStream) -> TokenStream { + format!("pub {} NOVEMBER: () = ();", charlie::CHARLIE).parse().unwrap() +} diff --git a/tests/rustdoc/cross-crate-info/proc-macro-use/auxiliary/charlie.rs b/tests/rustdoc/cross-crate-info/proc-macro-use/auxiliary/charlie.rs new file mode 100644 index 0000000000000..79f1722787238 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/proc-macro-use/auxiliary/charlie.rs @@ -0,0 +1,5 @@ +//@ unique-doc-out-dir +//@ doc-flags:--enable-index-page +//@ doc-flags:-Zunstable-options + +pub const CHARLIE: &'static str = "const"; diff --git a/tests/rustdoc/cross-crate-info/proc-macro-use/auxiliary/march.rs b/tests/rustdoc/cross-crate-info/proc-macro-use/auxiliary/march.rs new file mode 100644 index 0000000000000..b2fc666c8b2b9 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/proc-macro-use/auxiliary/march.rs @@ -0,0 +1,18 @@ +//@ aux-build:charlie.rs +//@ build-aux-docs +//@ force-host +//@ no-prefer-dynamic +//@ unique-doc-out-dir +//@ doc-flags:--enable-index-page +//@ doc-flags:--crate-type=proc-macro +//@ doc-flags:--extern=proc_macro +//@ doc-flags:-Zunstable-options + +#![crate_type = "proc-macro"] +extern crate charlie; +extern crate proc_macro; +use proc_macro::TokenStream; +#[proc_macro] +pub fn make_constant(_item: TokenStream) -> TokenStream { + format!("pub {} NOVEMBER: () = ();", charlie::CHARLIE).parse().unwrap() +} diff --git a/tests/rustdoc/cross-crate-info/proc-macro-use/november.rs b/tests/rustdoc/cross-crate-info/proc-macro-use/november.rs new file mode 100644 index 0000000000000..5dd372c5800bc --- /dev/null +++ b/tests/rustdoc/cross-crate-info/proc-macro-use/november.rs @@ -0,0 +1,19 @@ +//@ aux-build:march.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="charlie/index.html"]' 'charlie' +//@ !has charlie/constant.CHARLIE.html +//@ !hasraw search-index.js 'CHARLIE' +//@ !has index.html '//ul[@class="all-items"]//a[@href="march/index.html"]' 'march' +//@ !has march/macro.make_constant.html +//@ !hasraw search-index.js 'make_constant' +//@ has index.html '//ul[@class="all-items"]//a[@href="november/index.html"]' 'november' +//@ !has november/constant.NOVEMBER.html + +// checks that we can build a proc macro that use another crate, with a +// separate out dir +extern crate march; diff --git a/tests/rustdoc/cross-crate-info/single-crate-baseline/q.rs b/tests/rustdoc/cross-crate-info/single-crate-baseline/quebec.rs similarity index 65% rename from tests/rustdoc/cross-crate-info/single-crate-baseline/q.rs rename to tests/rustdoc/cross-crate-info/single-crate-baseline/quebec.rs index c5e3dc0a0f4e5..54688769567b0 100644 --- a/tests/rustdoc/cross-crate-info/single-crate-baseline/q.rs +++ b/tests/rustdoc/cross-crate-info/single-crate-baseline/quebec.rs @@ -1,11 +1,10 @@ -//@ 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 q/struct.Quebec.html +//@ has index.html '//ul[@class="all-items"]//a[@href="quebec/index.html"]' 'quebec' +//@ has quebec/struct.Quebec.html //@ hasraw search-index.js 'Quebec' // there's nothing cross-crate going on here diff --git a/tests/rustdoc/cross-crate-info/single-crate-constant/charlie.rs b/tests/rustdoc/cross-crate-info/single-crate-constant/charlie.rs new file mode 100644 index 0000000000000..d6d72b7ebb268 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/single-crate-constant/charlie.rs @@ -0,0 +1,11 @@ +//@ 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="charlie/index.html"]' 'charlie' +//@ has charlie/constant.CHARLIE.html +//@ hasraw search-index.js 'CHARLIE' + +// check that the constant appears in the docs +pub const CHARLIE: &'static str = "const"; diff --git a/tests/rustdoc/cross-crate-info/single-crate-finalize/quebec.rs b/tests/rustdoc/cross-crate-info/single-crate-finalize/quebec.rs new file mode 100644 index 0000000000000..09bb78c06f1c2 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/single-crate-finalize/quebec.rs @@ -0,0 +1,13 @@ +//@ doc-flags:--merge=finalize +//@ 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 quebec/struct.Quebec.html +//@ hasraw search-index.js 'Quebec' + +// there is nothing to read from the output directory if we use a single +// crate +pub struct Quebec; diff --git a/tests/rustdoc/cross-crate-info/single-crate-no-index/q.rs b/tests/rustdoc/cross-crate-info/single-crate-no-index/quebec.rs similarity index 67% rename from tests/rustdoc/cross-crate-info/single-crate-no-index/q.rs rename to tests/rustdoc/cross-crate-info/single-crate-no-index/quebec.rs index d3e71fa0ce35f..7a88d4995cacc 100644 --- a/tests/rustdoc/cross-crate-info/single-crate-no-index/q.rs +++ b/tests/rustdoc/cross-crate-info/single-crate-no-index/quebec.rs @@ -1,5 +1,4 @@ -//@ build-aux-docs -//@ has q/struct.Quebec.html +//@ has quebec/struct.Quebec.html //@ hasraw search-index.js 'Quebec' // there's nothing cross-crate going on here diff --git a/tests/rustdoc/cross-crate-info/single-crate-read-write/quebec.rs b/tests/rustdoc/cross-crate-info/single-crate-read-write/quebec.rs new file mode 100644 index 0000000000000..72475426f6edd --- /dev/null +++ b/tests/rustdoc/cross-crate-info/single-crate-read-write/quebec.rs @@ -0,0 +1,12 @@ +//@ 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 quebec/struct.Quebec.html +//@ hasraw search-index.js 'Quebec' + +// read-write is the default and this does the same as `single-crate` +pub struct Quebec; diff --git a/tests/rustdoc/cross-crate-info/single-crate-write-anyway/quebec.rs b/tests/rustdoc/cross-crate-info/single-crate-write-anyway/quebec.rs new file mode 100644 index 0000000000000..b20e173a8307e --- /dev/null +++ b/tests/rustdoc/cross-crate-info/single-crate-write-anyway/quebec.rs @@ -0,0 +1,13 @@ +//@ doc-flags:--parts-out-dir=info/doc.parts/quebec +//@ 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 quebec/struct.Quebec.html +//@ hasraw search-index.js 'Quebec' + +// we can --parts-out-dir, but that doesn't do anything other than create +// the file +pub struct Quebec; diff --git a/tests/rustdoc/cross-crate-info/single-merge-none-useless-write/quebec.rs b/tests/rustdoc/cross-crate-info/single-merge-none-useless-write/quebec.rs new file mode 100644 index 0000000000000..e888a43c46042 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/single-merge-none-useless-write/quebec.rs @@ -0,0 +1,11 @@ +//@ doc-flags:--merge=none +//@ doc-flags:--parts-out-dir=info/doc.parts/quebec +//@ doc-flags:--enable-index-page +//@ doc-flags:-Zunstable-options + +//@ !has index.html +//@ has quebec/struct.Quebec.html +//@ !has search-index.js + +// --merge=none doesn't write anything, despite --parts-out-dir +pub struct Quebec; diff --git a/tests/rustdoc/cross-crate-info/transitive-finalize/auxiliary/quebec.rs b/tests/rustdoc/cross-crate-info/transitive-finalize/auxiliary/quebec.rs new file mode 100644 index 0000000000000..1beca543f814f --- /dev/null +++ b/tests/rustdoc/cross-crate-info/transitive-finalize/auxiliary/quebec.rs @@ -0,0 +1,5 @@ +//@ doc-flags:--merge=finalize +//@ doc-flags:--enable-index-page +//@ doc-flags:-Zunstable-options + +pub struct Quebec; diff --git a/tests/rustdoc/cross-crate-info/transitive-finalize/auxiliary/tango.rs b/tests/rustdoc/cross-crate-info/transitive-finalize/auxiliary/tango.rs new file mode 100644 index 0000000000000..363b2d5508e63 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/transitive-finalize/auxiliary/tango.rs @@ -0,0 +1,8 @@ +//@ aux-build:quebec.rs +//@ build-aux-docs +//@ doc-flags:--merge=finalize +//@ doc-flags:--enable-index-page +//@ doc-flags:-Zunstable-options + +extern crate quebec; +pub trait Tango {} diff --git a/tests/rustdoc/cross-crate-info/transitive-finalize/sierra.rs b/tests/rustdoc/cross-crate-info/transitive-finalize/sierra.rs new file mode 100644 index 0000000000000..68fc4b13fa8f7 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/transitive-finalize/sierra.rs @@ -0,0 +1,20 @@ +//@ aux-build:tango.rs +//@ build-aux-docs +//@ doc-flags:--merge=finalize +//@ 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="sierra/index.html"]' 'sierra' +//@ has index.html '//ul[@class="all-items"]//a[@href="tango/index.html"]' 'tango' +//@ 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 'Sierra' + +// write only overwrites stuff in the output directory +extern crate tango; +pub struct Sierra; +impl tango::Tango for Sierra {} diff --git a/tests/rustdoc/cross-crate-info/transitive-merge-none/auxiliary/quebec.rs b/tests/rustdoc/cross-crate-info/transitive-merge-none/auxiliary/quebec.rs new file mode 100644 index 0000000000000..6ab921533b037 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/transitive-merge-none/auxiliary/quebec.rs @@ -0,0 +1,6 @@ +//@ 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; diff --git a/tests/rustdoc/cross-crate-info/transitive-merge-none/auxiliary/tango.rs b/tests/rustdoc/cross-crate-info/transitive-merge-none/auxiliary/tango.rs new file mode 100644 index 0000000000000..9fa99d3be8af4 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/transitive-merge-none/auxiliary/tango.rs @@ -0,0 +1,9 @@ +//@ aux-build:quebec.rs +//@ build-aux-docs +//@ 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 {} diff --git a/tests/rustdoc/cross-crate-info/transitive-merge-none/sierra.rs b/tests/rustdoc/cross-crate-info/transitive-merge-none/sierra.rs new file mode 100644 index 0000000000000..b407228085e88 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/transitive-merge-none/sierra.rs @@ -0,0 +1,27 @@ +//@ aux-build:tango.rs +//@ build-aux-docs +//@ doc-flags:--merge=finalize +//@ doc-flags:--include-parts-dir=info/doc.parts/tango +//@ doc-flags:--include-parts-dir=info/doc.parts/quebec +//@ 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' + +// We avoid writing any cross-crate information, preferring to include it +// with --include-parts-dir. +extern crate tango; +pub struct Sierra; +impl tango::Tango for Sierra {} diff --git a/tests/rustdoc/cross-crate-info/transitive-merge-read-write/auxiliary/quebec.rs b/tests/rustdoc/cross-crate-info/transitive-merge-read-write/auxiliary/quebec.rs new file mode 100644 index 0000000000000..1beca543f814f --- /dev/null +++ b/tests/rustdoc/cross-crate-info/transitive-merge-read-write/auxiliary/quebec.rs @@ -0,0 +1,5 @@ +//@ doc-flags:--merge=finalize +//@ doc-flags:--enable-index-page +//@ doc-flags:-Zunstable-options + +pub struct Quebec; diff --git a/tests/rustdoc/cross-crate-info/transitive-merge-read-write/auxiliary/tango.rs b/tests/rustdoc/cross-crate-info/transitive-merge-read-write/auxiliary/tango.rs new file mode 100644 index 0000000000000..ff12fe98d82c2 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/transitive-merge-read-write/auxiliary/tango.rs @@ -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 {} diff --git a/tests/rustdoc/cross-crate-info/transitive-merge-read-write/sierra.rs b/tests/rustdoc/cross-crate-info/transitive-merge-read-write/sierra.rs new file mode 100644 index 0000000000000..15e32d5941fb2 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/transitive-merge-read-write/sierra.rs @@ -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' + +// We can use read-write to emulate the default behavior of rustdoc, when +// --merge is left out. +extern crate tango; +pub struct Sierra; +impl tango::Tango for Sierra {} diff --git a/tests/rustdoc/cross-crate-info/transitive-no-info/auxiliary/quebec.rs b/tests/rustdoc/cross-crate-info/transitive-no-info/auxiliary/quebec.rs new file mode 100644 index 0000000000000..0e28d8e646647 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/transitive-no-info/auxiliary/quebec.rs @@ -0,0 +1,5 @@ +//@ doc-flags:--merge=none +//@ doc-flags:--enable-index-page +//@ doc-flags:-Zunstable-options + +pub struct Quebec; diff --git a/tests/rustdoc/cross-crate-info/transitive-no-info/auxiliary/tango.rs b/tests/rustdoc/cross-crate-info/transitive-no-info/auxiliary/tango.rs new file mode 100644 index 0000000000000..3827119f696f5 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/transitive-no-info/auxiliary/tango.rs @@ -0,0 +1,8 @@ +//@ aux-build:quebec.rs +//@ build-aux-docs +//@ doc-flags:--merge=none +//@ doc-flags:--enable-index-page +//@ doc-flags:-Zunstable-options + +extern crate quebec; +pub trait Tango {} diff --git a/tests/rustdoc/cross-crate-info/transitive-no-info/sierra.rs b/tests/rustdoc/cross-crate-info/transitive-no-info/sierra.rs new file mode 100644 index 0000000000000..3eb2cebd74363 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/transitive-no-info/sierra.rs @@ -0,0 +1,17 @@ +//@ aux-build:tango.rs +//@ build-aux-docs +//@ doc-flags:--merge=none +//@ doc-flags:--enable-index-page +//@ doc-flags:-Zunstable-options + +//@ !has index.html +//@ has sierra/struct.Sierra.html +//@ has tango/trait.Tango.html +//@ hasraw sierra/struct.Sierra.html 'Tango' +//@ !has trait.impl/tango/trait.Tango.js +//@ !has search-index.js + +// --merge=none on all crates does not generate any cross-crate info +extern crate tango; +pub struct Sierra; +impl tango::Tango for Sierra {} diff --git a/tests/rustdoc/cross-crate-info/transitive/auxiliary/q.rs b/tests/rustdoc/cross-crate-info/transitive/auxiliary/q.rs deleted file mode 100644 index 5d0881029cb2f..0000000000000 --- a/tests/rustdoc/cross-crate-info/transitive/auxiliary/q.rs +++ /dev/null @@ -1,2 +0,0 @@ -//@ build-aux-docs -pub struct Quebec; diff --git a/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/q.rs b/tests/rustdoc/cross-crate-info/transitive/auxiliary/quebec.rs similarity index 50% rename from tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/q.rs rename to tests/rustdoc/cross-crate-info/transitive/auxiliary/quebec.rs index 5d0881029cb2f..3ef377298cc6e 100644 --- a/tests/rustdoc/cross-crate-info/cargo-transitive-no-index/auxiliary/q.rs +++ b/tests/rustdoc/cross-crate-info/transitive/auxiliary/quebec.rs @@ -1,2 +1 @@ -//@ build-aux-docs pub struct Quebec; diff --git a/tests/rustdoc/cross-crate-info/transitive/auxiliary/t.rs b/tests/rustdoc/cross-crate-info/transitive/auxiliary/t.rs deleted file mode 100644 index fab9ec4a92b96..0000000000000 --- a/tests/rustdoc/cross-crate-info/transitive/auxiliary/t.rs +++ /dev/null @@ -1,4 +0,0 @@ -//@ aux-build:q.rs -//@ build-aux-docs -extern crate q; -pub trait Tango {} diff --git a/tests/rustdoc/cross-crate-info/transitive/auxiliary/tango.rs b/tests/rustdoc/cross-crate-info/transitive/auxiliary/tango.rs new file mode 100644 index 0000000000000..a1b08c07cd302 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/transitive/auxiliary/tango.rs @@ -0,0 +1,4 @@ +//@ aux-build:quebec.rs +//@ build-aux-docs +extern crate quebec; +pub trait Tango {} diff --git a/tests/rustdoc/cross-crate-info/transitive/s.rs b/tests/rustdoc/cross-crate-info/transitive/s.rs deleted file mode 100644 index 0a4e5f646ddaa..0000000000000 --- a/tests/rustdoc/cross-crate-info/transitive/s.rs +++ /dev/null @@ -1,6 +0,0 @@ -//@ aux-build:t.rs -//@ build-aux-docs -// simple test to see if we support building transitive crates -extern crate t; -pub struct Sierra; -impl t::Tango for Sierra {} diff --git a/tests/rustdoc/cross-crate-info/transitive/sierra.rs b/tests/rustdoc/cross-crate-info/transitive/sierra.rs new file mode 100644 index 0000000000000..32f83702e158c --- /dev/null +++ b/tests/rustdoc/cross-crate-info/transitive/sierra.rs @@ -0,0 +1,6 @@ +//@ aux-build:tango.rs +//@ build-aux-docs +// simple test to see if we support building crates with transitive deps +extern crate tango; +pub struct Sierra; +impl tango::Tango for Sierra {} diff --git a/tests/rustdoc/cross-crate-info/two-separate-out-dir/auxiliary/foxtrot.rs b/tests/rustdoc/cross-crate-info/two-separate-out-dir/auxiliary/foxtrot.rs new file mode 100644 index 0000000000000..e492b700dbc2b --- /dev/null +++ b/tests/rustdoc/cross-crate-info/two-separate-out-dir/auxiliary/foxtrot.rs @@ -0,0 +1,5 @@ +//@ unique-doc-out-dir +//@ doc-flags:--parts-out-dir=info/doc.parts/foxtrot +//@ doc-flags:-Zunstable-options + +pub trait Foxtrot {} diff --git a/tests/rustdoc/cross-crate-info/two-separate-out-dir/echo.rs b/tests/rustdoc/cross-crate-info/two-separate-out-dir/echo.rs new file mode 100644 index 0000000000000..ee2b646e43cda --- /dev/null +++ b/tests/rustdoc/cross-crate-info/two-separate-out-dir/echo.rs @@ -0,0 +1,16 @@ +//@ aux-build:foxtrot.rs +//@ build-aux-docs +//@ doc-flags:--include-parts-dir=info/doc.parts/foxtrot +//@ doc-flags:-Zunstable-options + +//@ has echo/enum.Echo.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 different places, and merge their docs after +// they are generated +extern crate foxtrot; +pub enum Echo {} +impl foxtrot::Foxtrot for Echo {} diff --git a/tests/rustdoc/cross-crate-info/two/auxiliary/f.rs b/tests/rustdoc/cross-crate-info/two/auxiliary/foxtrot.rs similarity index 52% rename from tests/rustdoc/cross-crate-info/two/auxiliary/f.rs rename to tests/rustdoc/cross-crate-info/two/auxiliary/foxtrot.rs index abc580a388cd2..390cef74d4730 100644 --- a/tests/rustdoc/cross-crate-info/two/auxiliary/f.rs +++ b/tests/rustdoc/cross-crate-info/two/auxiliary/foxtrot.rs @@ -1,2 +1 @@ -//@ build-aux-docs pub trait Foxtrot {} diff --git a/tests/rustdoc/cross-crate-info/two/e.rs b/tests/rustdoc/cross-crate-info/two/echo.rs similarity index 54% rename from tests/rustdoc/cross-crate-info/two/e.rs rename to tests/rustdoc/cross-crate-info/two/echo.rs index 9665af62706d1..66c9440c51d70 100644 --- a/tests/rustdoc/cross-crate-info/two/e.rs +++ b/tests/rustdoc/cross-crate-info/two/echo.rs @@ -1,6 +1,6 @@ -//@ aux-build:f.rs +//@ aux-build:foxtrot.rs //@ build-aux-docs // simple test to assert that we can do a two-level aux-build -extern crate f; +extern crate foxtrot; pub enum Echo {} -impl f::Foxtrot for Echo {} +impl foxtrot::Foxtrot for Echo {} diff --git a/tests/rustdoc/cross-crate-info/working-dir-examples/q.rs b/tests/rustdoc/cross-crate-info/working-dir-examples/q.rs deleted file mode 100644 index a7ab062fd9e28..0000000000000 --- a/tests/rustdoc/cross-crate-info/working-dir-examples/q.rs +++ /dev/null @@ -1,10 +0,0 @@ -//@ build-aux-docs -//@ doc-flags:--scrape-examples-output-path=examples -//@ doc-flags:--scrape-examples-target-crate=q -//@ doc-flags:-Zunstable-options - -//@ has examples - -// where will --scrape-examples-output-path resolve the path to be? -// should be the root output directory -pub struct Quebec; diff --git a/tests/rustdoc/cross-crate-info/working-dir-examples/quebec.rs b/tests/rustdoc/cross-crate-info/working-dir-examples/quebec.rs new file mode 100644 index 0000000000000..d408fb2a1d6be --- /dev/null +++ b/tests/rustdoc/cross-crate-info/working-dir-examples/quebec.rs @@ -0,0 +1,9 @@ +//@ doc-flags:--scrape-examples-output-path=examples +//@ doc-flags:--scrape-examples-target-crate=quebec +//@ doc-flags:-Zunstable-options + +//@ has examples + +// checks to make sure that --scrape-examples-output-path resolves to the +// correct directory +pub struct Quebec; diff --git a/tests/rustdoc/cross-crate-info/write-docs-somewhere-else/auxiliary/f.rs b/tests/rustdoc/cross-crate-info/write-docs-somewhere-else/auxiliary/foxtrot.rs similarity index 69% rename from tests/rustdoc/cross-crate-info/write-docs-somewhere-else/auxiliary/f.rs rename to tests/rustdoc/cross-crate-info/write-docs-somewhere-else/auxiliary/foxtrot.rs index f8c9adcaf9cad..6d7c1f77dca76 100644 --- a/tests/rustdoc/cross-crate-info/write-docs-somewhere-else/auxiliary/f.rs +++ b/tests/rustdoc/cross-crate-info/write-docs-somewhere-else/auxiliary/foxtrot.rs @@ -1,3 +1,2 @@ -//@ build-aux-docs //@ unique-doc-out-dir pub trait Foxtrot {} diff --git a/tests/rustdoc/cross-crate-info/write-docs-somewhere-else/e.rs b/tests/rustdoc/cross-crate-info/write-docs-somewhere-else/e.rs deleted file mode 100644 index 9dcec211e1787..0000000000000 --- a/tests/rustdoc/cross-crate-info/write-docs-somewhere-else/e.rs +++ /dev/null @@ -1,14 +0,0 @@ -//@ 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' - -// test the fact that our test runner will document this crate somewhere -// else -extern crate f; -pub enum Echo {} -impl f::Foxtrot for Echo {} diff --git a/tests/rustdoc/cross-crate-info/write-docs-somewhere-else/echo.rs b/tests/rustdoc/cross-crate-info/write-docs-somewhere-else/echo.rs new file mode 100644 index 0000000000000..261949d745625 --- /dev/null +++ b/tests/rustdoc/cross-crate-info/write-docs-somewhere-else/echo.rs @@ -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' + +// test the fact that our test runner will document this crate somewhere +// else +extern crate foxtrot; +pub enum Echo {} +impl foxtrot::Foxtrot for Echo {}