Skip to content

Commit

Permalink
Add running test with miri to CI
Browse files Browse the repository at this point in the history
For T1 Rust targets Miri is able to check for several forms of undefined
behavior that rustc can not.
  • Loading branch information
pcwizz committed Nov 12, 2023
1 parent ee0b430 commit a1bcc3e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,8 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
- run: cargo test

- uses: dtolnay/rust-toolchain@nightly
with:
components: miri
- run: cargo +nightly miri test
2 changes: 2 additions & 0 deletions src/items/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ mod test {
use crate::{CheckMenuItem, IconMenuItem, MenuId, MenuItem, PredefinedMenuItem, Submenu};

#[test]
#[cfg_attr(all(miri, not(target_os = "linux")), ignore)]
fn it_returns_same_id() {
let id = MenuId::new("1");
assert_eq!(id, MenuItem::with_id(id.clone(), "", true, None).id());
Expand All @@ -34,6 +35,7 @@ mod test {
}

#[test]
#[cfg_attr(all(miri, not(target_os = "linux")), ignore)]
fn test_convert_from_id_and_into_id() {
let id = "TEST ID";
let expected = MenuId(id.to_string());
Expand Down

0 comments on commit a1bcc3e

Please sign in to comment.