Skip to content

Commit 68f96d7

Browse files
committed
Run more tests in Miri
Now that we are tagging tests eligible for running under Miri it is much easier to onboard new ones. Add a bunch. Signed-off-by: Daniel Müller <[email protected]>
1 parent 45533d3 commit 68f96d7

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

src/error.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,9 +717,11 @@ mod tests {
717717
use std::mem::size_of;
718718

719719
use test_log::test;
720+
use test_tag::tag;
720721

721722

722723
/// Exercise the `Display` representation of various types.
724+
#[tag(miri)]
723725
#[test]
724726
fn display_repr() {
725727
assert_eq!(ErrorKind::NotFound.to_string(), "entity not found");
@@ -731,6 +733,7 @@ mod tests {
731733
}
732734

733735
/// Check various features of our `Str` wrapper type.
736+
#[tag(miri)]
734737
#[test]
735738
fn str_wrapper() {
736739
let b = "test string".to_string().into_boxed_str();
@@ -748,6 +751,7 @@ mod tests {
748751
}
749752

750753
/// Check that we can convert a `dyn std::error::Error` into our `Error`.
754+
#[tag(miri)]
751755
#[test]
752756
fn std_error_conversion() {
753757
let err = io::Error::new(io::ErrorKind::InvalidData, "some invalid data");
@@ -760,6 +764,7 @@ mod tests {
760764
}
761765

762766
/// Check that we can format errors as expected.
767+
#[tag(miri)]
763768
#[test]
764769
fn error_formatting() {
765770
let err = io::Error::new(io::ErrorKind::InvalidData, "some invalid data");

src/ksym.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,13 @@ mod tests {
205205
use super::*;
206206

207207
use test_log::test;
208+
use test_tag::tag;
208209

209210
use crate::ErrorKind;
210211

211212

212213
/// Exercise the `Debug` representation of various types.
214+
#[tag(miri)]
213215
#[test]
214216
fn debug_repr() {
215217
let resolver = KSymResolver {
@@ -284,6 +286,7 @@ mod tests {
284286
ensure_addr_for_name(found.name, addr);
285287
}
286288

289+
#[tag(miri)]
287290
#[test]
288291
fn find_ksym() {
289292
let resolver = KSymResolver {
@@ -344,6 +347,7 @@ mod tests {
344347
}
345348

346349
/// Check that we can correctly iterate over all symbols.
350+
#[tag(miri)]
347351
#[test]
348352
fn symbol_iteration() {
349353
let resolver = KSymResolver {
@@ -381,6 +385,7 @@ mod tests {
381385
/// Check that [`KSymResolver::find_addr`] and
382386
/// [`KSymResolver::for_each`] behave as expected for variable
383387
/// inquiries.
388+
#[tag(miri)]
384389
#[test]
385390
fn variable_operations() {
386391
let resolver = KSymResolver {

src/maps.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,7 @@ mod tests {
313313
use std::path::Path;
314314

315315
use test_log::test;
316+
use test_tag::tag;
316317

317318
#[cfg(feature = "nightly")]
318319
use test::Bencher;
@@ -334,6 +335,7 @@ mod tests {
334335
}
335336

336337
/// Make sure that we can parse proc maps lines correctly.
338+
#[tag(miri)]
337339
#[test]
338340
fn map_line_parsing() {
339341
let lines = r#"00400000-00401000 r--p 00000000 00:29 47459 /tmp/test/test
@@ -443,6 +445,7 @@ ffffffffff600000-ffffffffff601000 --xp 00000000 00:00 0 [vsysca
443445
}
444446

445447
/// Check that we error out as expected on malformed proc maps lines.
448+
#[tag(miri)]
446449
#[test]
447450
fn malformed_proc_maps_lines() {
448451
let lines = [

src/resolver.rs

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)