Nicolas Geoffray | b2e7e24 | 2014-11-28 14:24:28 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # Copyright (C) 2014 The Android Open Source Project |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | if [ ! -d libcore ]; then |
| 18 | echo "Script needs to be run at the root of the android tree" |
| 19 | exit 1 |
| 20 | fi |
| 21 | |
Andreas Gampe | ebd089d | 2016-07-18 14:56:56 -0700 | [diff] [blame] | 22 | if [ -z "$ANDROID_PRODUCT_OUT" ] ; then |
| 23 | JAVA_LIBRARIES=out/target/common/obj/JAVA_LIBRARIES |
| 24 | else |
| 25 | JAVA_LIBRARIES=${ANDROID_PRODUCT_OUT}/../../common/obj/JAVA_LIBRARIES |
| 26 | fi |
| 27 | |
Tobias Thierer | b3ec089 | 2016-08-03 16:13:04 +0100 | [diff] [blame] | 28 | function cparg { |
| 29 | for var |
| 30 | do |
| 31 | printf -- "--classpath ${JAVA_LIBRARIES}/${var}_intermediates/classes.jack "; |
| 32 | done |
| 33 | } |
Wojciech Staszkiewicz | 08cf148 | 2015-05-21 17:31:38 +0100 | [diff] [blame] | 34 | |
Tobias Thierer | b3ec089 | 2016-08-03 16:13:04 +0100 | [diff] [blame] | 35 | DEPS="core-tests jsr166-tests mockito-target" |
Wojciech Staszkiewicz | 08cf148 | 2015-05-21 17:31:38 +0100 | [diff] [blame] | 36 | |
Tobias Thierer | b3ec089 | 2016-08-03 16:13:04 +0100 | [diff] [blame] | 37 | for lib in $DEPS |
| 38 | do |
| 39 | if [ ! -f "${JAVA_LIBRARIES}/${lib}_intermediates/classes.jack" ]; then |
| 40 | echo "${lib} is missing. Before running, you must run art/tools/buildbot-build.sh" |
| 41 | exit 1 |
| 42 | fi |
| 43 | done |
Nicolas Geoffray | b2e7e24 | 2014-11-28 14:24:28 +0000 | [diff] [blame] | 44 | |
Roland Levillain | afd6f9e | 2016-01-11 15:51:00 +0000 | [diff] [blame] | 45 | expectations="--expectations art/tools/libcore_failures.txt" |
Roland Levillain | afd6f9e | 2016-01-11 15:51:00 +0000 | [diff] [blame] | 46 | |
Nicolas Geoffray | f794ad7 | 2015-09-11 12:08:49 +0100 | [diff] [blame] | 47 | emulator="no" |
| 48 | if [ "$ANDROID_SERIAL" = "emulator-5554" ]; then |
| 49 | emulator="yes" |
| 50 | fi |
| 51 | |
Roland Levillain | 5db109b | 2016-05-19 12:24:17 +0100 | [diff] [blame] | 52 | # Use JIT compiling by default. |
| 53 | use_jit=true |
| 54 | |
Nicolas Geoffray | c3837e4 | 2014-12-03 11:30:26 +0000 | [diff] [blame] | 55 | # Packages that currently work correctly with the expectation files. |
Nicolas Geoffray | 1f8dbf8 | 2015-06-13 13:19:16 +0000 | [diff] [blame] | 56 | working_packages=("dalvik.system" |
Brian Carlstrom | 4c78ffa | 2015-06-11 07:33:51 -0700 | [diff] [blame] | 57 | "libcore.icu" |
David Brazdil | 598b220 | 2015-02-24 10:12:06 +0000 | [diff] [blame] | 58 | "libcore.io" |
| 59 | "libcore.java.lang" |
Nicolas Geoffray | c3837e4 | 2014-12-03 11:30:26 +0000 | [diff] [blame] | 60 | "libcore.java.math" |
David Brazdil | 598b220 | 2015-02-24 10:12:06 +0000 | [diff] [blame] | 61 | "libcore.java.text" |
Nicolas Geoffray | 3cdf818 | 2014-12-01 10:12:15 +0000 | [diff] [blame] | 62 | "libcore.java.util" |
David Brazdil | 4cd7dfd | 2015-02-24 13:33:01 +0000 | [diff] [blame] | 63 | "libcore.javax.crypto" |
David Brazdil | 598b220 | 2015-02-24 10:12:06 +0000 | [diff] [blame] | 64 | "libcore.javax.security" |
| 65 | "libcore.javax.sql" |
| 66 | "libcore.javax.xml" |
| 67 | "libcore.net" |
| 68 | "libcore.reflect" |
| 69 | "libcore.util" |
Nicolas Geoffray | 3cdf818 | 2014-12-01 10:12:15 +0000 | [diff] [blame] | 70 | "org.apache.harmony.annotation" |
David Brazdil | 4cd7dfd | 2015-02-24 13:33:01 +0000 | [diff] [blame] | 71 | "org.apache.harmony.crypto" |
David Brazdil | e2f28ad | 2015-02-24 10:44:29 +0000 | [diff] [blame] | 72 | "org.apache.harmony.luni" |
| 73 | "org.apache.harmony.nio" |
Nicolas Geoffray | 3cdf818 | 2014-12-01 10:12:15 +0000 | [diff] [blame] | 74 | "org.apache.harmony.regex" |
David Brazdil | e2f28ad | 2015-02-24 10:44:29 +0000 | [diff] [blame] | 75 | "org.apache.harmony.testframework" |
| 76 | "org.apache.harmony.tests.java.io" |
Nicolas Geoffray | 3cdf818 | 2014-12-01 10:12:15 +0000 | [diff] [blame] | 77 | "org.apache.harmony.tests.java.lang" |
Nicolas Geoffray | c3837e4 | 2014-12-03 11:30:26 +0000 | [diff] [blame] | 78 | "org.apache.harmony.tests.java.math" |
Nicolas Geoffray | 3cdf818 | 2014-12-01 10:12:15 +0000 | [diff] [blame] | 79 | "org.apache.harmony.tests.java.util" |
David Brazdil | e2f28ad | 2015-02-24 10:44:29 +0000 | [diff] [blame] | 80 | "org.apache.harmony.tests.java.text" |
| 81 | "org.apache.harmony.tests.javax.security" |
Wojciech Staszkiewicz | 08cf148 | 2015-05-21 17:31:38 +0100 | [diff] [blame] | 82 | "tests.java.lang.String" |
| 83 | "jsr166") |
Nicolas Geoffray | b2e7e24 | 2014-11-28 14:24:28 +0000 | [diff] [blame] | 84 | |
Nicolas Geoffray | cdcd000 | 2015-10-31 14:47:36 +0000 | [diff] [blame] | 85 | # List of packages we could run, but don't have rights to revert |
| 86 | # changes in case of failures. |
| 87 | # "org.apache.harmony.security" |
| 88 | |
Nicolas Geoffray | 9648a63 | 2015-06-15 14:35:01 +0100 | [diff] [blame] | 89 | vogar_args=$@ |
| 90 | while true; do |
| 91 | if [[ "$1" == "--mode=device" ]]; then |
| 92 | vogar_args="$vogar_args --device-dir=/data/local/tmp" |
| 93 | vogar_args="$vogar_args --vm-command=/data/local/tmp/system/bin/art" |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 94 | vogar_args="$vogar_args --vm-arg -Ximage:/data/art-test/core.art" |
Nicolas Geoffray | 9648a63 | 2015-06-15 14:35:01 +0100 | [diff] [blame] | 95 | shift |
| 96 | elif [[ "$1" == "--mode=host" ]]; then |
Andreas Gampe | 8994a04 | 2015-12-30 19:03:17 +0000 | [diff] [blame] | 97 | # We explicitly give a wrong path for the image, to ensure vogar |
| 98 | # will create a boot image with the default compiler. Note that |
| 99 | # giving an existing image on host does not work because of |
| 100 | # classpath/resources differences when compiling the boot image. |
| 101 | vogar_args="$vogar_args --vm-arg -Ximage:/non/existent/vogar.art" |
Nicolas Geoffray | 9648a63 | 2015-06-15 14:35:01 +0100 | [diff] [blame] | 102 | shift |
Roland Levillain | 5db109b | 2016-05-19 12:24:17 +0100 | [diff] [blame] | 103 | elif [[ "$1" == "--no-jit" ]]; then |
| 104 | # Remove the --no-jit from the arguments. |
| 105 | vogar_args=${vogar_args/$1} |
| 106 | use_jit=false |
| 107 | shift |
Nicolas Geoffray | 7f43791 | 2015-06-15 14:35:01 +0100 | [diff] [blame] | 108 | elif [[ "$1" == "--debug" ]]; then |
Nicolas Geoffray | 9648a63 | 2015-06-15 14:35:01 +0100 | [diff] [blame] | 109 | # Remove the --debug from the arguments. |
| 110 | vogar_args=${vogar_args/$1} |
| 111 | vogar_args="$vogar_args --vm-arg -XXlib:libartd.so" |
Nicolas Geoffray | 9648a63 | 2015-06-15 14:35:01 +0100 | [diff] [blame] | 112 | shift |
| 113 | elif [[ "$1" == "" ]]; then |
| 114 | break |
| 115 | else |
| 116 | shift |
| 117 | fi |
| 118 | done |
| 119 | |
Nicolas Geoffray | 44368e8 | 2015-09-30 12:02:21 +0100 | [diff] [blame] | 120 | # Increase the timeout, as vogar cannot set individual test |
| 121 | # timeout when being asked to run packages, and some tests go above |
| 122 | # the default timeout. |
| 123 | vogar_args="$vogar_args --timeout 480" |
Nicolas Geoffray | f794ad7 | 2015-09-11 12:08:49 +0100 | [diff] [blame] | 124 | |
Neil Fuller | b8300fc | 2016-02-10 13:09:10 +0000 | [diff] [blame] | 125 | # Use Jack with "1.8" configuration. |
Neil Fuller | b8300fc | 2016-02-10 13:09:10 +0000 | [diff] [blame] | 126 | vogar_args="$vogar_args --toolchain jack --language JN" |
| 127 | |
Roland Levillain | 5db109b | 2016-05-19 12:24:17 +0100 | [diff] [blame] | 128 | # JIT settings. |
| 129 | if $use_jit; then |
| 130 | vogar_args="$vogar_args --vm-arg -Xcompiler-option --vm-arg --compiler-filter=interpret-only" |
| 131 | fi |
| 132 | vogar_args="$vogar_args --vm-arg -Xusejit:$use_jit" |
| 133 | |
Nicolas Geoffray | b2e7e24 | 2014-11-28 14:24:28 +0000 | [diff] [blame] | 134 | # Run the tests using vogar. |
Nicolas Geoffray | 3cdf818 | 2014-12-01 10:12:15 +0000 | [diff] [blame] | 135 | echo "Running tests for the following test packages:" |
| 136 | echo ${working_packages[@]} | tr " " "\n" |
Tobias Thierer | b3ec089 | 2016-08-03 16:13:04 +0100 | [diff] [blame] | 137 | vogar $vogar_args $expectations $(cparg $DEPS) ${working_packages[@]} |