Skip to content

Commit dc024fe

Browse files
committed
ordering and wrapping cross-crate-info tests
1 parent 2395a76 commit dc024fe

File tree

11 files changed

+66
-60
lines changed
  • src/tools/compiletest/src
  • tests/rustdoc/cross-crate-info
    • cargo-transitive
    • cargo-transitive-no-index
    • cargo-two
    • cargo-two-no-index
    • index-on-last
    • kitchen-sink
    • single-crate-baseline
    • single-crate-no-index
    • working-dir-examples
    • write-docs-somewhere-else

11 files changed

+66
-60
lines changed

src/tools/compiletest/src/command-list.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
99
"aux-codegen-backend",
1010
"aux-crate",
1111
"build-aux-docs",
12-
"unique-doc-out-dir",
1312
"build-fail",
1413
"build-pass",
1514
"check-fail",
@@ -226,6 +225,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
226225
"should-ice",
227226
"stderr-per-bitwidth",
228227
"test-mir-pass",
228+
"unique-doc-out-dir",
229229
"unset-exec-env",
230230
"unset-rustc-env",
231231
// Used by the tidy check `unknown_revision`.

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

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
//@ aux-build:t.rs
22
//@ build-aux-docs
33

4+
//@ has q/struct.Quebec.html
5+
//@ has s/struct.Sierra.html
46
//@ has t/trait.Tango.html
5-
//@ hasraw search-index.js 'Quebec'
6-
//@ hasraw trait.impl/t/trait.Tango.js 'struct.Sierra.html'
77
//@ hasraw s/struct.Sierra.html 'Tango'
8-
//@ hasraw search-index.js 'Sierra'
8+
//@ hasraw trait.impl/t/trait.Tango.js 'struct.Sierra.html'
99
//@ hasraw search-index.js 'Tango'
10-
//@ has q/struct.Quebec.html
11-
//@ has s/struct.Sierra.html
10+
//@ hasraw search-index.js 'Sierra'
11+
//@ hasraw search-index.js 'Quebec'
1212

13-
// We document multiple crates into the same output directory, which merges the cross-crate information. Everything is available.
13+
// We document multiple crates into the same output directory, which
14+
// merges the cross-crate information. Everything is available.
1415

1516
extern crate t;
1617
pub struct Sierra;

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

+11-10
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,22 @@
33
//@ doc-flags:--enable-index-page
44
//@ doc-flags:-Zunstable-options
55

6-
//@ has t/trait.Tango.html
7-
//@ hasraw search-index.js 'Quebec'
8-
//@ has index.html '//ul[@class="all-items"]//a[@href="q/index.html"]' 'q'
9-
//@ hasraw s/struct.Sierra.html 'Tango'
10-
//@ hasraw trait.impl/t/trait.Tango.js 'struct.Sierra.html'
11-
//@ has index.html '//ul[@class="all-items"]//a[@href="t/index.html"]' 't'
6+
//@ has index.html
127
//@ has index.html '//h1' 'List of all crates'
8+
//@ has index.html '//ul[@class="all-items"]//a[@href="q/index.html"]' 'q'
139
//@ has index.html '//ul[@class="all-items"]//a[@href="s/index.html"]' 's'
14-
//@ hasraw search-index.js 'Sierra'
15-
//@ hasraw search-index.js 'Tango'
16-
//@ has index.html
10+
//@ has index.html '//ul[@class="all-items"]//a[@href="t/index.html"]' 't'
1711
//@ has q/struct.Quebec.html
1812
//@ has s/struct.Sierra.html
13+
//@ has t/trait.Tango.html
14+
//@ hasraw s/struct.Sierra.html 'Tango'
15+
//@ hasraw trait.impl/t/trait.Tango.js 'struct.Sierra.html'
16+
//@ hasraw search-index.js 'Tango'
17+
//@ hasraw search-index.js 'Sierra'
18+
//@ hasraw search-index.js 'Quebec'
1919

20-
// We document multiple crates into the same output directory, which merges the cross-crate information. Everything is available.
20+
// We document multiple crates into the same output directory, which
21+
// merges the cross-crate information. Everything is available.
2122

2223
extern crate t;
2324
pub struct Sierra;

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

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
//@ aux-build:f.rs
22
//@ build-aux-docs
33

