summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Light <allight@google.com>2019-10-02 15:28:57 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-10-02 15:28:57 -0700
commit82569fea724820978826784cb2fb765ccf7841fb (patch)
treedbd9fedf8f1cd887b4f0d5041eb5382617ad5532
parent8a0b5e9ca51063573294ad4c4fae604246599c52 (diff)
parent717687e6e29329ebb2f404e6ea7f44aa20a8ac0f (diff)
downloadapache-harmony-82569fea724820978826784cb2fb765ccf7841fb.tar.gz
Merge "Update AllTests to actually run more of the tests" am: 92efcfdc7c am: c83a2592d5 am: 2cfcbb59a8
am: 717687e6e2 Change-Id: I15df1a4213a4689d49128669a3a3c0a9dbaa29d1
-rw-r--r--jdwp/src/test/java/org/apache/harmony/jpda/tests/share/AllTests.java50
-rw-r--r--jdwp/src/test/java/org/apache/harmony/jpda/tests/share/JPDATestOptions.java11
2 files changed, 38 insertions, 23 deletions
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/share/AllTests.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/share/AllTests.java
index 575cb45..e0ed276 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/share/AllTests.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/share/AllTests.java
@@ -36,34 +36,38 @@ public class AllTests {
public static junit.framework.Test suite() {
junit.framework.TestSuite suite = new junit.framework.TestSuite();
- //
- // "TODO".
- //
+ // All of these tests can only be run using the full JDWP implementation. They weren't really
+ // used by IDEs/aren't really applicable to android so were never supported by the
+ // -XjdwpProvider:internal JDWP implementation. The new agent based implementation supports them
+ // though.
+ JPDATestOptions to = new JPDATestOptions();
+ if (to.getSuiteType().equals("full") || to.getSuiteType().equals("libjdwp")) {
+ // I haven't yet found an IDE that will use these, but we might want to implement them anyway.
+ suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.Events.MonitorContendedEnteredTest.class);
+ suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.Events.MonitorContendedEnterTest.class);
+ suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.Events.MonitorWaitedTest.class);
+ suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.Events.MonitorWaitTest.class);
- // I haven't yet found an IDE that will use these, but we might want to implement them anyway.
- //suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.Events.MonitorContendedEnteredTest.class);
- //suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.Events.MonitorContendedEnterTest.class);
- //suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.Events.MonitorWaitedTest.class);
- //suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.Events.MonitorWaitTest.class);
+ // I don't know when these are ever used, but they're not obviously useless.
+ suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.ReferenceType.NestedTypesTest.class);
+ suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.VirtualMachine.HoldEventsTest.class);
+ suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.VirtualMachine.ReleaseEventsTest.class);
- // I don't know when these are ever used, but they're not obviously useless.
- //suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.DebuggerOnDemand.OnthrowDebuggerLaunchTest.class);
- //suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.ReferenceType.NestedTypesTest.class);
- //suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.VirtualMachine.HoldEventsTest.class);
- //suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.VirtualMachine.ReleaseEventsTest.class);
+ // Internal JDWP implementation never supported this.
+ suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.ThreadReference.StopTest.class);
+ }
//
- // "Will not fix".
+ // These tests are not worth fixing or fundamentally do not make sense on android.
//
-
- // It's not obvious how to translate this into our world, or what debuggers would do with it.
- //suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.ReferenceType.ClassFileVersionTest.class);
-
- // We don't implement Thread.stop at all, so it doesn't make sense for us to implement the JDWP.
- //suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.ThreadReference.StopTest.class);
-
- // We don't implement class unloading.
- //suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.Events.ClassUnloadTest.class);
+ if (to.getSuiteType().equals("full")) {
+ // It's not obvious how to translate this into our world, or what debuggers would do with it.
+ suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.ReferenceType.ClassFileVersionTest.class);
+ // TODO The test suite itself seems to send incorrect commands when this is run.
+ suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.DebuggerOnDemand.OnthrowDebuggerLaunchTest.class);
+ // TODO We don't implement class unloading in the way the test expects.
+ suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.Events.ClassUnloadTest.class);
+ }
suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.ArrayReference.GetValuesTest.class);
suite.addTestSuite(org.apache.harmony.jpda.tests.jdwp.ArrayReference.LengthTest.class);
diff --git a/jdwp/src/test/java/org/apache/harmony/jpda/tests/share/JPDATestOptions.java b/jdwp/src/test/java/org/apache/harmony/jpda/tests/share/JPDATestOptions.java
index adf773a..e6825b3 100644
--- a/jdwp/src/test/java/org/apache/harmony/jpda/tests/share/JPDATestOptions.java
+++ b/jdwp/src/test/java/org/apache/harmony/jpda/tests/share/JPDATestOptions.java
@@ -40,6 +40,17 @@ import org.apache.harmony.jpda.tests.framework.TestOptions;
public class JPDATestOptions extends TestOptions {
/**
+ * Returns what test suite we should use if running AllTests. May be "internal" (for the test
+ * suite corresponding to -XjdwpProvider:internal), "libjdwp" (for the test suite corresponding
+ * to -XjdwpProvider:adbconnection) or "full" for everything.
+ *
+ * @return option "jpda.settings.testSuiteType" or "internal" by default.
+ */
+ public String getSuiteType() {
+ return System.getProperty("jpda.settings.testSuiteType", "internal");
+ }
+
+ /**
* Returns kind of launching debuggee VM, which can be "auto" or "manual".
*
* @return option "jpda.settings.debuggeeLaunchKind" or "auto" by default.