-
Notifications
You must be signed in to change notification settings - Fork 9
/
ci.sh
executable file
·38 lines (28 loc) · 1.4 KB
/
ci.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
set -euxo pipefail
cargo install cargo-fuzz
export RUSTFLAGS=-Dwarnings
cargo fmt --check
FEATURESET=(
ekv/page-size-256,ekv/max-page-count-64,ekv/max-value-size-128,ekv/scratch-page-count-4,ekv/align-1
ekv/page-size-256,ekv/max-page-count-256,ekv/max-value-size-1024,ekv/scratch-page-count-8,ekv/align-2
ekv/page-size-1024,ekv/max-page-count-16,ekv/max-value-size-16,ekv/scratch-page-count-0
ekv/page-size-128,ekv/max-page-count-32,ekv/max-value-size-16,ekv/scratch-page-count-0
ekv/page-size-128,ekv/max-page-count-32,ekv/max-value-size-16,ekv/scratch-page-count-0,ekv/crc
)
for FEATURES in ${FEATURESET[@]}; do
cargo test --release --features $FEATURES
cargo clippy --features $FEATURES
# Run `file` fuzzer
cargo fuzz run --sanitizer none -j$(nproc) file --features $FEATURES -- -max_total_time=30
# Run `ops` fuzzer
cargo fuzz run --sanitizer none -j$(nproc) ops --features $FEATURES -- -max_total_time=30
# Run `read` fuzzer. Seed it with a flash image with stuff in it.
cargo run --release --example smoke --features $FEATURES
rm -rf fuzz/corpus/read
mkdir -p fuzz/corpus/read
mv out.bin fuzz/corpus/read
cargo fuzz run --sanitizer none -j$(nproc) read --features $FEATURES -- -max_total_time=30
done
(cd examples/nrf; cargo fmt --check; cargo build --release --features defmt)
(cd examples/rp2040; cargo fmt --check; cargo build --release)