summaryrefslogtreecommitdiff
path: root/ravenwood/junit-src
diff options
context:
space:
mode:
author Jeff Sharkey <jsharkey@google.com> 2024-01-29 13:45:08 -0700
committer Jeff Sharkey <jsharkey@google.com> 2024-01-30 09:04:25 -0700
commit3d14bf44b11396366465536067c65c046c47d33e (patch)
tree2e9315660478598d0ec34aa33ee496999a18752d /ravenwood/junit-src
parent9614500d620911e1cd670c7d8f8f7b6f85af7fc9 (diff)
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
Diffstat (limited to 'ravenwood/junit-src')
-rw-r--r--ravenwood/junit-src/android/platform/test/ravenwood/RavenwoodRule.java8
1 files changed, 8 insertions, 0 deletions
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);
}