summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Light <allight@google.com>2019-10-01 13:32:03 -0700
committerAlex Light <allight@google.com>2019-10-02 09:34:27 -0700
commit1b5993842baf586102053bad555f40ae8efd1ac8 (patch)
treedbd9fedf8f1cd887b4f0d5041eb5382617ad5532
parentfcbda2c11b61fb44dfffcc630221f78c150c294a (diff)
downloadapache-harmony-1b5993842baf586102053bad555f40ae8efd1ac8.tar.gz
Update AllTests to actually run more of the tests
Around 8 years ago when these tests were first added several test cases were blacklisted because they weren't supported by android. In the time since the features (most of) these tests check have been added. Change the test suite to (optionally) include these cases. This increases the number of tests for the libjdwp configuration from 401 to 417. Test: ./art/tools/run-libjdwp-tests.sh --mode=host Test: ./art/tools/run-jdwp-tests.sh --mode=host --force-run-test Change-Id: I4fd3f98bb93c82aa0a3a83b78d7f2c52b52d8fa8
-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.