@@ -70,6 +70,8 @@ struct ConfigBuilder {
70
70
git_hash : bool ,
71
71
system_llvm : bool ,
72
72
profiler_runtime : bool ,
73
+ rustc_debug_assertions : bool ,
74
+ std_debug_assertions : bool ,
73
75
}
74
76
75
77
impl ConfigBuilder {
@@ -118,6 +120,16 @@ impl ConfigBuilder {
118
120
self
119
121
}
120
122
123
+ fn rustc_debug_assertions ( & mut self , is_enabled : bool ) -> & mut Self {
124
+ self . rustc_debug_assertions = is_enabled;
125
+ self
126
+ }
127
+
128
+ fn std_debug_assertions ( & mut self , is_enabled : bool ) -> & mut Self {
129
+ self . std_debug_assertions = is_enabled;
130
+ self
131
+ }
132
+
121
133
fn build ( & mut self ) -> Config {
122
134
let args = & [
123
135
"compiletest" ,
@@ -165,6 +177,12 @@ impl ConfigBuilder {
165
177
if self . profiler_runtime {
166
178
args. push ( "--profiler-runtime" . to_owned ( ) ) ;
167
179
}
180
+ if self . rustc_debug_assertions {
181
+ args. push ( "--with-rustc-debug-assertions" . to_owned ( ) ) ;
182
+ }
183
+ if self . std_debug_assertions {
184
+ args. push ( "--with-std-debug-assertions" . to_owned ( ) ) ;
185
+ }
168
186
169
187
args. push ( "--rustc-path" . to_string ( ) ) ;
170
188
// This is a subtle/fragile thing. On rust-lang CI, there is no global
@@ -309,6 +327,32 @@ fn only_target() {
309
327
assert ! ( !check_ignore( & config, "//@ only-64bit" ) ) ;
310
328
}
311
329
330
+ #[ test]
331
+ fn rustc_debug_assertions ( ) {
332
+ let config: Config = cfg ( ) . rustc_debug_assertions ( false ) . build ( ) ;
333
+
334
+ assert ! ( check_ignore( & config, "//@ needs-rustc-debug-assertions" ) ) ;
335
+ assert ! ( !check_ignore( & config, "//@ ignore-rustc-debug-assertions" ) ) ;
336
+
337
+ let config: Config = cfg ( ) . rustc_debug_assertions ( true ) . build ( ) ;
338
+
339
+ assert ! ( !check_ignore( & config, "//@ needs-rustc-debug-assertions" ) ) ;
340
+ assert ! ( check_ignore( & config, "//@ ignore-rustc-debug-assertions" ) ) ;
341
+ }
342
+
343
+ #[ test]
344
+ fn std_debug_assertions ( ) {
345
+ let config: Config = cfg ( ) . std_debug_assertions ( false ) . build ( ) ;
346
+
347
+ assert ! ( check_ignore( & config, "//@ needs-std-debug-assertions" ) ) ;
348
+ assert ! ( !check_ignore( & config, "//@ ignore-std-debug-assertions" ) ) ;
349
+
350
+ let config: Config = cfg ( ) . std_debug_assertions ( true ) . build ( ) ;
351
+
352
+ assert ! ( !check_ignore( & config, "//@ needs-std-debug-assertions" ) ) ;
353
+ assert ! ( check_ignore( & config, "//@ ignore-std-debug-assertions" ) ) ;
354
+ }
355
+
312
356
#[ test]
313
357
fn stage ( ) {
314
358
let config: Config = cfg ( ) . stage_id ( "stage1-x86_64-unknown-linux-gnu" ) . build ( ) ;
0 commit comments