summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorBrian Carlstrom <bdc@google.com>2013-10-29 10:49:23 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-29 10:49:23 -0700
commitfe6e6a75ae3dcb4ff8a5cbcf0069171d0fe75255 (patch)
treec5d7d11749c9e96883a1030437e11bc420262520 /test
parentad3d996316dd90b84b4b29ccdfc4aeeb1ec890ee (diff)
parent661cc989b99e8eed3929a79aee9e10cfb5aa4f1d (diff)
downloadandroid_art-fe6e6a75ae3dcb4ff8a5cbcf0069171d0fe75255.tar.gz
android_art-fe6e6a75ae3dcb4ff8a5cbcf0069171d0fe75255.tar.bz2
android_art-fe6e6a75ae3dcb4ff8a5cbcf0069171d0fe75255.zip
am 661cc989: Merge "Make ART\'s run-test support Dalvik so we can remove dalvik/tests"
* commit '661cc989b99e8eed3929a79aee9e10cfb5aa4f1d': Make ART's run-test support Dalvik so we can remove dalvik/tests
Diffstat (limited to 'test')
-rwxr-xr-xtest/055-enum-performance/run4
-rwxr-xr-xtest/etc/host-run-test-jar25
-rwxr-xr-xtest/etc/push-and-run-test-jar19
-rwxr-xr-xtest/run-test44
4 files changed, 76 insertions, 16 deletions
diff --git a/test/055-enum-performance/run b/test/055-enum-performance/run
index 1436ce2326..e27a622f40 100755
--- a/test/055-enum-performance/run
+++ b/test/055-enum-performance/run
@@ -14,5 +14,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-# As this is a performance test we always run -O
-exec ${RUN} -O "$@"
+# As this is a performance test we always use the non-debug build.
+exec ${RUN} "${@/#libartd.so/libart.so}"
diff --git a/test/etc/host-run-test-jar b/test/etc/host-run-test-jar
index 357fb5adab..da745324c9 100755
--- a/test/etc/host-run-test-jar
+++ b/test/etc/host-run-test-jar
@@ -9,7 +9,6 @@ msg() {
fi
}
-LIB="libartd.so"
DEBUGGER="n"
GDB="n"
INTERPRETER="n"
@@ -23,11 +22,17 @@ while true; do
if [ "x$1" = "x--quiet" ]; then
QUIET="y"
shift
- elif [ "x$1" = "x-lib" ]; then
+ elif [ "x$1" = "x--lib" ]; then
shift
+ if [ "x$1" = "x" ]; then
+ echo "$0 missing argument to --lib" 1>&2
+ exit 1
+ fi
LIB="$1"
- elif [ "x$1" = "x-O" ]; then
- LIB="libart.so"
+ shift
+ elif [ "x$1" = "x--boot" ]; then
+ shift
+ BOOT_OPT="$1"
shift
elif [ "x$1" = "x--debug" ]; then
DEBUGGER="y"
@@ -38,6 +43,10 @@ while true; do
shift
elif [ "x$1" = "x--invoke-with" ]; then
shift
+ if [ "x$1" = "x" ]; then
+ echo "$0 missing argument to --invoke-with" 1>&2
+ exit 1
+ fi
if [ "x$INVOKE_WITH" = "x" ]; then
INVOKE_WITH="$1"
else
@@ -106,7 +115,9 @@ fi
JNI_OPTS="-Xjnigreflimit:512 -Xcheck:jni"
+if [ "$DEV_MODE" = "y" ]; then
+ echo $cmdline "$@"
+fi
+
cd $ANDROID_BUILD_TOP
-$INVOKE_WITH $gdb $exe $gdbargs -XXlib:$LIB -Ximage:$ANDROID_ROOT/framework/core.art \
- $JNI_OPTS $INT_OPTS $DEBUGGER_OPTS \
- -cp $DEX_LOCATION/$TEST_NAME.jar Main "$@"
+$INVOKE_WITH $gdb $exe $gdbargs -XXlib:$LIB $JNI_OPTS $INT_OPTS $DEBUGGER_OPTS $BOOT_OPT -cp $DEX_LOCATION/$TEST_NAME.jar Main "$@"
diff --git a/test/etc/push-and-run-test-jar b/test/etc/push-and-run-test-jar
index cc285920df..ff75d32d1b 100755
--- a/test/etc/push-and-run-test-jar
+++ b/test/etc/push-and-run-test-jar
@@ -9,7 +9,6 @@ msg() {
fi
}
-LIB="libartd.so"
GDB="n"
DEBUGGER="n"
INTERPRETER="n"
@@ -24,11 +23,17 @@ while true; do
if [ "x$1" = "x--quiet" ]; then
QUIET="y"
shift
- elif [ "x$1" = "x-lib" ]; then
+ elif [ "x$1" = "x--lib" ]; then
shift
+ if [ "x$1" = "x" ]; then
+ echo "$0 missing argument to --lib" 1>&2
+ exit 1
+ fi
LIB="$1"
- elif [ "x$1" = "x-O" ]; then
- LIB="libart.so"
+ shift
+ elif [ "x$1" = "x--boot" ]; then
+ shift
+ BOOT_OPT="$1"
shift
elif [ "x$1" = "x--debug" ]; then
DEBUGGER="y"
@@ -49,6 +54,10 @@ while true; do
shift
elif [ "x$1" = "x--invoke-with" ]; then
shift
+ if [ "x$1" = "x" ]; then
+ echo "$0 missing argument to --invoke-with" 1>&2
+ exit 1
+ fi
if [ "x$INVOKE_WITH" = "x" ]; then
INVOKE_WITH="$1"
else
@@ -132,7 +141,7 @@ fi
JNI_OPTS="-Xjnigreflimit:512 -Xcheck:jni"
cmdline="cd $DEX_LOCATION && mkdir dalvik-cache && export ANDROID_DATA=$DEX_LOCATION && export DEX_LOCATION=$DEX_LOCATION && \
- $INVOKE_WITH $gdb dalvikvm $gdbargs -XXlib:$LIB $ZYGOTE $JNI_OPTS $INT_OPTS $DEBUGGER_OPTS -Ximage:/data/art-test/core.art -cp $DEX_LOCATION/$TEST_NAME.jar Main"
+ $INVOKE_WITH $gdb dalvikvm $gdbargs -XXlib:$LIB $ZYGOTE $JNI_OPTS $INT_OPTS $DEBUGGER_OPTS $BOOT_OPT -cp $DEX_LOCATION/$TEST_NAME.jar Main"
if [ "$DEV_MODE" = "y" ]; then
echo $cmdline "$@"
fi
diff --git a/test/run-test b/test/run-test
index c449e84c35..f706110a2c 100755
--- a/test/run-test
+++ b/test/run-test
@@ -58,12 +58,14 @@ run="run"
expected="expected.txt"
output="output.txt"
build_output="build-output.txt"
+lib="libartd.so"
run_args="--quiet"
target_mode="yes"
dev_mode="no"
update_mode="no"
debug_mode="no"
+dalvik_mode="no"
usage="no"
build_only="no"
@@ -79,7 +81,16 @@ while true; do
NEED_DEX="false"
shift
elif [ "x$1" = "x-O" ]; then
- run_args="${run_args} -O"
+ lib="libart.so"
+ shift
+ elif [ "x$1" = "x--dalvik" ]; then
+ lib="libdvm.so"
+ dalvik_mode="yes"
+ shift
+ elif [ "x$1" = "x--image" ]; then
+ shift
+ image="$1"
+ run_args="${run_args} --image $image"
shift
elif [ "x$1" = "x--debug" ]; then
run_args="${run_args} --debug"
@@ -106,6 +117,11 @@ while true; do
elif [ "x$1" = "x--invoke-with" ]; then
shift
what="$1"
+ if [ "x$what" = "x" ]; then
+ echo "$0 missing argument to --invoke-with" 1>&2
+ usage="yes"
+ break
+ fi
run_args="${run_args} --invoke-with ${what}"
shift
elif [ "x$1" = "x--dev" ]; then
@@ -118,6 +134,11 @@ while true; do
elif [ "x$1" = "x--output-path" ]; then
shift
tmp_dir=$1
+ if [ "x$tmp_dir" = "x" ]; then
+ echo "$0 missing argument to --output-path" 1>&2
+ usage="yes"
+ break
+ fi
shift
elif [ "x$1" = "x--update" ]; then
update_mode="yes"
@@ -134,6 +155,24 @@ while true; do
fi
done
+run_args="${run_args} --lib $lib"
+
+if [ "$dalvik_mode" = "no" ]; then
+ if [ "$target_mode" = "no" ]; then
+ run_args="${run_args} --boot -Ximage:${ANDROID_HOST_OUT}/framework/core.art"
+ else
+ run_args="${run_args} --boot -Ximage:/data/art-test/core.art"
+ fi
+else
+ if [ "$target_mode" = "no" ]; then
+ framework="${OUT}/system/framework"
+ bpath="${framework}/core.jar:${framework}/conscrypt.jar:${framework}/okhttp.jar:${framework}/core-junit.jar:${framework}/bouncycastle.jar:${framework}/ext.jar"
+ run_args="${run_args} --boot -Xbootclasspath:${bpath}"
+ else
+ true # defaults to using target BOOTCLASSPATH
+ fi
+fi
+
if [ "$dev_mode" = "yes" -a "$update_mode" = "yes" ]; then
echo "--dev and --update are mutually exclusive" 1>&2
usage="yes"
@@ -185,6 +224,7 @@ if [ "$usage" = "yes" ]; then
echo " other runtime options are ignored."
echo " --host Use the host-mode virtual machine."
echo " --invoke-with Pass --invoke-with option to runtime."
+ echo " --dalvik Use Dalvik (off by default)."
echo " --jvm Use a host-local RI virtual machine."
echo " --output-path [path] Location where to store the build" \
"files."
@@ -237,7 +277,7 @@ if [ "$dev_mode" = "yes" ]; then
if [ "$build_exit" = '0' ]; then
echo "${test_dir}: running..." 1>&2
"./${run}" $run_args "$@" 2>&1
- run_exit="$?"
+ run_exit="$?"
echo "run exit status: $run_exit" 1>&2
if [ "$run_exit" = "0" ]; then
good="yes"