Skip to content

Commit 4b8715e

Browse files
committed
Get tests passing under Miri
1 parent fb0d3dc commit 4b8715e

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

tests/accuracy/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ fn doit() {
2222
!cfg!(target_env = "musl")
2323
// Skip MinGW on libbacktrace which doesn't have support for DLLs.
2424
&& !(cfg!(windows) && cfg!(target_env = "gnu") && cfg!(feature = "libbacktrace"))
25+
// Skip Miri, since it doesn't support dynamic libraries.
26+
&& !cfg!(miri)
2527
{
2628
// TODO(#238) this shouldn't have to happen first in this function, but
2729
// currently it does.

tests/concurrent-panics.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ fn main() {
1313
// These run in docker containers on CI where they can't re-exec the test,
1414
// so just skip these for CI. No other reason this can't run on those
1515
// platforms though.
16-
if cfg!(unix) && (cfg!(target_arch = "arm") || cfg!(target_arch = "aarch64")) {
16+
// Miri does not have support for re-execing a file
17+
if cfg!(unix) && (cfg!(target_arch = "arm") || cfg!(target_arch = "aarch64")) || cfg!(miri) {
1718
println!("test result: ok");
1819
return;
1920
}

tests/smoke.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use backtrace::Frame;
22
use std::thread;
33

44
// Reflects the conditional compilation logic at end of src/symbolize/mod.rs
5-
static NOOP: bool = cfg!(miri);
5+
static NOOP: bool = false;
66
static DBGHELP: bool = !NOOP
77
&& cfg!(all(
88
windows,
@@ -31,6 +31,7 @@ static GIMLI_SYMBOLIZE: bool = !NOOP
3131
not(target_vendor = "uwp"),
3232
not(target_os = "emscripten"),
3333
));
34+
static MIRI_SYMBOLIZE: bool = cfg!(miri);
3435

3536
#[test]
3637
// FIXME: shouldn't ignore this test on i686-msvc, unsure why it's failing
@@ -158,8 +159,8 @@ fn smoke_test_frames() {
158159
}
159160

160161
let mut resolved = 0;
161-
let can_resolve = LIBBACKTRACE || GIMLI_SYMBOLIZE;
162-
let can_resolve_cols = GIMLI_SYMBOLIZE;
162+
let can_resolve = LIBBACKTRACE || GIMLI_SYMBOLIZE || MIRI_SYMBOLIZE;
163+
let can_resolve_cols = GIMLI_SYMBOLIZE || MIRI_SYMBOLIZE;
163164

164165
let mut name = None;
165166
let mut addr = None;

0 commit comments

Comments
 (0)