@@ -232,6 +232,7 @@ pub struct TestProps {
232
232
// customized normalization rules
233
233
pub normalize_stdout : Vec < ( String , String ) > ,
234
234
pub normalize_stderr : Vec < ( String , String ) > ,
235
+ pub failure_status : i32 ,
235
236
}
236
237
237
238
impl TestProps {
@@ -260,6 +261,7 @@ impl TestProps {
260
261
run_pass : false ,
261
262
normalize_stdout : vec ! [ ] ,
262
263
normalize_stderr : vec ! [ ] ,
264
+ failure_status : 101 ,
263
265
}
264
266
}
265
267
@@ -383,6 +385,10 @@ impl TestProps {
383
385
if let Some ( rule) = config. parse_custom_normalization ( ln, "normalize-stderr" ) {
384
386
self . normalize_stderr . push ( rule) ;
385
387
}
388
+
389
+ if let Some ( code) = config. parse_failure_status ( ln) {
390
+ self . failure_status = code;
391
+ }
386
392
} ) ;
387
393
388
394
for key in & [ "RUST_TEST_NOCAPTURE" , "RUST_TEST_THREADS" ] {
@@ -488,6 +494,13 @@ impl Config {
488
494
self . parse_name_directive ( line, "pretty-compare-only" )
489
495
}
490
496
497
+ fn parse_failure_status ( & self , line : & str ) -> Option < i32 > {
498
+ match self . parse_name_value_directive ( line, "failure-status" ) {
499
+ Some ( code) => code. trim ( ) . parse :: < i32 > ( ) . ok ( ) ,
500
+ _ => None ,
501
+ }
502
+ }
503
+
491
504
fn parse_must_compile_successfully ( & self , line : & str ) -> bool {
492
505
self . parse_name_directive ( line, "must-compile-successfully" )
493
506
}
0 commit comments