Abort more promptly on test failure

This commit is contained in:
David Tolnay 2017-12-17 23:14:52 -08:00
parent b1d3a3bcd7
commit 3eaf7d88a5
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 5 additions and 3 deletions

View File

@ -28,6 +28,7 @@ use walkdir::{WalkDir, WalkDirIterator, DirEntry};
use std::fs::File;
use std::io::Read;
use std::process;
use std::sync::atomic::{AtomicUsize, Ordering};
use common::{respan, parse};
@ -127,7 +128,7 @@ fn test_rustc_precedence() {
let prev_failed = failed.fetch_add(l_failed, Ordering::SeqCst);
if prev_failed + l_failed >= abort_after {
panic!("Aborting Immediately due to ABORT_AFTER_FAILURE");
process::exit(1);
}
});

View File

@ -20,6 +20,7 @@ use walkdir::{WalkDir, WalkDirIterator, DirEntry};
use std::fs::File;
use std::io::Read;
use std::panic;
use std::process;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::time::Instant;
@ -65,7 +66,7 @@ fn test_round_trip() {
msg);
let prev_failed = failed.fetch_add(1, Ordering::SeqCst);
if prev_failed + 1 >= abort_after {
panic!("Aborting Immediately due to ABORT_AFTER_FAILURE");
process::exit(1);
}
return;
}
@ -116,7 +117,7 @@ fn test_round_trip() {
Ok(false) => {
let prev_failed = failed.fetch_add(1, Ordering::SeqCst);
if prev_failed + 1 >= abort_after {
panic!("Aborting Immediately due to ABORT_AFTER_FAILURE");
process::exit(1);
}
},
}