3 # Copyright (C) 2007 The Android Open Source Project
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
9 # http://www.apache.org/licenses/LICENSE-2.0
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.
17 # Set up prog to be the path of this script, including following symlinks,
18 # and set up progdir to be the fully-qualified pathname of its directory.
20 while [ -h "${prog}" ]; do
21 newProg
=`/bin/ls -ld "${prog}"`
22 newProg
=`expr "${newProg}" : ".* -> \(.*\)$"`
23 if expr "x${newProg}" : 'x/' >/dev
/null
; then
26 progdir
=`dirname "${prog}"`
27 prog
="${progdir}/${newProg}"
31 progdir
=`dirname "${prog}"`
34 prog
="${progdir}"/`basename "${prog}"`
40 if [ "x$1" = "x--host" ]; then
41 run_args
="${run_args} --host"
43 elif [ "x$1" = "x--reference" ]; then
44 run_args
="${run_args} --reference"
46 elif [ "x$1" = "x--jit" ]; then
47 run_args
="${run_args} --jit"
49 elif [ "x$1" = "x--fast" ]; then
50 run_args
="${run_args} --fast"
52 elif [ "x$1" = "x--portable" ]; then
53 run_args
="${run_args} --portable"
55 elif [ "x$1" = "x--debug" ]; then
56 run_args
="${run_args} --debug"
58 elif [ "x$1" = "x--zygote" ]; then
59 run_args
="${run_args} --zygote"
61 elif [ "x$1" = "x--no-verify" ]; then
62 run_args
="${run_args} --no-verify"
64 elif [ "x$1" = "x--no-optimize" ]; then
65 run_args
="${run_args} --no-optimize"
67 elif [ "x$1" = "x--valgrind" ]; then
68 run_args
="${run_args} --valgrind"
70 elif [ "x$1" = "x--dev" ]; then
71 run_args
="${run_args} --dev"
73 elif [ "x$1" = "x--update" ]; then
74 run_args
="${run_args} --update"
76 elif [ "x$1" = "x--help" ]; then
79 elif expr "x$1" : "x--" >/dev
/null
2>&1; then
80 echo "unknown option: $1" 1>&2
88 if [ "$usage" = "yes" ]; then
92 echo " $prog --help Print this message."
93 echo " $prog [options] Run all tests with the given options."
94 echo " Options are all passed to run-test; refer to that for " \
95 "further documentation:"
96 echo " --debug --dev --fast --host --no-optimize --no-verify" \
98 echo " --reference --update --valgrind --zygote"
108 if [ -d "$i" -a -r "$i" -a -r "${i}/info.txt" ]; then
109 .
/run-test
${run_args} "$i"
110 if [ "$?" = "0" ]; then
114 failNames
="$failNames $i"
119 echo "passed: $passed test(s)"
120 echo "failed: $failed test(s)"
122 for i
in $failNames; do