-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathJustfile
More file actions
76 lines (61 loc) · 3.02 KB
/
Copy pathJustfile
File metadata and controls
76 lines (61 loc) · 3.02 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
set shell := ["zsh", "-cu"]
build:
cargo build-sbf --manifest-path crates/roshi/Cargo.toml
test:
cargo test
# One-time fetch of the Metaplex Token Metadata binary used by the
# share-metadata integration tests (they skip when it is absent).
fetch-mpl:
solana program dump metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s crates/tests/fixtures/mpl_token_metadata.so --url https://api.mainnet-beta.solana.com
test-sbf: build
cargo test -p roshi-tests
check:
cargo fmt -- --check
cargo check
cargo check -p roshi --no-default-features
cargo test -p roshi
cargo build-sbf --manifest-path crates/roshi/Cargo.toml
cargo test -p roshi-tests
# Crucible invariant fuzzing (harness in fuzz/, engine vendored as the
# vendor/crucible submodule). One-time CLI install:
# git submodule update --init vendor/crucible
# cargo install --path vendor/crucible/crates/crucible-fuzz-cli
# `build` refreshes target/deploy/roshi.so, which the harness loads. `-C fuzz`
# points the CLI at the flattened harness dir.
# Stateless fuzz: full mutated sequence per iteration.
fuzz test='invariant_core' secs='60': build
crucible run roshi {{test}} -C fuzz --release --corpus-in fuzz/corpus --timeout {{secs}}
# Stateful fuzz: one action per iteration over a live state pool (higher throughput).
fuzz-stateful test='invariant_core' secs='60' cores='8': build
crucible run roshi {{test}} -C fuzz --release --stateful --cores {{cores}} --corpus-in fuzz/corpus --timeout {{secs}}
# Source-level coverage (LCOV + HTML; needs `genhtml` from lcov).
fuzz-cov test='invariant_core' secs='60': build
crucible run roshi {{test}} -C fuzz --release --coverage --corpus-in fuzz/corpus --timeout {{secs}} --lcov-out fuzz/coverage/lcov.info
genhtml fuzz/coverage/lcov.info -o fuzz/coverage/html
# List recorded crashes for a harness.
fuzz-crashes test='invariant_core':
crucible show roshi -C fuzz --crashes-dir fuzz/crashes/{{test}}
# Inspect one recorded crash. Pass the crash filename or path.
fuzz-show crash test='invariant_core':
crucible show roshi {{crash}} -C fuzz --crashes-dir fuzz/crashes/{{test}}
# Replay one input file. Use this for raw crashes or committed regressions.
fuzz-replay input test='invariant_core': build
crucible run roshi {{test}} -C fuzz --release --replay {{input}}
# Minimize one recorded crash in place; pass the filename under fuzz/crashes/{{test}}.
fuzz-tmin crash test='invariant_core': build
crucible tmin roshi {{test}} {{crash}} -C fuzz --release
# Minimize all recorded crashes for a harness in place.
fuzz-tmin-all test='invariant_core': build
crucible tmin roshi {{test}} --all -C fuzz --release
# Replay committed regression inputs. A fixed regression should not reproduce.
fuzz-regressions test='invariant_core': build
#!/usr/bin/env zsh
set -e
files=(fuzz/regressions/{{test}}/*(.N))
if (( $#files == 0 )); then
echo "no fuzz regressions for {{test}}"
exit 0
fi
for file in $files; do
crucible run roshi {{test}} -C fuzz --release --replay "$file"
done