Skip to content

Commit

Permalink
Show metrics on -vv
Browse files Browse the repository at this point in the history
  • Loading branch information
grandizzy committed Oct 22, 2024
1 parent 4dc2aeb commit 02cddae
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions crates/forge/bin/cmd/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -614,14 +614,14 @@ impl TestArgs {
if !silent {
shell::println(result.short_result(name))?;

if let TestKind::Invariant { runs: _, calls: _, reverts: _, metrics } =
&result.kind
{
print_invariant_metrics(metrics);
}

// We only display logs at level 2 and above
if verbosity >= 2 {
// Display invariant metrics if invariant kind.
if let TestKind::Invariant { runs: _, calls: _, reverts: _, metrics } =
&result.kind
{
print_invariant_metrics(metrics);
}
// We only decode logs from Hardhat and DS-style console events
let console_logs = decode_console_logs(&result.logs);
if !console_logs.is_empty() {
Expand Down
2 changes: 1 addition & 1 deletion crates/forge/tests/it/invariant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ contract AnotherCounterHandler is Test {
)
.unwrap();

cmd.args(["test", "--mt", "invariant_"]).assert_success().stdout_eq(str![[r#"
cmd.args(["test", "--mt", "invariant_", "-vv"]).assert_success().stdout_eq(str![[r#"
...
Ran 2 tests for test/SelectorMetricsTest.t.sol:CounterTest
[PASS] invariant_counter() (runs: 10, calls: 5000, reverts: [..])
Expand Down

0 comments on commit 02cddae

Please sign in to comment.