Skip to content

Commit 9013c83

Browse files
authored
Merge pull request #13 from Alexhuszagh/fuzz
Add miri and fuzz targets to our CI.
2 parents 31d1abf + 04cd614 commit 9013c83

File tree

4 files changed

+49
-2
lines changed

4 files changed

+49
-2
lines changed

.github/workflows/fuzz.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Fuzz
2+
3+
on:
4+
[pull_request, workflow_dispatch]
5+
6+
jobs:
7+
fuzz:
8+
name: Fuzz ${{matrix.target}}
9+
runs-on: ubuntu-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
target: [fast_float, roundtrip_f64]
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
submodules: recursive
18+
- uses: dtolnay/rust-toolchain@master
19+
with:
20+
toolchain: nightly
21+
- run: cargo install cargo-fuzz
22+
- run: cargo check
23+
- run: |
24+
cd fuzz
25+
cargo +nightly fuzz run --release ${{matrix.target}} -- -max_total_time=300

.github/workflows/miri.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Miri
2+
3+
on:
4+
[pull_request, workflow_dispatch]
5+
6+
jobs:
7+
miri:
8+
name: Miri
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
with:
13+
submodules: recursive
14+
- uses: dtolnay/rust-toolchain@stable
15+
with:
16+
toolchain: nightly
17+
- run: cargo check
18+
- run: cargo build
19+
- run: |
20+
rustup component add --toolchain nightly miri
21+
cargo miri test

fuzz/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ cargo-fuzz = true
1212
members = ["."]
1313

1414
[dependencies]
15-
fast-float = { path = ".." }
16-
libfuzzer-sys = "0.3"
15+
fast-float2 = { path = ".." }
16+
libfuzzer-sys = "0.4.7"
1717
ryu = "1.0"
1818

1919
[[bin]]

src/table.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ mod tests {
4141
}
4242

4343
#[test]
44+
#[cfg_attr(miri, ignore)]
4445
fn test_pow5_table() {
4546
for q in SMALLEST_POWER_OF_FIVE..=LARGEST_POWER_OF_FIVE {
4647
let (hi, lo) = compute_pow5_128(q);

0 commit comments

Comments
 (0)