File tree 2 files changed +10
-3
lines changed 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,9 @@ pub struct Config {
239
239
/// as a header.
240
240
pub strict_headers : bool ,
241
241
242
+ /// Expected exit code for compile tests. Defaults to expecting `1` if unset.
243
+ pub compile_test_exit_code : Option < i32 > ,
244
+
242
245
// Configuration for various run-make tests frobbing things like C compilers
243
246
// or querying about various LLVM component information.
244
247
pub cc : String ,
@@ -464,6 +467,7 @@ impl Default for Config {
464
467
quiet : false ,
465
468
color : ColorConfig :: AutoColor ,
466
469
remote_test_client : None ,
470
+ compile_test_exit_code : None ,
467
471
cc : "cc" . to_string ( ) ,
468
472
cxx : "cxx" . to_string ( ) ,
469
473
cflags : "cflags" . to_string ( ) ,
Original file line number Diff line number Diff line change @@ -229,9 +229,12 @@ impl<'test> TestCx<'test> {
229
229
}
230
230
231
231
fn check_correct_failure_status ( & self , proc_res : & ProcRes ) {
232
- // The value the rust runtime returns on failure
233
- const RUST_ERR : i32 = 1 ;
234
- if proc_res. status . code ( ) != Some ( RUST_ERR ) {
232
+ // The value the rust runtime returns on normal compile failure
233
+ const DEFAULT_RUST_ERR : i32 = 1 ;
234
+
235
+ let expected = self . config . compile_test_exit_code . unwrap_or ( DEFAULT_RUST_ERR ) ;
236
+
237
+ if proc_res. status . code ( ) != Some ( expected) {
235
238
self . fatal_proc_rec (
236
239
& format ! ( "failure produced the wrong error: {}" , proc_res. status) ,
237
240
proc_res,
You can’t perform that action at this time.
0 commit comments