blob: c6cbb38539d38644df80f2cb0487fe75c3e865de [file] [log] [blame]
Nicolas Geoffrayb2e7e242014-11-28 14:24:28 +00001#!/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
17if [ ! -d libcore ]; then
18 echo "Script needs to be run at the root of the android tree"
19 exit 1
20fi
21
Wojciech Staszkiewicz08cf1482015-05-21 17:31:38 +010022# Jar containing jsr166 tests.
23jsr166_test_jar=out/target/common/obj/JAVA_LIBRARIES/jsr166-tests_intermediates/javalib.jar
24
25# Jar containing all the other tests.
Nicolas Geoffrayb2e7e242014-11-28 14:24:28 +000026test_jar=out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar
27
Wojciech Staszkiewicz08cf1482015-05-21 17:31:38 +010028
Nicolas Geoffrayb2e7e242014-11-28 14:24:28 +000029if [ ! -f $test_jar ]; then
Wojciech Staszkiewicz08cf1482015-05-21 17:31:38 +010030 echo "Before running, you must build core-tests, jsr166-tests and vogar: \
31 make core-tests jsr166-tests vogar vogar.jar"
Nicolas Geoffrayb2e7e242014-11-28 14:24:28 +000032 exit 1
33fi
34
Nicolas Geoffrayc3837e42014-12-03 11:30:26 +000035# Packages that currently work correctly with the expectation files.
Nicolas Geoffraye17c8fe2015-06-10 14:06:31 +000036working_packages=("libcore.icu"
David Brazdil598b2202015-02-24 10:12:06 +000037 "libcore.io"
38 "libcore.java.lang"
Nicolas Geoffrayc3837e42014-12-03 11:30:26 +000039 "libcore.java.math"
David Brazdil598b2202015-02-24 10:12:06 +000040 "libcore.java.text"
Nicolas Geoffray3cdf8182014-12-01 10:12:15 +000041 "libcore.java.util"
David Brazdil4cd7dfd2015-02-24 13:33:01 +000042 "libcore.javax.crypto"
David Brazdil598b2202015-02-24 10:12:06 +000043 "libcore.javax.security"
44 "libcore.javax.sql"
45 "libcore.javax.xml"
46 "libcore.net"
47 "libcore.reflect"
48 "libcore.util"
Nicolas Geoffray3cdf8182014-12-01 10:12:15 +000049 "org.apache.harmony.annotation"
David Brazdil4cd7dfd2015-02-24 13:33:01 +000050 "org.apache.harmony.crypto"
David Brazdile2f28ad2015-02-24 10:44:29 +000051 "org.apache.harmony.luni"
52 "org.apache.harmony.nio"
Nicolas Geoffray3cdf8182014-12-01 10:12:15 +000053 "org.apache.harmony.regex"
David Brazdile2f28ad2015-02-24 10:44:29 +000054 "org.apache.harmony.security"
55 "org.apache.harmony.testframework"
56 "org.apache.harmony.tests.java.io"
Nicolas Geoffray3cdf8182014-12-01 10:12:15 +000057 "org.apache.harmony.tests.java.lang"
Nicolas Geoffrayc3837e42014-12-03 11:30:26 +000058 "org.apache.harmony.tests.java.math"
Nicolas Geoffray3cdf8182014-12-01 10:12:15 +000059 "org.apache.harmony.tests.java.util"
David Brazdile2f28ad2015-02-24 10:44:29 +000060 "org.apache.harmony.tests.java.text"
61 "org.apache.harmony.tests.javax.security"
Wojciech Staszkiewicz08cf1482015-05-21 17:31:38 +010062 "tests.java.lang.String"
63 "jsr166")
Nicolas Geoffrayb2e7e242014-11-28 14:24:28 +000064
Nicolas Geoffray9648a632015-06-15 14:35:01 +010065vogar_args=$@
66while true; do
67 if [[ "$1" == "--mode=device" ]]; then
68 vogar_args="$vogar_args --device-dir=/data/local/tmp"
69 vogar_args="$vogar_args --vm-command=/data/local/tmp/system/bin/art"
70 vogar_args="$vogar_args --vm-arg -Ximage:/data/art-test/core-optimizing.art"
71 shift
72 elif [[ "$1" == "--mode=host" ]]; then
73 # We explicitly give a wrong path for the image, to ensure vogar
74 # will create a boot image with the default compiler. Note that
75 # giving an existing image on host does not work because of
76 # classpath/resources differences when compiling the boot image.
77 vogar_args="$vogar_args --vm-arg -Ximage:/non/existent"
78 shift
79 elif [[ $1 == "--debug" ]]; then
80 # Remove the --debug from the arguments.
81 vogar_args=${vogar_args/$1}
82 vogar_args="$vogar_args --vm-arg -XXlib:libartd.so"
83 # Increase the timeout, as vogar cannot set individual test
84 # timeout when being asked to run packages, and some tests go above
85 # the default timeout.
86 vogar_args="$vogar_args --timeout 180"
87 shift
88 elif [[ "$1" == "" ]]; then
89 break
90 else
91 shift
92 fi
93done
94
Nicolas Geoffrayb2e7e242014-11-28 14:24:28 +000095# Run the tests using vogar.
Nicolas Geoffray3cdf8182014-12-01 10:12:15 +000096echo "Running tests for the following test packages:"
97echo ${working_packages[@]} | tr " " "\n"
Nicolas Geoffray9648a632015-06-15 14:35:01 +010098vogar $vogar_args --expectations art/tools/libcore_failures.txt --classpath $jsr166_test_jar --classpath $test_jar ${working_packages[@]}