summaryrefslogtreecommitdiffstats
path: root/vendor/addr2line/tests/output_equivalence.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-30 03:57:31 +0000
commitdc0db358abe19481e475e10c32149b53370f1a1c (patch)
treeab8ce99c4b255ce46f99ef402c27916055b899ee /vendor/addr2line/tests/output_equivalence.rs
parentReleasing progress-linux version 1.71.1+dfsg1-2~progress7.99u1. (diff)
downloadrustc-dc0db358abe19481e475e10c32149b53370f1a1c.tar.xz
rustc-dc0db358abe19481e475e10c32149b53370f1a1c.zip
Merging upstream version 1.72.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/addr2line/tests/output_equivalence.rs')
-rw-r--r--vendor/addr2line/tests/output_equivalence.rs35
1 files changed, 12 insertions, 23 deletions
diff --git a/vendor/addr2line/tests/output_equivalence.rs b/vendor/addr2line/tests/output_equivalence.rs
index c0e1f8335..ef026e347 100644
--- a/vendor/addr2line/tests/output_equivalence.rs
+++ b/vendor/addr2line/tests/output_equivalence.rs
@@ -1,7 +1,3 @@
-extern crate backtrace;
-extern crate findshlibs;
-extern crate rustc_test as test;
-
use std::env;
use std::ffi::OsStr;
use std::path::Path;
@@ -9,7 +5,7 @@ use std::process::Command;
use backtrace::Backtrace;
use findshlibs::{IterationControl, SharedLibrary, TargetSharedLibrary};
-use test::{ShouldPanic, TestDesc, TestDescAndFn, TestFn, TestName};
+use libtest_mimic::{Arguments, Failed, Trial};
#[inline(never)]
fn make_trace() -> Vec<String> {
@@ -57,7 +53,7 @@ fn run_cmd<P: AsRef<OsStr>>(exe: P, me: &Path, flags: Option<&str>, trace: &str)
String::from_utf8(output.stdout).unwrap()
}
-fn run_test(flags: Option<&str>) {
+fn run_test(flags: Option<&str>) -> Result<(), Failed> {
let me = env::current_exe().unwrap();
let mut exe = me.clone();
assert!(exe.pop());
@@ -100,11 +96,12 @@ $ {3} {0} --exe {1} {2}
ours
);
}
+ Ok(())
}
-static FLAGS: &'static str = "aipsf";
+static FLAGS: &str = "aipsf";
-fn make_tests() -> Vec<TestDescAndFn> {
+fn make_tests() -> Vec<Trial> {
(0..(1 << FLAGS.len()))
.map(|bits| {
if bits == 0 {
@@ -120,19 +117,11 @@ fn make_tests() -> Vec<TestDescAndFn> {
Some(param)
}
})
- .map(|param| TestDescAndFn {
- desc: TestDesc {
- name: TestName::DynTestName(format!(
- "addr2line {}",
- param.as_ref().map_or("", String::as_str)
- )),
- ignore: false,
- should_panic: ShouldPanic::No,
- allow_fail: false,
- },
- testfn: TestFn::DynTestFn(Box::new(move || {
- run_test(param.as_ref().map(String::as_str))
- })),
+ .map(|param| {
+ Trial::test(
+ format!("addr2line {}", param.as_ref().map_or("", String::as_str)),
+ move || run_test(param.as_ref().map(String::as_str)),
+ )
})
.collect()
}
@@ -141,6 +130,6 @@ fn main() {
if !cfg!(target_os = "linux") {
return;
}
- let args: Vec<_> = env::args().collect();
- test::test_main(&args, make_tests());
+ let args = Arguments::from_args();
+ libtest_mimic::run(&args, make_tests()).exit();
}