Revert^2 "Enable run-libcore-tests.sh to test specific packages"
This reverts commit 2a05a9bcd2b4f30d12a925dc96961c3e78d886e2.
Test: art/tools/run-libcore-tests.sh --mode=host --variant=X64 -- libcore.java.lang.invoke
Change-Id: I05a486db0a33cf89e97da4a5343264e2df561e10
diff --git a/tools/run-libcore-tests.sh b/tools/run-libcore-tests.sh
index 1638500..31bd600 100755
--- a/tools/run-libcore-tests.sh
+++ b/tools/run-libcore-tests.sh
@@ -59,7 +59,7 @@
local me=$(basename "${BASH_SOURCE[0]}")
(
cat << EOF
- Usage: ${me} --mode=<mode> [options]
+ Usage: ${me} --mode=<mode> [options] [-- <package_to_test> ...]
Run libcore tests using the vogar testing tool.
@@ -75,6 +75,10 @@
The script passes unrecognized options to the command-line created for vogar.
+ The script runs a hardcoded list of libcore test packages by default. The user
+ may run a subset of packages by appending '--' followed by a list of package
+ names.
+
Examples:
1. Run full test suite on host:
@@ -82,6 +86,9 @@
2. Run full test suite on device:
${me} --mode=device
+
+ 3. Run tests only from the libcore.java.lang package on device:
+ ${me} --mode=device -- libcore.java.lang
EOF
) | sed -e 's/^ //' >&2 # Strip leading whitespace from heredoc.
}
@@ -213,6 +220,12 @@
--dry-run)
dry_run=true
;;
+ --)
+ shift
+ # Assume remaining elements are packages to test.
+ user_packages=("$@")
+ break
+ ;;
--help)
usage
exit 1
@@ -276,7 +289,9 @@
expectations="$expectations --expectations art/tools/libcore_gcstress_debug_failures.txt"
fi
else
- # We only run this package when not under gcstress as it can cause timeouts. See b/78228743.
+ # We only run this package when user has not specified packages
+ # to run and not under gcstress as it can cause timeouts. See
+ # b/78228743.
working_packages+=("libcore.libcore.icu")
fi
@@ -291,6 +306,12 @@
vogar_args="$vogar_args --no-color"
fi
+# Override working_packages if user provided specific packages to
+# test.
+if [[ ${#user_packages[@]} != 0 ]] ; then
+ working_packages=("${user_packages[@]}")
+fi
+
# Run the tests using vogar.
echo "Running tests for the following test packages:"
echo ${working_packages[@]} | tr " " "\n"