@@ -74,6 +74,8 @@ struct ConfigBuilder {
74
74
git_hash : bool ,
75
75
system_llvm : bool ,
76
76
profiler_runtime : bool ,
77
+ rustc_debug_assertions : bool ,
78
+ std_debug_assertions : bool ,
77
79
}
78
80
79
81
impl ConfigBuilder {
@@ -122,6 +124,16 @@ impl ConfigBuilder {
122
124
self
123
125
}
124
126
127
+ fn rustc_debug_assertions ( & mut self , is_enabled : bool ) -> & mut Self {
128
+ self . rustc_debug_assertions = is_enabled;
129
+ self
130
+ }
131
+
132
+ fn std_debug_assertions ( & mut self , is_enabled : bool ) -> & mut Self {
133
+ self . std_debug_assertions = is_enabled;
134
+ self
135
+ }
136
+
125
137
fn build ( & mut self ) -> Config {
126
138
let args = & [
127
139
"compiletest" ,
@@ -169,6 +181,12 @@ impl ConfigBuilder {
169
181
if self . profiler_runtime {
170
182
args. push ( "--profiler-runtime" . to_owned ( ) ) ;
171
183
}
184
+ if self . rustc_debug_assertions {
185
+ args. push ( "--with-rustc-debug-assertions" . to_owned ( ) ) ;
186
+ }
187
+ if self . std_debug_assertions {
188
+ args. push ( "--with-std-debug-assertions" . to_owned ( ) ) ;
189
+ }
172
190
173
191
args. push ( "--rustc-path" . to_string ( ) ) ;
174
192
// This is a subtle/fragile thing. On rust-lang CI, there is no global
@@ -313,6 +331,32 @@ fn only_target() {
313
331
assert ! ( !check_ignore( & config, "//@ only-64bit" ) ) ;
314
332
}
315
333
334
+ #[ test]
335
+ fn rustc_debug_assertions ( ) {
336
+ let config: Config = cfg ( ) . rustc_debug_assertions ( false ) . build ( ) ;
337
+
338
+ assert ! ( check_ignore( & config, "//@ needs-rustc-debug-assertions" ) ) ;
339
+ assert ! ( !check_ignore( & config, "//@ ignore-rustc-debug-assertions" ) ) ;
340
+
341
+ let config: Config = cfg ( ) . rustc_debug_assertions ( true ) . build ( ) ;
342
+
343
+ assert ! ( !check_ignore( & config, "//@ needs-rustc-debug-assertions" ) ) ;
344
+ assert ! ( check_ignore( & config, "//@ ignore-rustc-debug-assertions" ) ) ;
345
+ }
346
+
347
+ #[ test]
348
+ fn std_debug_assertions ( ) {
349
+ let config: Config = cfg ( ) . std_debug_assertions ( false ) . build ( ) ;
350
+
351
+ assert ! ( check_ignore( & config, "//@ needs-std-debug-assertions" ) ) ;
352
+ assert ! ( !check_ignore( & config, "//@ ignore-std-debug-assertions" ) ) ;
353
+
354
+ let config: Config = cfg ( ) . std_debug_assertions ( true ) . build ( ) ;
355
+
356
+ assert ! ( !check_ignore( & config, "//@ needs-std-debug-assertions" ) ) ;
357
+ assert ! ( check_ignore( & config, "//@ ignore-std-debug-assertions" ) ) ;
358
+ }
359
+
316
360
#[ test]
317
361
fn stage ( ) {
318
362
let config: Config = cfg ( ) . stage_id ( "stage1-x86_64-unknown-linux-gnu" ) . build ( ) ;
0 commit comments