4-
//@ hasraw search-index.js 'Echo'
5-
//@ hasraw search-index.js 'Foxtrot'
6-
//@ hasraw trait.impl/f/trait.Foxtrot.js 'enum.Echo.html'
7-
//@ has f/trait.Foxtrot.html
84
//@ has e/enum.Echo.html
5+
//@ has f/trait.Foxtrot.html
96
//@ hasraw e/enum.Echo.html 'Foxtrot'
7+
//@ hasraw trait.impl/f/trait.Foxtrot.js 'enum.Echo.html'
8+
//@ hasraw search-index.js 'Foxtrot'
9+
//@ hasraw search-index.js 'Echo'
1010

11-
// document two crates in the same way that cargo does. do not provide --enable-index-page
11+
// document two crates in the same way that cargo does. do not provide
12+
// --enable-index-page
1213

1314
extern crate f;
1415
pub enum Echo {}

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

+9-8
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,19 @@
33
//@ doc-flags:--enable-index-page
44
//@ doc-flags:-Zunstable-options
55

6-
//@ hasraw search-index.js 'Echo'
7-
//@ hasraw search-index.js 'Foxtrot'
8-
//@ has index.html '//ul[@class="all-items"]//a[@href="e/index.html"]' 'e'
9-
//@ has index.html '//ul[@class="all-items"]//a[@href="f/index.html"]' 'f'
10-
//@ hasraw trait.impl/f/trait.Foxtrot.js 'enum.Echo.html'
11-
//@ has f/trait.Foxtrot.html
6+
//@ has index.html
127
//@ has index.html '//h1' 'List of all crates'
8+
//@ has index.html '//ul[@class="all-items"]//a[@href="f/index.html"]' 'f'
9+
//@ has index.html '//ul[@class="all-items"]//a[@href="e/index.html"]' 'e'
1310
//@ has e/enum.Echo.html
14-
//@ has index.html
11+
//@ has f/trait.Foxtrot.html
1512
//@ hasraw e/enum.Echo.html 'Foxtrot'
13+
//@ hasraw trait.impl/f/trait.Foxtrot.js 'enum.Echo.html'
14+
//@ hasraw search-index.js 'Foxtrot'
15+
//@ hasraw search-index.js 'Echo'
1616

17-
// document two crates in the same way that cargo does, writing them both into the same output directory
17+
// document two crates in the same way that cargo does, writing them both
18+
// into the same output directory
1819

1920
extern crate f;
2021
pub enum Echo {}

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

+7-7
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
//@ doc-flags:--enable-index-page
44
//@ doc-flags:-Zunstable-options
55

6-
//@ hasraw search-index.js 'Echo'
7-
//@ hasraw search-index.js 'Foxtrot'
8-
//@ has index.html '//ul[@class="all-items"]//a[@href="e/index.html"]' 'e'
9-
//@ has index.html '//ul[@class="all-items"]//a[@href="f/index.html"]' 'f'
10-
//@ hasraw trait.impl/f/trait.Foxtrot.js 'enum.Echo.html'
11-
//@ has f/trait.Foxtrot.html
6+
//@ has index.html
127
//@ has index.html '//h1' 'List of all crates'
8+
//@ has index.html '//ul[@class="all-items"]//a[@href="f/index.html"]' 'f'
9+
//@ has index.html '//ul[@class="all-items"]//a[@href="e/index.html"]' 'e'
1310
//@ has e/enum.Echo.html
14-
//@ has index.html
11+
//@ has f/trait.Foxtrot.html
1512
//@ hasraw e/enum.Echo.html 'Foxtrot'
13+
//@ hasraw trait.impl/f/trait.Foxtrot.js 'enum.Echo.html'
14+
//@ hasraw search-index.js 'Foxtrot'
15+
//@ hasraw search-index.js 'Echo'
1616

1717
// only declare --enable-index-page to the last rustdoc invocation
1818

tests/rustdoc/cross-crate-info/kitchen-sink/i.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
//@ aux-build:q.rs
22
//@ aux-build:r.rs
3-
//@ aux-build:t.rs
43
//@ aux-build:s.rs
4+
//@ aux-build:t.rs
55
//@ build-aux-docs
66
//@ doc-flags:--enable-index-page
77
//@ doc-flags:-Zunstable-options
88

