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 | |
Wojciech Staszkiewicz | 08cf148 | 2015-05-21 17:31:38 +0100 | [diff] [blame] | 22 | # Jar containing jsr166 tests. |
| 23 | jsr166_test_jar=out/target/common/obj/JAVA_LIBRARIES/jsr166-tests_intermediates/javalib.jar |
| 24 | |
| 25 | # Jar containing all the other tests. |
Nicolas Geoffray | b2e7e24 | 2014-11-28 14:24:28 +0000 | [diff] [blame] | 26 | test_jar=out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar |
| 27 | |
Wojciech Staszkiewicz | 08cf148 | 2015-05-21 17:31:38 +0100 | [diff] [blame] | 28 | |
Nicolas Geoffray | b2e7e24 | 2014-11-28 14:24:28 +0000 | [diff] [blame] | 29 | if [ ! -f $test_jar ]; then |
Wojciech Staszkiewicz | 08cf148 | 2015-05-21 17:31:38 +0100 | [diff] [blame] | 30 | echo "Before running, you must build core-tests, jsr166-tests and vogar: \ |
| 31 | make core-tests jsr166-tests vogar vogar.jar" |
Nicolas Geoffray | b2e7e24 | 2014-11-28 14:24:28 +0000 | [diff] [blame] | 32 | exit 1 |
| 33 | fi |
| 34 | |
Nicolas Geoffray | c3837e4 | 2014-12-03 11:30:26 +0000 | [diff] [blame] | 35 | # Packages that currently work correctly with the expectation files. |
Nicolas Geoffray | 1f8dbf8 | 2015-06-13 13:19:16 +0000 | [diff] [blame] | 36 | working_packages=("dalvik.system" |
Brian Carlstrom | 4c78ffa | 2015-06-11 07:33:51 -0700 | [diff] [blame] | 37 | "libcore.icu" |
David Brazdil | 598b220 | 2015-02-24 10:12:06 +0000 | [diff] [blame] | 38 | "libcore.io" |
| 39 | "libcore.java.lang" |
Nicolas Geoffray | c3837e4 | 2014-12-03 11:30:26 +0000 | [diff] [blame] | 40 | "libcore.java.math" |
David Brazdil | 598b220 | 2015-02-24 10:12:06 +0000 | [diff] [blame] | 41 | "libcore.java.text" |
Nicolas Geoffray | 3cdf818 | 2014-12-01 10:12:15 +0000 | [diff] [blame] | 42 | "libcore.java.util" |
David Brazdil | 4cd7dfd | 2015-02-24 13:33:01 +0000 | [diff] [blame] | 43 | "libcore.javax.crypto" |
David Brazdil | 598b220 | 2015-02-24 10:12:06 +0000 | [diff] [blame] | 44 | "libcore.javax.security" |
| 45 | "libcore.javax.sql" |
| 46 | "libcore.javax.xml" |
| 47 | "libcore.net" |
| 48 | "libcore.reflect" |
| 49 | "libcore.util" |
Nicolas Geoffray | 3cdf818 | 2014-12-01 10:12:15 +0000 | [diff] [blame] | 50 | "org.apache.harmony.annotation" |
David Brazdil | 4cd7dfd | 2015-02-24 13:33:01 +0000 | [diff] [blame] | 51 | "org.apache.harmony.crypto" |
David Brazdil | e2f28ad | 2015-02-24 10:44:29 +0000 | [diff] [blame] | 52 | "org.apache.harmony.luni" |
| 53 | "org.apache.harmony.nio" |
Nicolas Geoffray | 3cdf818 | 2014-12-01 10:12:15 +0000 | [diff] [blame] | 54 | "org.apache.harmony.regex" |
David Brazdil | e2f28ad | 2015-02-24 10:44:29 +0000 | [diff] [blame] | 55 | "org.apache.harmony.security" |
| 56 | "org.apache.harmony.testframework" |
| 57 | "org.apache.harmony.tests.java.io" |
Nicolas Geoffray | 3cdf818 | 2014-12-01 10:12:15 +0000 | [diff] [blame] | 58 | "org.apache.harmony.tests.java.lang" |
Nicolas Geoffray | c3837e4 | 2014-12-03 11:30:26 +0000 | [diff] [blame] | 59 | "org.apache.harmony.tests.java.math" |
Nicolas Geoffray | 3cdf818 | 2014-12-01 10:12:15 +0000 | [diff] [blame] | 60 | "org.apache.harmony.tests.java.util" |
David Brazdil | e2f28ad | 2015-02-24 10:44:29 +0000 | [diff] [blame] | 61 | "org.apache.harmony.tests.java.text" |
| 62 | "org.apache.harmony.tests.javax.security" |
Wojciech Staszkiewicz | 08cf148 | 2015-05-21 17:31:38 +0100 | [diff] [blame] | 63 | "tests.java.lang.String" |
| 64 | "jsr166") |
Nicolas Geoffray | b2e7e24 | 2014-11-28 14:24:28 +0000 | [diff] [blame] | 65 | |
Nicolas Geoffray | 9648a63 | 2015-06-15 14:35:01 +0100 | [diff] [blame] | 66 | vogar_args=$@ |
| 67 | while true; do |
| 68 | if [[ "$1" == "--mode=device" ]]; then |
| 69 | vogar_args="$vogar_args --device-dir=/data/local/tmp" |
| 70 | vogar_args="$vogar_args --vm-command=/data/local/tmp/system/bin/art" |
| 71 | vogar_args="$vogar_args --vm-arg -Ximage:/data/art-test/core-optimizing.art" |
| 72 | shift |
| 73 | elif [[ "$1" == "--mode=host" ]]; then |
| 74 | # We explicitly give a wrong path for the image, to ensure vogar |
| 75 | # will create a boot image with the default compiler. Note that |
| 76 | # giving an existing image on host does not work because of |
| 77 | # classpath/resources differences when compiling the boot image. |
| 78 | vogar_args="$vogar_args --vm-arg -Ximage:/non/existent" |
| 79 | shift |
Nicolas Geoffray | 7f43791 | 2015-06-15 14:35:01 +0100 | [diff] [blame] | 80 | elif [[ "$1" == "--debug" ]]; then |
Nicolas Geoffray | 9648a63 | 2015-06-15 14:35:01 +0100 | [diff] [blame] | 81 | # Remove the --debug from the arguments. |
| 82 | vogar_args=${vogar_args/$1} |
| 83 | vogar_args="$vogar_args --vm-arg -XXlib:libartd.so" |
| 84 | # Increase the timeout, as vogar cannot set individual test |
| 85 | # timeout when being asked to run packages, and some tests go above |
| 86 | # the default timeout. |
Nicolas Geoffray | 03ba67c | 2015-06-23 18:20:41 +0100 | [diff] [blame] | 87 | vogar_args="$vogar_args --timeout 240" |
Nicolas Geoffray | 9648a63 | 2015-06-15 14:35:01 +0100 | [diff] [blame] | 88 | shift |
| 89 | elif [[ "$1" == "" ]]; then |
| 90 | break |
| 91 | else |
| 92 | shift |
| 93 | fi |
| 94 | done |
| 95 | |
Nicolas Geoffray | b2e7e24 | 2014-11-28 14:24:28 +0000 | [diff] [blame] | 96 | # Run the tests using vogar. |
Nicolas Geoffray | 3cdf818 | 2014-12-01 10:12:15 +0000 | [diff] [blame] | 97 | echo "Running tests for the following test packages:" |
| 98 | echo ${working_packages[@]} | tr " " "\n" |
Nicolas Geoffray | 9648a63 | 2015-06-15 14:35:01 +0100 | [diff] [blame] | 99 | vogar $vogar_args --expectations art/tools/libcore_failures.txt --classpath $jsr166_test_jar --classpath $test_jar ${working_packages[@]} |