summaryrefslogtreecommitdiff
path: root/ravenwood/junit-impl-src/android
diff options
context:
space:
mode:
author Makoto Onuki <omakoto@google.com> 2024-10-24 12:06:38 -0700
committer Makoto Onuki <omakoto@google.com> 2024-10-24 13:42:49 -0700
commitdb258ce57c750f140962d54adeb22ffb2039a2d8 (patch)
tree9eb5a66af131f7c963d0e106b84630b01bb308a7 /ravenwood/junit-impl-src/android
parentb1071dc678849cb9608909590165db5dc160d728 (diff)
Add a script to dump latest test result summary.
Also now we count assumption failures as skip properly Flag: EXEMPT host test change only Bug: 292141694 Test: ./ravenwood-test-summary Change-Id: Ia756eff4fb9b619ae91372b4769428d2ef288e33
Diffstat (limited to 'ravenwood/junit-impl-src/android')
-rw-r--r--ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodAwareTestRunnerHook.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodAwareTestRunnerHook.java b/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodAwareTestRunnerHook.java
index 478bead1354f..e0f9ec94a819 100644
--- a/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodAwareTestRunnerHook.java
+++ b/ravenwood/junit-impl-src/android/platform/test/ravenwood/RavenwoodAwareTestRunnerHook.java
@@ -25,6 +25,7 @@ import android.util.Log;
import androidx.test.platform.app.InstrumentationRegistry;
+import org.junit.AssumptionViolatedException;
import org.junit.runner.Description;
import org.junit.runners.model.TestClass;
@@ -134,8 +135,17 @@ public class RavenwoodAwareTestRunnerHook {
if (scope == Scope.Instance && order == Order.Outer) {
// End of a test method.
runner.mState.exitTestMethod();
- RavenwoodTestStats.getInstance().onTestFinished(classDescription, description,
- th == null ? Result.Passed : Result.Failed);
+
+ final Result result;
+ if (th == null) {
+ result = Result.Passed;
+ } else if (th instanceof AssumptionViolatedException) {
+ result = Result.Skipped;
+ } else {
+ result = Result.Failed;
+ }
+
+ RavenwoodTestStats.getInstance().onTestFinished(classDescription, description, result);
}
// If RUN_DISABLED_TESTS is set, and the method did _not_ throw, make it an error.