We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5ca05d3 commit 8c298d0Copy full SHA for 8c298d0
tests/testsuite/build_script_env.rs
@@ -452,3 +452,22 @@ fn rerun_if_env_newly_added_in_config() {
452
"#]])
453
.run();
454
}
455
+
456
+#[cargo_test]
457
+fn build_script_debug_assertions_dev() {
458
+ // Test that CARGO_CFG_DEBUG_ASSERTIONS is set in dev profile (default)
459
+ let build_rs = r#"
460
+ fn main() {
461
+ let has_debug_assertions = std::env::var_os("CARGO_CFG_DEBUG_ASSERTIONS").is_some();
462
+ assert!(has_debug_assertions, "CARGO_CFG_DEBUG_ASSERTIONS should be set in dev profile");
463
+ }
464
+ "#;
465
466
+ let p = project()
467
+ .file("src/lib.rs", r#""#)
468
+ .file("build.rs", build_rs)
469
+ .build();
470
471
+ // Default dev profile has debug-assertions enabled
472
+ p.cargo("check").run();
473
+}
0 commit comments