Allow the user to specify the packages to test.
Change-Id: Idc9fe831a6d91c55b97936860144ab85a471c03f
diff --git a/run-harmony-tests b/run-harmony-tests
index 7553347..5d32489 100755
--- a/run-harmony-tests
+++ b/run-harmony-tests
@@ -3,18 +3,21 @@
# Make sure there's a vogar on the path, but prefer the user's one.
export PATH=$PATH:~dalvik-prebuild/vogar/bin
-VOGAR="vogar $VOGAR_FLAGS $*"
+VOGAR="vogar $VOGAR_FLAGS"
# We enumerate the test packages for vogar rather than just giving it the classes.jar
# so hundreds of packages can be tested in parallel, rather than one big jar file serially.
-all_test_packages=$(find external/apache-harmony/*/src/test -name "*.java" | \
+all_test_packages=$(find `dirname $0`/*/src/test -name "*.java" | \
fgrep -v junit | \
fgrep -v org/w3c/domts | \
fgrep -v support/src/test/java | \
xargs grep -h '^package ' | sed 's/^package //' | sed 's/;$//' | sort | uniq | tr "\n" " ")
+# Use the list of packages supplied on the command-line, if any.
+test_packages=${*:-$all_test_packages}
+
echo "Running tests for following test packages:"
-echo $all_test_packages | tr " " "\n"
+echo $test_packages | tr " " "\n"
# beans: works, except IndexedPropertyDescriptorTest won't load
# concurrent: needs vogar to detect code type in the target VM
@@ -26,5 +29,5 @@
--vm-arg -Xmx32M \
--classpath out/host/common/obj/JAVA_LIBRARIES/apache-harmony-tests-hostdex_intermediates/javalib.jar \
--results-dir /home/dalvik-prebuild/vogar-harmony-results \
- $all_test_packages \
+ $test_packages \
|| true