diff options
| author | 2020-12-17 22:26:48 +0000 | |
|---|---|---|
| committer | 2021-06-03 13:59:27 +0000 | |
| commit | 95c9e35d0d273aa64379a9bb3fa3af7debbf41cd (patch) | |
| tree | bfaa1085055b64579b77e573a09107ac8540d143 | |
| parent | c11aa0209b2f8fcc303766735130b3aa3655d31e (diff) | |
Make it possible to pass specific APEXes to test on the command line.
Test: art/build/apex/runtests.sh com.android.art.host
Test: art/build/apex/runtests.sh
Bug: 175898636
Change-Id: I42f47dbf57af663478848a1b80459a0fab308e7d
Merged-In: I42f47dbf57af663478848a1b80459a0fab308e7d
(cherry picked from commit 3c9d9c97ef8f525525523480bd5c757342e62f9c)
| -rwxr-xr-x | build/apex/runtests.sh | 33 |
1 files changed, 19 insertions, 14 deletions
diff --git a/build/apex/runtests.sh b/build/apex/runtests.sh index 6b72bfcaf0..d4ecbcada7 100755 --- a/build/apex/runtests.sh +++ b/build/apex/runtests.sh @@ -68,8 +68,9 @@ print_file_sizes_p=false function usage { cat <<EOF -Usage: $0 [OPTION] -Build (optional) and run tests on ART APEX package (on host). +Usage: $0 [OPTION] [apexes...] +Build (optional) and run tests on ART APEX package (on host). Defaults to all +applicable APEXes if none is given on the command line. -B, --skip-build skip the build step -l, --list-files list the contents of the ext4 image (\`find\`-like style) @@ -81,6 +82,8 @@ EOF exit } +apex_modules=() + while [[ $# -gt 0 ]]; do case "$1" in (-B|--skip-build) build_apex_p=false;; @@ -88,8 +91,9 @@ while [[ $# -gt 0 ]]; do (-t|--print-tree) print_image_tree_p=true;; (-s|--print-sizes) print_file_sizes_p=true;; (-h|--help) usage;; - (*) die "Unknown option: '$1' + (-*) die "Unknown option: '$1' Try '$0 --help' for more information.";; + (*) apex_modules+=($1);; esac shift done @@ -129,17 +133,18 @@ function fail_check { exit_status=1 } -# Test all modules, if possible. - -apex_modules=( - "com.android.art" - "com.android.art.debug" - "com.android.art.testing" -) -if [[ "$HOST_PREFER_32_BIT" = true ]]; then - say "Skipping com.android.art.host, as \`HOST_PREFER_32_BIT\` equals \`true\`" -else - apex_modules+=("com.android.art.host") +if [ ${#apex_modules[@]} -eq 0 ]; then + # Test as many modules as possible. + apex_modules=( + "com.android.art" + "com.android.art.debug" + "com.android.art.testing" + ) + if [[ "$HOST_PREFER_32_BIT" = true ]]; then + say "Skipping com.android.art.host, as \`HOST_PREFER_32_BIT\` equals \`true\`" + else + apex_modules+=("com.android.art.host") + fi fi # Build the APEX packages (optional). |