OSDN Git Service

Fix CoreTestRunner to not run filtered-out tests.
authorElliott Hughes <enh@google.com>
Mon, 12 Oct 2009 21:08:50 +0000 (14:08 -0700)
committerElliott Hughes <enh@google.com>
Mon, 12 Oct 2009 21:08:50 +0000 (14:08 -0700)
https://android-git.corp.google.com/g/29284 broke test filtering by accidentally
passing the unfiltered test suite to super.doRun.

libcore/luni/src/test/java/com/google/coretests/CoreTestRunner.java
libcore/luni/src/test/java/com/google/coretests/CoreTestSuite.java

index 82e9f54..ad766aa 100644 (file)
@@ -138,7 +138,7 @@ public class CoreTestRunner extends TestRunner {
                 ? new XmlReportPrinter(coreTestSuite)
                 : null;
 
-        TestResult result = super.doRun(suite, wait);
+        TestResult result = super.doRun(coreTestSuite, wait);
 
         if (xmlReportPrinter != null) {
             System.out.print("Printing XML Reports... ");
index 1828c57..fd7531f 100644 (file)
@@ -183,17 +183,13 @@ public class CoreTestSuite implements Test {
                 }
             }
         } else if (test instanceof TestCase) {
-            TestCase caze = (TestCase)test;
+            TestCase testCase = (TestCase)test;
             boolean ignoreMe = false;
 
-            boolean isAndroidOnly = hasAnnotation(caze, 
-                    AndroidOnly.class);
-            boolean isBrokenTest = hasAnnotation(caze, 
-                    BrokenTest.class);
-            boolean isKnownFailure = hasAnnotation(caze, 
-                    KnownFailure.class);
-            boolean isSideEffect = hasAnnotation(caze, 
-                    SideEffect.class);
+            boolean isAndroidOnly = hasAnnotation(testCase, AndroidOnly.class);
+            boolean isBrokenTest = hasAnnotation(testCase, BrokenTest.class);
+            boolean isKnownFailure = hasAnnotation(testCase, KnownFailure.class);
+            boolean isSideEffect = hasAnnotation(testCase, SideEffect.class);
             boolean isNormalTest = 
                     !(isAndroidOnly || isBrokenTest || isKnownFailure ||
                       isSideEffect);