From 3d14bf44b11396366465536067c65c046c47d33e Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Mon, 29 Jan 2024 13:45:08 -0700 Subject: Improve Ravenwood logging/messages. Emit "TestRunner" log messages around each test method, so that our local debugging logs match what developers experience with tests run on a physical device. Refine `onThrowMethodCalled()` message to be more descriptive about Ravenwood and link to docs. Bug: 322817109, 322526754 Test: atest FrameworksCoreTestsRavenwood Change-Id: Id9f6a936145dd2024295c2eb14666fc43a5c7e34 --- .../junit-src/android/platform/test/ravenwood/RavenwoodRule.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ravenwood/junit-src') diff --git a/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodRule.java b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodRule.java index 1e7cbf6d802d..0285b386ed13 100644 --- a/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodRule.java +++ b/ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodRule.java @@ -280,9 +280,14 @@ public class RavenwoodRule implements TestRule { public void evaluate() throws Throwable { Assume.assumeTrue(shouldEnableOnRavenwood(description)); + RavenwoodRuleImpl.logTestRunner("started", description); RavenwoodRuleImpl.init(RavenwoodRule.this); try { base.evaluate(); + RavenwoodRuleImpl.logTestRunner("finished", description); + } catch (Throwable t) { + RavenwoodRuleImpl.logTestRunner("failed", description); + throw t; } finally { RavenwoodRuleImpl.reset(RavenwoodRule.this); } @@ -300,6 +305,8 @@ public class RavenwoodRule implements TestRule { @Override public void evaluate() throws Throwable { Assume.assumeFalse(shouldStillIgnoreInProbeIgnoreMode(description)); + + RavenwoodRuleImpl.logTestRunner("started", description); RavenwoodRuleImpl.init(RavenwoodRule.this); try { base.evaluate(); @@ -309,6 +316,7 @@ public class RavenwoodRule implements TestRule { Assume.assumeTrue(shouldEnableOnRavenwood(description)); throw t; } finally { + RavenwoodRuleImpl.logTestRunner("finished", description); RavenwoodRuleImpl.reset(RavenwoodRule.this); } -- cgit v1.2.3-59-g8ed1b