Nicolas Geoffray | 96cd87a | 2015-03-26 16:48:29 +0000 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # |
| 3 | # Copyright (C) 2015 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 | |
Nicolas Geoffray | d06dc9c | 2015-03-30 15:30:26 +0100 | [diff] [blame^] | 22 | if [[ $ANDROID_SERIAL == 03a79ae90ae5889b ]] || [[ $ANDROID_SERIAL == HT4CTJT03670 ]] || [[ $ANDROID_SERIAL == HT49CJT00070 ]]; then |
Nicolas Geoffray | 9620b9d | 2015-03-30 12:28:26 +0100 | [diff] [blame] | 23 | echo "Not run because of localhost failures. Investigating." |
| 24 | exit 0 |
| 25 | fi |
| 26 | |
Nicolas Geoffray | 96cd87a | 2015-03-26 16:48:29 +0000 | [diff] [blame] | 27 | # Jar containing all the tests. |
| 28 | test_jar=out/host/linux-x86/framework/apache-harmony-jdwp-tests-hostdex.jar |
| 29 | junit_jar=out/host/linux-x86/framework/junit.jar |
| 30 | |
| 31 | if [ ! -f $test_jar -o ! -f $junit_jar ]; then |
| 32 | echo "Before running, you must build jdwp tests and vogar:" \ |
| 33 | "make junit apache-harmony-jdwp-tests-hostdex vogar vogar.jar" |
| 34 | exit 1 |
| 35 | fi |
| 36 | |
| 37 | art="/data/local/tmp/system/bin/art" |
| 38 | # We use Quick's image on target because optimizing's image is not compiled debuggable. |
| 39 | image="-Ximage:/data/art-test/core.art" |
| 40 | args=$@ |
| 41 | debuggee_args="-Xcompiler-option --compiler-backend=Optimizing -Xcompiler-option --debuggable" |
| 42 | device_dir="--device-dir=/data/local/tmp" |
Nicolas Geoffray | d06dc9c | 2015-03-30 15:30:26 +0100 | [diff] [blame^] | 43 | # We use the art script on target to ensure the runner and the debuggee share the same |
| 44 | # image. |
| 45 | vm_command="--vm-command=$art" |
Nicolas Geoffray | 96cd87a | 2015-03-26 16:48:29 +0000 | [diff] [blame] | 46 | |
| 47 | while true; do |
| 48 | if [[ "$1" == "--mode=host" ]]; then |
| 49 | art="art" |
| 50 | # We force generation of a new image to avoid build-time and run-time classpath differences. |
| 51 | image="-Ximage:/system/non/existent" |
Nicolas Geoffray | d06dc9c | 2015-03-30 15:30:26 +0100 | [diff] [blame^] | 52 | # We do not need a device directory on host. |
Nicolas Geoffray | 96cd87a | 2015-03-26 16:48:29 +0000 | [diff] [blame] | 53 | device_dir="" |
Nicolas Geoffray | d06dc9c | 2015-03-30 15:30:26 +0100 | [diff] [blame^] | 54 | # Vogar knows which VM to use on host. |
| 55 | vm_command="" |
Nicolas Geoffray | 96cd87a | 2015-03-26 16:48:29 +0000 | [diff] [blame] | 56 | shift |
| 57 | elif [[ $1 == -Ximage:* ]]; then |
| 58 | image="$1" |
| 59 | shift |
| 60 | elif [[ "$1" == "" ]]; then |
| 61 | break |
| 62 | else |
| 63 | shift |
| 64 | fi |
| 65 | done |
| 66 | |
| 67 | # Run the tests using vogar. |
Nicolas Geoffray | d06dc9c | 2015-03-30 15:30:26 +0100 | [diff] [blame^] | 68 | vogar $vm_command \ |
Nicolas Geoffray | 96cd87a | 2015-03-26 16:48:29 +0000 | [diff] [blame] | 69 | --vm-arg $image \ |
Nicolas Geoffray | 9620b9d | 2015-03-30 12:28:26 +0100 | [diff] [blame] | 70 | --verbose \ |
Nicolas Geoffray | 96cd87a | 2015-03-26 16:48:29 +0000 | [diff] [blame] | 71 | $args \ |
| 72 | $device_dir \ |
| 73 | --vm-arg -Ximage-compiler-option \ |
| 74 | --vm-arg --debuggable \ |
| 75 | --timeout 600 \ |
| 76 | --vm-arg -Djpda.settings.verbose=true \ |
| 77 | --vm-arg -Djpda.settings.syncPort=34016 \ |
| 78 | --vm-arg -Djpda.settings.debuggeeJavaPath="$art $image $debuggee_args" \ |
| 79 | --classpath $test_jar \ |
| 80 | --classpath $junit_jar \ |
| 81 | --vm-arg -Xcompiler-option --vm-arg --compiler-backend=Optimizing \ |
| 82 | --vm-arg -Xcompiler-option --vm-arg --debuggable \ |
| 83 | org.apache.harmony.jpda.tests.share.AllTests |