mirror of
https://gitee.com/openharmony/third_party_rust_syn
synced 2024-11-24 00:10:15 +00:00
Abort more promptly on test failure
This commit is contained in:
parent
b1d3a3bcd7
commit
3eaf7d88a5
@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user