2
2
3
3
use cargo_test_support:: { basic_manifest, is_nightly, project} ;
4
4
5
- #[ cfg_attr( windows, ignore) ] // weird normalization issue with windows and cargo-test-support
5
+ macro_rules! x {
6
+ ( $tool: tt => $what: tt $( of $who: tt) ?) => { {
7
+ #[ cfg( windows) ]
8
+ {
9
+ concat!( "[RUNNING] [..]" , $tool, "[..] --check-cfg " ,
10
+ $what, '(' , $( $who, ) * ')' , "[..]" )
11
+ }
12
+ #[ cfg( not( windows) ) ]
13
+ {
14
+ concat!( "[RUNNING] [..]" , $tool, "[..] --check-cfg '" ,
15
+ $what, '(' , $( $who, ) * ')' , "'" , "[..]" )
16
+ }
17
+ } } ;
18
+ ( $tool: tt => $what: tt of $who: tt with $( $values: tt) * ) => { {
19
+ #[ cfg( windows) ]
20
+ {
21
+ concat!( "[RUNNING] [..]" , $tool, "[..] --check-cfg \" " ,
22
+ $what, '(' , $who, $( ", " , "/\" " , $values, "/\" " , ) * ")" , '"' , "[..]" )
23
+ }
24
+ #[ cfg( not( windows) ) ]
25
+ {
26
+ concat!( "[RUNNING] [..]" , $tool, "[..] --check-cfg '" ,
27
+ $what, '(' , $who, $( ", " , "\" " , $values, "\" " , ) * ")" , "'" , "[..]" )
28
+ }
29
+ } } ;
30
+ }
31
+
6
32
#[ cargo_test]
7
33
fn features ( ) {
8
34
if !is_nightly ( ) {
@@ -28,17 +54,10 @@ fn features() {
28
54
29
55
p. cargo ( "build -v -Zcheck-cfg=features" )
30
56
. masquerade_as_nightly_cargo ( )
31
- . with_stderr (
32
- "\
33
- [COMPILING] foo v0.1.0 [..]
34
- [RUNNING] `rustc [..] --check-cfg 'values(feature, \" f_a\" , \" f_b\" )' [..]
35
- [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
36
- " ,
37
- )
57
+ . with_stderr_contains ( x ! ( "rustc" => "values" of "feature" with "f_a" "f_b" ) )
38
58
. run ( ) ;
39
59
}
40
60
41
- #[ cfg_attr( windows, ignore) ] // weird normalization issue with windows and cargo-test-support
42
61
#[ cargo_test]
43
62
fn features_with_deps ( ) {
44
63
if !is_nightly ( ) {
@@ -69,19 +88,11 @@ fn features_with_deps() {
69
88
70
89
p. cargo ( "build -v -Zcheck-cfg=features" )
71
90
. masquerade_as_nightly_cargo ( )
72
- . with_stderr (
73
- "\
74
- [COMPILING] bar v0.1.0 [..]
75
- [RUNNING] `rustc [..] --check-cfg 'values(feature)' [..]
76
- [COMPILING] foo v0.1.0 [..]
77
- [RUNNING] `rustc --crate-name foo [..] --check-cfg 'values(feature, \" f_a\" , \" f_b\" )' [..]
78
- [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
79
- " ,
80
- )
91
+ . with_stderr_contains ( x ! ( "rustc" => "values" of "feature" ) )
92
+ . with_stderr_contains ( x ! ( "rustc" => "values" of "feature" with "f_a" "f_b" ) )
81
93
. run ( ) ;
82
94
}
83
95
84
- #[ cfg_attr( windows, ignore) ] // weird normalization issue with windows and cargo-test-support
85
96
#[ cargo_test]
86
97
fn features_with_opt_deps ( ) {
87
98
if !is_nightly ( ) {
@@ -113,19 +124,11 @@ fn features_with_opt_deps() {
113
124
114
125
p. cargo ( "build -v -Zcheck-cfg=features" )
115
126
. masquerade_as_nightly_cargo ( )
116
- . with_stderr (
117
- "\
118
- [COMPILING] bar v0.1.0 [..]
119
- [RUNNING] `rustc [..] --check-cfg 'values(feature)' [..]
120
- [COMPILING] foo v0.1.0 [..]
121
- [RUNNING] `rustc --crate-name foo [..] --check-cfg 'values(feature, \" bar\" , \" default\" , \" f_a\" , \" f_b\" )' [..]
122
- [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
123
- " ,
124
- )
127
+ . with_stderr_contains ( x ! ( "rustc" => "values" of "feature" ) )
128
+ . with_stderr_contains ( x ! ( "rustc" => "values" of "feature" with "bar" "default" "f_a" "f_b" ) )
125
129
. run ( ) ;
126
130
}
127
131
128
- #[ cfg_attr( windows, ignore) ] // weird normalization issue with windows and cargo-test-support
129
132
#[ cargo_test]
130
133
fn features_with_namespaced_features ( ) {
131
134
if !is_nightly ( ) {
@@ -156,17 +159,10 @@ fn features_with_namespaced_features() {
156
159
157
160
p. cargo ( "build -v -Zcheck-cfg=features" )
158
161
. masquerade_as_nightly_cargo ( )
159
- . with_stderr (
160
- "\
161
- [COMPILING] foo v0.1.0 [..]
162
- [RUNNING] `rustc --crate-name foo [..] --check-cfg 'values(feature, \" f_a\" , \" f_b\" )' [..]
163
- [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
164
- " ,
165
- )
162
+ . with_stderr_contains ( x ! ( "rustc" => "values" of "feature" with "f_a" "f_b" ) )
166
163
. run ( ) ;
167
164
}
168
165
169
- #[ cfg_attr( windows, ignore) ] // weird normalization issue with windows and cargo-test-support
170
166
#[ cargo_test]
171
167
fn well_known_names ( ) {
172
168
if !is_nightly ( ) {
@@ -181,17 +177,10 @@ fn well_known_names() {
181
177
182
178
p. cargo ( "build -v -Zcheck-cfg=names" )
183
179
. masquerade_as_nightly_cargo ( )
184
- . with_stderr (
185
- "\
186
- [COMPILING] foo v0.1.0 [..]
187
- [RUNNING] `rustc [..] --check-cfg 'names()' [..]
188
- [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
189
- " ,
190
- )
180
+ . with_stderr_contains ( x ! ( "rustc" => "names" ) )
191
181
. run ( ) ;
192
182
}
193
183
194
- #[ cfg_attr( windows, ignore) ] // weird normalization issue with windows and cargo-test-support
195
184
#[ cargo_test]
196
185
fn well_known_values ( ) {
197
186
if !is_nightly ( ) {
@@ -206,17 +195,10 @@ fn well_known_values() {
206
195
207
196
p. cargo ( "build -v -Zcheck-cfg=values" )
208
197
. masquerade_as_nightly_cargo ( )
209
- . with_stderr (
210
- "\
211
- [COMPILING] foo v0.1.0 [..]
212
- [RUNNING] `rustc [..] --check-cfg 'values()' [..]
213
- [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
214
- " ,
215
- )
198
+ . with_stderr_contains ( x ! ( "rustc" => "values" ) )
216
199
. run ( ) ;
217
200
}
218
201
219
- #[ cfg_attr( windows, ignore) ] // weird normalization issue with windows and cargo-test-support
220
202
#[ cargo_test]
221
203
fn cli_all_options ( ) {
222
204
if !is_nightly ( ) {
@@ -242,10 +224,12 @@ fn cli_all_options() {
242
224
243
225
p. cargo ( "build -v -Zcheck-cfg=features,names,values" )
244
226
. masquerade_as_nightly_cargo ( )
227
+ . with_stderr_contains ( x ! ( "rustc" => "names" ) )
228
+ . with_stderr_contains ( x ! ( "rustc" => "values" ) )
229
+ . with_stderr_contains ( x ! ( "rustc" => "values" of "feature" with "f_a" "f_b" ) )
245
230
. run ( ) ;
246
231
}
247
232
248
- #[ cfg_attr( windows, ignore) ] // weird normalization issue with windows and cargo-test-support
249
233
#[ cargo_test]
250
234
fn features_with_cargo_check ( ) {
251
235
if !is_nightly ( ) {
@@ -271,17 +255,10 @@ fn features_with_cargo_check() {
271
255
272
256
p. cargo ( "check -v -Zcheck-cfg=features" )
273
257
. masquerade_as_nightly_cargo ( )
274
- . with_stderr (
275
- "\
276
- [CHECKING] foo v0.1.0 [..]
277
- [RUNNING] `rustc [..] --check-cfg 'values(feature, \" f_a\" , \" f_b\" )' [..]
278
- [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
279
- " ,
280
- )
258
+ . with_stderr_contains ( x ! ( "rustc" => "values" of "feature" with "f_a" "f_b" ) )
281
259
. run ( ) ;
282
260
}
283
261
284
- #[ cfg_attr( windows, ignore) ] // weird normalization issue with windows and cargo-test-support
285
262
#[ cargo_test]
286
263
fn well_known_names_with_check ( ) {
287
264
if !is_nightly ( ) {
@@ -296,17 +273,10 @@ fn well_known_names_with_check() {
296
273
297
274
p. cargo ( "check -v -Zcheck-cfg=names" )
298
275
. masquerade_as_nightly_cargo ( )
299
- . with_stderr (
300
- "\
301
- [CHECKING] foo v0.1.0 [..]
302
- [RUNNING] `rustc [..] --check-cfg 'names()' [..]
303
- [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
304
- " ,
305
- )
276
+ . with_stderr_contains ( x ! ( "rustc" => "names" ) )
306
277
. run ( ) ;
307
278
}
308
279
309
- #[ cfg_attr( windows, ignore) ] // weird normalization issue with windows and cargo-test-support
310
280
#[ cargo_test]
311
281
fn well_known_values_with_check ( ) {
312
282
if !is_nightly ( ) {
@@ -321,17 +291,10 @@ fn well_known_values_with_check() {
321
291
322
292
p. cargo ( "check -v -Zcheck-cfg=values" )
323
293
. masquerade_as_nightly_cargo ( )
324
- . with_stderr (
325
- "\
326
- [CHECKING] foo v0.1.0 [..]
327
- [RUNNING] `rustc [..] --check-cfg 'values()' [..]
328
- [FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
329
- " ,
330
- )
294
+ . with_stderr_contains ( x ! ( "rustc" => "values" ) )
331
295
. run ( ) ;
332
296
}
333
297
334
- #[ cfg_attr( windows, ignore) ] // weird normalization issue with windows and cargo-test-support
335
298
#[ cargo_test]
336
299
fn features_test ( ) {
337
300
if !is_nightly ( ) {
@@ -357,18 +320,10 @@ fn features_test() {
357
320
358
321
p. cargo ( "test -v -Zcheck-cfg=features" )
359
322
. masquerade_as_nightly_cargo ( )
360
- . with_stderr (
361
- "\
362
- [COMPILING] foo v0.1.0 [..]
363
- [RUNNING] `rustc [..] --check-cfg 'values(feature, \" f_a\" , \" f_b\" )' [..]
364
- [FINISHED] test [unoptimized + debuginfo] target(s) in [..]
365
- [RUNNING] [..]
366
- " ,
367
- )
323
+ . with_stderr_contains ( x ! ( "rustc" => "values" of "feature" with "f_a" "f_b" ) )
368
324
. run ( ) ;
369
325
}
370
326
371
- #[ cfg_attr( windows, ignore) ] // weird normalization issue with windows and cargo-test-support
372
327
#[ cargo_test]
373
328
fn features_doctest ( ) {
374
329
if !is_nightly ( ) {
@@ -395,19 +350,11 @@ fn features_doctest() {
395
350
396
351
p. cargo ( "test -v --doc -Zcheck-cfg=features" )
397
352
. masquerade_as_nightly_cargo ( )
398
- . with_stderr (
399
- "\
400
- [COMPILING] foo v0.1.0 [..]
401
- [RUNNING] `rustc [..] --check-cfg 'values(feature, \" default\" , \" f_a\" , \" f_b\" )' [..]
402
- [FINISHED] test [unoptimized + debuginfo] target(s) in [..]
403
- [DOCTEST] foo
404
- [RUNNING] `rustdoc [..] --check-cfg 'values(feature, \" default\" , \" f_a\" , \" f_b\" )' [..]
405
- " ,
406
- )
353
+ . with_stderr_contains ( x ! ( "rustc" => "values" of "feature" with "default" "f_a" "f_b" ) )
354
+ . with_stderr_contains ( x ! ( "rustdoc" => "values" of "feature" with "default" "f_a" "f_b" ) )
407
355
. run ( ) ;
408
356
}
409
357
410
- #[ cfg_attr( windows, ignore) ] // weird normalization issue with windows and cargo-test-support
411
358
#[ cargo_test]
412
359
fn well_known_names_test ( ) {
413
360
if !is_nightly ( ) {
@@ -422,18 +369,10 @@ fn well_known_names_test() {
422
369
423
370
p. cargo ( "test -v -Zcheck-cfg=names" )
424
371
. masquerade_as_nightly_cargo ( )
425
- . with_stderr (
426
- "\
427
- [COMPILING] foo v0.1.0 [..]
428
- [RUNNING] `rustc [..] --check-cfg 'names()' [..]
429
- [FINISHED] test [unoptimized + debuginfo] target(s) in [..]
430
- [RUNNING] [..]
431
- " ,
432
- )
372
+ . with_stderr_contains ( x ! ( "rustc" => "names" ) )
433
373
. run ( ) ;
434
374
}
435
375
436
- #[ cfg_attr( windows, ignore) ] // weird normalization issue with windows and cargo-test-support
437
376
#[ cargo_test]
438
377
fn well_known_values_test ( ) {
439
378
if !is_nightly ( ) {
@@ -448,18 +387,10 @@ fn well_known_values_test() {
448
387
449
388
p. cargo ( "test -v -Zcheck-cfg=values" )
450
389
. masquerade_as_nightly_cargo ( )
451
- . with_stderr (
452
- "\
453
- [COMPILING] foo v0.1.0 [..]
454
- [RUNNING] `rustc [..] --check-cfg 'values()' [..]
455
- [FINISHED] test [unoptimized + debuginfo] target(s) in [..]
456
- [RUNNING] [..]
457
- " ,
458
- )
390
+ . with_stderr_contains ( x ! ( "rustc" => "values" ) )
459
391
. run ( ) ;
460
392
}
461
393
462
- #[ cfg_attr( windows, ignore) ] // weird normalization issue with windows and cargo-test-support
463
394
#[ cargo_test]
464
395
fn well_known_names_doctest ( ) {
465
396
if !is_nightly ( ) {
@@ -474,19 +405,11 @@ fn well_known_names_doctest() {
474
405
475
406
p. cargo ( "test -v --doc -Zcheck-cfg=names" )
476
407
. masquerade_as_nightly_cargo ( )
477
- . with_stderr (
478
- "\
479
- [COMPILING] foo v0.1.0 [..]
480
- [RUNNING] `rustc [..] --check-cfg 'names()' [..]
481
- [FINISHED] test [unoptimized + debuginfo] target(s) in [..]
482
- [DOCTEST] foo
483
- [RUNNING] `rustdoc [..] --check-cfg 'names()' [..]
484
- " ,
485
- )
408
+ . with_stderr_contains ( x ! ( "rustc" => "names" ) )
409
+ . with_stderr_contains ( x ! ( "rustdoc" => "names" ) )
486
410
. run ( ) ;
487
411
}
488
412
489
- #[ cfg_attr( windows, ignore) ] // weird normalization issue with windows and cargo-test-support
490
413
#[ cargo_test]
491
414
fn well_known_values_doctest ( ) {
492
415
if !is_nightly ( ) {
@@ -501,19 +424,11 @@ fn well_known_values_doctest() {
501
424
502
425
p. cargo ( "test -v --doc -Zcheck-cfg=values" )
503
426
. masquerade_as_nightly_cargo ( )
504
- . with_stderr (
505
- "\
506
- [COMPILING] foo v0.1.0 [..]
507
- [RUNNING] `rustc [..] --check-cfg 'values()' [..]
508
- [FINISHED] test [unoptimized + debuginfo] target(s) in [..]
509
- [DOCTEST] foo
510
- [RUNNING] `rustdoc [..] --check-cfg 'values()' [..]
511
- " ,
512
- )
427
+ . with_stderr_contains ( x ! ( "rustc" => "values" ) )
428
+ . with_stderr_contains ( x ! ( "rustdoc" => "values" ) )
513
429
. run ( ) ;
514
430
}
515
431
516
- #[ cfg_attr( windows, ignore) ] // weird normalization issue with windows and cargo-test-support
517
432
#[ cargo_test]
518
433
fn features_doc ( ) {
519
434
if !is_nightly ( ) {
@@ -540,12 +455,6 @@ fn features_doc() {
540
455
541
456
p. cargo ( "doc -v -Zcheck-cfg=features" )
542
457
. masquerade_as_nightly_cargo ( )
543
- . with_stderr (
544
- "\
545
- [DOCUMENTING] foo v0.1.0 [..]
546
- [RUNNING] `rustdoc [..] --check-cfg 'values(feature, \" default\" , \" f_a\" , \" f_b\" )' [..]
547
- [FINISHED] [..]
548
- " ,
549
- )
458
+ . with_stderr_contains ( x ! ( "rustdoc" => "values" of "feature" with "default" "f_a" "f_b" ) )
550
459
. run ( ) ;
551
460
}
0 commit comments