1
- use crate :: support:: { basic_manifest, project} ;
1
+ use crate :: support:: { basic_manifest, is_nightly , project} ;
2
2
3
3
#[ cargo_test]
4
4
fn rustdoc_simple ( ) {
@@ -8,7 +8,7 @@ fn rustdoc_simple() {
8
8
. with_stderr (
9
9
"\
10
10
[DOCUMENTING] foo v0.0.1 ([CWD])
11
- [RUNNING] `rustdoc --crate-name foo src/lib.rs [..]\
11
+ [RUNNING] `rustdoc [..] --crate-name foo src/lib.rs [..]\
12
12
-o [CWD]/target/doc \
13
13
[..] \
14
14
-L dependency=[CWD]/target/debug/deps`
@@ -26,7 +26,7 @@ fn rustdoc_args() {
26
26
. with_stderr (
27
27
"\
28
28
[DOCUMENTING] foo v0.0.1 ([CWD])
29
- [RUNNING] `rustdoc --crate-name foo src/lib.rs [..]\
29
+ [RUNNING] `rustdoc [..] --crate-name foo src/lib.rs [..]\
30
30
-o [CWD]/target/doc \
31
31
[..] \
32
32
--cfg=foo \
@@ -66,7 +66,7 @@ fn rustdoc_foo_with_bar_dependency() {
66
66
[CHECKING] bar v0.0.1 ([..])
67
67
[RUNNING] `rustc [..]bar/src/lib.rs [..]`
68
68
[DOCUMENTING] foo v0.0.1 ([CWD])
69
- [RUNNING] `rustdoc --crate-name foo src/lib.rs [..]\
69
+ [RUNNING] `rustdoc [..] --crate-name foo src/lib.rs [..]\
70
70
-o [CWD]/target/doc \
71
71
[..] \
72
72
--cfg=foo \
@@ -105,7 +105,7 @@ fn rustdoc_only_bar_dependency() {
105
105
. with_stderr (
106
106
"\
107
107
[DOCUMENTING] bar v0.0.1 ([..])
108
- [RUNNING] `rustdoc --crate-name bar [..]bar/src/lib.rs [..]\
108
+ [RUNNING] `rustdoc [..] --crate-name bar [..]bar/src/lib.rs [..]\
109
109
-o [CWD]/target/doc \
110
110
[..] \
111
111
--cfg=foo \
@@ -127,7 +127,7 @@ fn rustdoc_same_name_documents_lib() {
127
127
. with_stderr (
128
128
"\
129
129
[DOCUMENTING] foo v0.0.1 ([..])
130
- [RUNNING] `rustdoc --crate-name foo src/lib.rs [..]\
130
+ [RUNNING] `rustdoc [..] --crate-name foo src/lib.rs [..]\
131
131
-o [CWD]/target/doc \
132
132
[..] \
133
133
--cfg=foo \
@@ -161,6 +161,39 @@ fn features() {
161
161
. run ( ) ;
162
162
}
163
163
164
+ #[ cargo_test]
165
+ fn proc_macro_crate_type ( ) {
166
+ // NOTE - Remove this once 'rustdoc --crate-type'
167
+ // rides to stable
168
+ if !is_nightly ( ) {
169
+ return ;
170
+ }
171
+ let p = project ( )
172
+ . file (
173
+ "Cargo.toml" ,
174
+ r#"
175
+ [package]
176
+ name = "foo"
177
+ version = "0.0.1"
178
+ authors = []
179
+
180
+ [lib]
181
+ proc-macro = true
182
+
183
+ "# ,
184
+ )
185
+ . file ( "src/lib.rs" , "" )
186
+ . build ( ) ;
187
+
188
+ p. cargo ( "rustdoc --verbose" )
189
+ . with_stderr_contains (
190
+ "\
191
+ [RUNNING] `rustdoc --crate-type proc-macro [..]`
192
+ " ,
193
+ )
194
+ . run ( ) ;
195
+ }
196
+
164
197
#[ cargo_test]
165
198
#[ cfg( all( target_arch = "x86_64" , target_os = "linux" , target_env = "gnu" ) ) ]
166
199
fn rustdoc_target ( ) {
@@ -170,7 +203,7 @@ fn rustdoc_target() {
170
203
. with_stderr (
171
204
"\
172
205
[DOCUMENTING] foo v0.0.1 ([..])
173
- [RUNNING] `rustdoc --crate-name foo src/lib.rs [..]\
206
+ [RUNNING] `rustdoc [..] --crate-name foo src/lib.rs [..]\
174
207
--target x86_64-unknown-linux-gnu \
175
208
-o [CWD]/target/x86_64-unknown-linux-gnu/doc \
176
209
[..] \
0 commit comments