File tree 1 file changed +37
-0
lines changed
1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -366,6 +366,43 @@ warning: `foo` (example \"ex2\") generated 1 warning
366
366
. run ( ) ;
367
367
}
368
368
369
+ #[ cargo_test( nightly, reason = "rustdoc scrape examples flags are unstable" ) ]
370
+ fn fail_bad_build_script ( ) {
371
+ // See rust-lang/cargo#11623
372
+ let p = project ( )
373
+ . file (
374
+ "Cargo.toml" ,
375
+ r#"
376
+ [package]
377
+ name = "foo"
378
+ version = "0.0.1"
379
+ "# ,
380
+ )
381
+ . file ( "src/lib.rs" , "" )
382
+ . file ( "build.rs" , "fn main() { panic!(\" You shall not pass\" )}" )
383
+ . file ( "examples/ex.rs" , "fn main() {}" )
384
+ . build ( ) ;
385
+
386
+ // `cargo doc` fails
387
+ p. cargo ( "doc" )
388
+ . with_status ( 101 )
389
+ . with_stderr_contains ( "[..]You shall not pass[..]" )
390
+ . run ( ) ;
391
+
392
+ // FIXME: scrape examples should fail whenever `cargo doc` fails.
393
+ p. cargo ( "doc -Zunstable-options -Z rustdoc-scrape-examples" )
394
+ . masquerade_as_nightly_cargo ( & [ "rustdoc-scrape-examples" ] )
395
+ . with_stderr (
396
+ "\
397
+ [COMPILING] foo v0.0.1 ([CWD])
398
+ [SCRAPING] foo v0.0.1 ([CWD])
399
+ [DOCUMENTING] foo v0.0.1 ([CWD])
400
+ [FINISHED] dev [..]
401
+ " ,
402
+ )
403
+ . run ( ) ;
404
+ }
405
+
369
406
#[ cargo_test( nightly, reason = "rustdoc scrape examples flags are unstable" ) ]
370
407
fn no_fail_bad_example ( ) {
371
408
let p = project ( )
You can’t perform that action at this time.
0 commit comments