File tree 1 file changed +42
-0
lines changed
1 file changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ use cargo::{
4
4
core:: compiler:: CompileMode ,
5
5
core:: { Shell , Workspace } ,
6
6
ops:: CompileOptions ,
7
+ util:: toml:: TomlDebugInfo ,
7
8
Config ,
8
9
} ;
9
10
use cargo_test_support:: compare;
@@ -6407,3 +6408,44 @@ fn renamed_uplifted_artifact_remains_unmodified_after_rebuild() {
6407
6408
let not_the_same = !same_file:: is_same_file ( bin, renamed_bin) . unwrap ( ) ;
6408
6409
assert ! ( not_the_same, "renamed uplifted artifact must be unmodified" ) ;
6409
6410
}
6411
+
6412
+ #[ cargo_test( nightly, reason = "debug options stabilized in 1.70" ) ]
6413
+ fn debug_options_valid ( ) {
6414
+ use serde:: Serialize ;
6415
+ use TomlDebugInfo :: * ;
6416
+
6417
+ for option in [
6418
+ TomlDebugInfo :: None ,
6419
+ LineDirectivesOnly ,
6420
+ LineTablesOnly ,
6421
+ Limited ,
6422
+ Full ,
6423
+ ] {
6424
+ let option_serialized = {
6425
+ let mut buf = String :: new ( ) ;
6426
+ option
6427
+ . serialize ( toml:: ser:: ValueSerializer :: new ( & mut buf) )
6428
+ . unwrap ( ) ;
6429
+ buf
6430
+ } ;
6431
+ let p = project ( )
6432
+ . file (
6433
+ "Cargo.toml" ,
6434
+ & format ! (
6435
+ r#"
6436
+ [package]
6437
+ name = "foo"
6438
+ authors = []
6439
+ version = "0.0.0"
6440
+
6441
+ [profile.dev]
6442
+ debug = {option_serialized}
6443
+ "#
6444
+ ) ,
6445
+ )
6446
+ . file ( "src/main.rs" , "fn main() {}" )
6447
+ . build ( ) ;
6448
+
6449
+ p. cargo ( "build" ) . run ( ) ;
6450
+ }
6451
+ }
You can’t perform that action at this time.
0 commit comments