Resync a load of tests with upstream, make our build faster.
I started off with a mission to remove uses of dalvik.annotation.* (stuff
like @TestTargetNew and other useless junk that just makes it harder to
stay in sync with upstream). I wrote a script to go through tests showing
me the diff between what we have and what upstream has, thinking that in
cases where upstream has also added tests, I may as well pull them in at
the same time...
...but I didn't realize how close we were to having dx fill its 1.5GiB heap.
After trying various alternatives, I decided to bite the bullet and break
core-tests up into one .jar per module. This adds parallelism back into this,
the slowest part of our build. (I can do even better, but I'll do that in a
separate patch, preferably after we've merged recent changes from master.)
Only a couple of dependencies were problematic: the worthless TestSuiteFactory
which already contained a comment suggesting we get rid of it, and the fact
that some tests -- most notably the concurrent ones -- also contained main
methods that started the JUnit tty-based TestRunner.
(In the long run, we want to be running the harmony tests directly from a
pristine "svn co" of upstream, using DalvikRunner. But this will be a big
help in the meantime, and starts the work of getting our current copy of
the tests into a state where we can start to extract any meaningful
changes/additions we've made.)
diff --git a/run-core-tests b/run-core-tests
index 3359dde..ba858f2 100755
--- a/run-core-tests
+++ b/run-core-tests
@@ -25,12 +25,20 @@
mkdir $tmp
chmod 777 $tmp
+modules="annotation archive concurrent crypto dom icu logging luni-kernel \
+ luni math nio nio_char prefs regex security sql suncompat support \
+ text x-net xml"
+classpath=""
+for module in $modules; do
+ classpath="$classpath:/system/framework/core-tests-$module.jar"
+done
+
exec dalvikvm \
-Duser.name=root \
-Duser.language=en \
-Duser.region=US \
-Djava.io.tmpdir=$tmp \
-Djavax.net.ssl.trustStore=/system/etc/security/cacerts.bks \
- -classpath /system/framework/core-tests.jar \
+ -classpath $classpath \
-Xcheck:jni \
-Xmx64M com.google.coretests.Main "$@"