Skip to content

Commit

Permalink
Add Miri tests to CI
Browse files Browse the repository at this point in the history
Miri is the unsound/undefined behavior checker for unsafe Rust.
  • Loading branch information
Posnet committed May 7, 2024
1 parent 22cf762 commit 2b09985
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,19 @@ jobs:
- run: cargo clippy --all-features -- -D warnings
- run: cargo clippy --no-default-features -- -D warnings

miri:
name: Miri
runs-on: ubuntu-latest
env:
# Needed since the tests interact with the filesystem
MIRIFLAGS: "-Zmiri-disable-isolation"
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@nightly
with:
components: miri
- run: cargo miri test --all-features

doc:
name: Build documentation
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion src/capture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use crate::pcap::parse_pcap_header;
use crate::pcapng::parse_sectionheaderblock;
use crate::traits::PcapReaderIterator;
use crate::{LegacyPcapReader, PcapNGReader};
use oval::Buffer;
use nom::Needed;
use oval::Buffer;
use std::io::Read;

/// Generic interface for PCAP or PCAPNG file access
Expand Down
2 changes: 1 addition & 1 deletion src/pcap/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ use crate::pcap::{
LegacyPcapBlock, PcapHeader,
};
use crate::traits::PcapReaderIterator;
use oval::Buffer;
use nom::{IResult, Needed, Offset};
use oval::Buffer;
use std::io::Read;

/// Parsing iterator over legacy pcap data (streaming version)
Expand Down
2 changes: 1 addition & 1 deletion src/pcapng/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use crate::blocks::PcapBlockOwned;
use crate::error::PcapError;
use crate::pcapng::*;
use crate::traits::PcapReaderIterator;
use oval::Buffer;
use nom::{Needed, Offset};
use oval::Buffer;
use std::io::Read;

/// Parsing iterator over pcap-ng data (streaming version)
Expand Down

0 comments on commit 2b09985

Please sign in to comment.