9-
//@ hasraw search-index.js 'Quebec'
10-
//@ hasraw search-index.js 'Sierra'
9+
//@ has index.html '//h1' 'List of all crates'
1110
//@ has index.html
12-
//@ has s/struct.Sierra.html
13-
//@ hasraw s/struct.Sierra.html 'Tango'
1411
//@ has index.html '//ul[@class="all-items"]//a[@href="i/index.html"]' 'i'
15-
//@ has q/struct.Quebec.html
16-
//@ has type.impl/s/struct.Sierra.js
17-
//@ hasraw type.impl/s/struct.Sierra.js 'Romeo'
18-
//@ hasraw type.impl/s/struct.Sierra.js 'Tango'
1912
//@ has index.html '//ul[@class="all-items"]//a[@href="q/index.html"]' 'q'
20-
//@ has index.html '//ul[@class="all-items"]//a[@href="t/index.html"]' 't'
13+
//@ has index.html '//ul[@class="all-items"]//a[@href="r/index.html"]' 'r'
2114
//@ has index.html '//ul[@class="all-items"]//a[@href="s/index.html"]' 's'
15+
//@ has index.html '//ul[@class="all-items"]//a[@href="t/index.html"]' 't'
16+
//@ has q/struct.Quebec.html
2217
//@ has r/type.Romeo.html
18+
//@ has s/struct.Sierra.html
2319
//@ has t/trait.Tango.html
24-
//@ hasraw search-index.js 'Romeo'
20+
//@ hasraw s/struct.Sierra.html 'Tango'
2521
//@ hasraw trait.impl/t/trait.Tango.js 'struct.Sierra.html'
26-
//@ has index.html '//h1' 'List of all crates'
22+
//@ hasraw search-index.js 'Quebec'
23+
//@ hasraw search-index.js 'Romeo'
24+
//@ hasraw search-index.js 'Sierra'
2725
//@ hasraw search-index.js 'Tango'
28-
//@ has index.html '//ul[@class="all-items"]//a[@href="r/index.html"]' 'r'
26+
//@ has type.impl/s/struct.Sierra.js
27+
//@ hasraw type.impl/s/struct.Sierra.js 'Tango'
28+
//@ hasraw type.impl/s/struct.Sierra.js 'Romeo'
2929

3030
// document everything in the default mode
3131

tests/rustdoc/cross-crate-info/single-crate-baseline/q.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
//@ doc-flags:--enable-index-page
33
//@ doc-flags:-Zunstable-options
44

5-
//@ hasraw search-index.js 'Quebec'
6-
//@ has index.html '//ul[@class="all-items"]//a[@href="q/index.html"]' 'q'
7-
//@ has index.html '//h1' 'List of all crates'
85
//@ has index.html
6+
//@ has index.html '//h1' 'List of all crates'
7+
//@ has index.html '//ul[@class="all-items"]//a[@href="q/index.html"]' 'q'
98
//@ has q/struct.Quebec.html
9+
//@ hasraw search-index.js 'Quebec'
1010

1111
// there's nothing cross-crate going on here
1212

tests/rustdoc/cross-crate-info/single-crate-no-index/q.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ build-aux-docs
22

3-
//@ hasraw search-index.js 'Quebec'
43
//@ has q/struct.Quebec.html
4+
//@ hasraw search-index.js 'Quebec'
55

66
// there's nothing cross-crate going on here
77

tests/rustdoc/cross-crate-info/working-dir-examples/q.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
//@ has examples
77

8-
// where will --scrape-examples-output-path resolve the path to be? should be the root output directory
8+
// where will --scrape-examples-output-path resolve the path to be?
9+
// should be the root output directory
910

1011
pub struct Quebec;

tests/rustdoc/cross-crate-info/write-docs-somewhere-else/e.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
//@ aux-build:f.rs
22
//@ build-aux-docs
33

4-
//@ hasraw search-index.js 'Echo'
5-
//@ !hasraw search-index.js 'Foxtrot'
6-
//@ hasraw trait.impl/f/trait.Foxtrot.js 'enum.Echo.html'
7-
//@ !has f/trait.Foxtrot.html
84
//@ has e/enum.Echo.html
5+
//@ !has f/trait.Foxtrot.html
96
//@ hasraw e/enum.Echo.html 'Foxtrot'
7+
//@ hasraw trait.impl/f/trait.Foxtrot.js 'enum.Echo.html'
8+
//@ !hasraw search-index.js 'Foxtrot'
9+
//@ hasraw search-index.js 'Echo'
1010

11-
// test the fact that our test runner will document this crate somewhere else
11+
// test the fact that our test runner will document this crate somewhere
12+
// else
1213

1314
extern crate f;
1415
pub enum Echo {}

0 commit comments

Comments
 (0)