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