Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions crates/client/src/coverage/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ pub const COVERAGE_IGNORE_REGEX: &str = "trident-tests|trident/crates";
pub const PROFRAW_FILENAME: &str = "fuzz-cov-build-%p-%30m.profraw";
pub const JSON_REPORT_FILENAME: &str = "coverage-report.json";
pub const HTML_REPORT_DIRNAME: &str = "coverage-report";
pub const COVERAGE_RUSTFLAGS: &str =
"-C instrument-coverage -C link-arg=-fuse-ld=lld -C link-arg=-lprofiler";
pub const COVERAGE_RUSTFLAGS: &str = "-C instrument-coverage";

// COVERAGE SERVER
pub const SETUP_DYNAMIC_COVERAGE: &str = "/setup-dynamic-coverage";
Expand Down
6 changes: 3 additions & 3 deletions crates/config/src/coverage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::constants::DEFAULT_LOOPCOUNT;

#[derive(Debug, Deserialize, Clone)]
pub struct Coverage {
pub enable: Option<bool>,
pub enabled: Option<bool>,
pub server_port: Option<u16>,
pub loopcount: Option<u64>,
pub format: Option<String>,
Expand All @@ -16,7 +16,7 @@ pub struct Coverage {
impl Default for Coverage {
fn default() -> Self {
Self {
enable: Some(false),
enabled: Some(false),
server_port: Some(DEFAULT_COVERAGE_SERVER_PORT),
loopcount: Some(DEFAULT_LOOPCOUNT),
format: Some(DEFAULT_COVERAGE_FORMAT.to_string()),
Expand All @@ -27,7 +27,7 @@ impl Default for Coverage {

impl Coverage {
pub fn get_enable(&self) -> bool {
self.enable.unwrap_or(false)
self.enabled.unwrap_or(false)
}

pub fn get_server_port(&self) -> u16 {
Expand Down
4 changes: 2 additions & 2 deletions documentation/docs/trident-manifest/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ enabled = true

```bash
[fuzz.coverage]
enable = false
enabled = false
server_port = 58432
loopcount = 0
format = "json"
Expand All @@ -47,7 +47,7 @@ attach_extension = false

The coverage configuration enables code coverage analysis during fuzzing sessions, providing insights into which parts of your program are being tested.

- `enable` - When set to `true`, Trident collects code coverage data throughout the fuzzing session and generates a comprehensive report upon completion.
- `enabled` - When set to `true`, Trident collects code coverage data throughout the fuzzing session and generates a comprehensive report upon completion.
- `server_port` - Specifies the HTTP server port used for communication between Trident and the [Solana VS Code extension](https://marketplace.visualstudio.com/items?itemName=AckeeBlockchain.solana).
- `loopcount` - Defines the number of execution flows processed before generating an intermediate coverage data file. Lower values provide more frequent coverage updates at the cost of performance. When set to `0`, coverage files are only generated at the end of the fuzzing session.
- `format` - Determines the output format for coverage reports. Trident supports both `json` and `html` formats.
Expand Down