From ef36819d811c8293a91458d47aa0989d0c3456cb Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Thu, 15 Feb 2024 01:48:28 +0100 Subject: [PATCH 1/2] feat: print total duration in final test summary --- crates/forge/src/result.rs | 3 ++- crates/test-utils/src/util.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/forge/src/result.rs b/crates/forge/src/result.rs index 2e22adc85b21..cb53756551d7 100644 --- a/crates/forge/src/result.rs +++ b/crates/forge/src/result.rs @@ -126,9 +126,10 @@ impl TestOutcome { let total_skipped = self.skipped(); let total_tests = total_passed + total_failed + total_skipped; format!( - "\nRan {} test {}: {} tests passed, {} failed, {} skipped ({} total tests)", + "\nRan {} test {} in {:.2?}: {} tests passed, {} failed, {} skipped ({} total tests)", num_test_suites, suites, + self.duration(), Paint::green(total_passed), Paint::red(total_failed), Paint::yellow(total_skipped), diff --git a/crates/test-utils/src/util.rs b/crates/test-utils/src/util.rs index ca081bf63edc..79d9372da3d9 100644 --- a/crates/test-utils/src/util.rs +++ b/crates/test-utils/src/util.rs @@ -1054,7 +1054,7 @@ static IGNORE_IN_FIXTURES: Lazy = Lazy::new(|| { // solc runs r"runs: \d+, μ: \d+, ~: \d+", // elapsed time - "finished in .*?s", + " ?in .*?s", // file paths r"-->.*\.sol", r"Location(.|\n)*\.rs(.|\n)*Backtrace", From 6f239133ecd96746b4f7aecefcb02543ae260a43 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Thu, 15 Feb 2024 02:10:16 +0100 Subject: [PATCH 2/2] fix: ignore regex --- crates/test-utils/src/util.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/test-utils/src/util.rs b/crates/test-utils/src/util.rs index 79d9372da3d9..f5beda778563 100644 --- a/crates/test-utils/src/util.rs +++ b/crates/test-utils/src/util.rs @@ -1054,7 +1054,7 @@ static IGNORE_IN_FIXTURES: Lazy = Lazy::new(|| { // solc runs r"runs: \d+, μ: \d+, ~: \d+", // elapsed time - " ?in .*?s", + "(?:finished)? ?in .*?s", // file paths r"-->.*\.sol", r"Location(.|\n)*\.rs(.|\n)*Backtrace",