Allow DalvikRunner to run tests in core library packages.
This is a bit of a hack, but I think it's not unreasonable, given the purpose
of this tool (and the fact that we both favor writing our tests in the package
they're testing).
Bug: 2362187
diff --git a/libcore/tools/runner/java/dalvik/runner/Dx.java b/libcore/tools/runner/java/dalvik/runner/Dx.java
index 83f1265..d36a99d 100644
--- a/libcore/tools/runner/java/dalvik/runner/Dx.java
+++ b/libcore/tools/runner/java/dalvik/runner/Dx.java
@@ -22,8 +22,13 @@
final class Dx {
public void dex(String output, Classpath classpath) {
+ // We pass --core-library so that we can write tests in the same package they're testing,
+ // even when that's a core library package. If you're actually just using this tool to
+ // execute arbitrary code, this has the unfortunate side-effect of preventing "dx" from
+ // protecting you from yourself.
new Command.Builder()
.args("dx")
+ .args("--core-library")
.args("--dex")
.args("--output=" + output)
.args(Strings.objectsToStrings(classpath.getElements()))