Skip to content

Commit

Permalink
feat(forge): add contract ignore list for gas reports (#2528)
Browse files Browse the repository at this point in the history
* feat(forge): add contract ignore list for gas reports

* Update cli/tests/it/cmd.rs

Co-authored-by: Matthias Seitz <[email protected]>

Co-authored-by: Georgios Konstantopoulos <[email protected]>
Co-authored-by: Matthias Seitz <[email protected]>
  • Loading branch information
3 people authored Aug 10, 2022
1 parent da1f9f4 commit 6cd6618
Show file tree
Hide file tree
Showing 8 changed files with 429 additions and 17 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion cli/src/cmd/forge/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ fn test(
let handle = thread::spawn(move || runner.test(&filter, Some(tx), test_options).unwrap());

let mut results: BTreeMap<String, SuiteResult> = BTreeMap::new();
let mut gas_report = GasReport::new(config.gas_reports);
let mut gas_report = GasReport::new(config.gas_reports, config.gas_reports_ignore);
for (contract_name, suite_result) in rx {
let mut tests = suite_result.test_results.clone();
println!();
Expand Down
2 changes: 2 additions & 0 deletions cli/test-utils/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,8 @@ impl TestCommand {
}

/// Runs the command and prints its output
/// You have to pass --nocapture to cargo test or the print won't be displayed.
/// The full command would be: cargo test -- --nocapture
pub fn print_output(&mut self) {
let output = self.execute();
println!("stdout: {}", String::from_utf8_lossy(&output.stdout));
Expand Down
Loading

0 comments on commit 6cd6618

Please sign in to comment.