File tree Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Expand file tree Collapse file tree 1 file changed +38
-0
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,44 @@ Caused by:
44
44
. run ( ) ;
45
45
}
46
46
47
+ #[ cargo_test]
48
+ fn custom_build_script_failed_backtraces_message ( ) {
49
+ // In this situation (no dependency sharing), debuginfo is turned off in
50
+ // `dev.build-override`. However, if an error occurs running e.g. a build
51
+ // script, and backtraces are opted into: a message explaining how to
52
+ // improve backtraces is also displayed.
53
+ let p = project ( )
54
+ . file (
55
+ "Cargo.toml" ,
56
+ r#"
57
+ [package]
58
+
59
+ name = "foo"
60
+ version = "0.5.0"
61
+ authors = ["wycats@example.com"]
62
+ build = "build.rs"
63
+ "# ,
64
+ )
65
+ . file ( "src/main.rs" , "fn main() {}" )
66
+ . file ( "build.rs" , "fn main() { std::process::exit(101); }" )
67
+ . build ( ) ;
68
+ p. cargo ( "build -v" )
69
+ . env ( "RUST_BACKTRACE" , "1" )
70
+ . with_status ( 101 )
71
+ . with_stderr (
72
+ "\
73
+ [COMPILING] foo v0.5.0 ([CWD])
74
+ [RUNNING] `rustc --crate-name build_script_build build.rs [..]--crate-type bin [..]`
75
+ [RUNNING] `[..]/build-script-build`
76
+ [ERROR] failed to run custom build command for `foo v0.5.0 ([CWD])`
77
+ note: To improve backtraces for build dependencies[..]
78
+
79
+ Caused by:
80
+ process didn't exit successfully: `[..]/build-script-build` (exit [..]: 101)" ,
81
+ )
82
+ . run ( ) ;
83
+ }
84
+
47
85
#[ cargo_test]
48
86
fn custom_build_env_vars ( ) {
49
87
let p = project ( )
You can’t perform that action at this time.
0 commit comments