OSDN Git Service

Replace dalvik test local mode with new host mode
authorbuzbee <buzbee@google.com>
Thu, 2 Dec 2010 23:37:06 +0000 (15:37 -0800)
committerbuzbee <buzbee@google.com>
Thu, 2 Dec 2010 23:55:57 +0000 (15:55 -0800)
To run the dalvik tests with host mode:
1.  build with WITH_HOST_DALVIK=true
2.  run-all-tests --host, or run-test <num> --host

Change-Id: Ic20df0b0720571b5a4ae11b5a1f6ce760d921d4b

tests/etc/local-run-test-jar [deleted file]
tests/run-all-tests
tests/run-test

diff --git a/tests/etc/local-run-test-jar b/tests/etc/local-run-test-jar
deleted file mode 100755 (executable)
index 6155e3f..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-#!/bin/sh
-#
-# Run the code in test.jar on a host-local virtual machine. The jar should
-# contain a top-level class named Main to run.
-#
-# Options:
-#   --quiet       -- don't chatter
-#   --fast        -- use the fast interpreter (the default)
-#   --jit         -- use the jit
-#   --portable    -- use the portable interpreter
-#   --debug       -- wait for debugger to attach
-#   --valgrind    -- use valgrind
-#   --no-verify   -- turn off verification (on by default)
-#   --no-optimize -- turn off optimization (on by default)
-
-msg() {
-    if [ "$QUIET" = "n" ]; then
-        echo "$@"
-    fi
-}
-
-INTERP=""
-DEBUG="n"
-GDB="n"
-VERIFY="y"
-OPTIMIZE="y"
-VALGRIND="n"
-DEV_MODE="n"
-QUIET="n"
-PRECISE="y"
-
-while true; do
-    if [ "x$1" = "x--quiet" ]; then
-        QUIET="y"
-        shift
-    elif [ "x$1" = "x--jit" ]; then
-        INTERP="jit"
-        msg "Using jit"
-        shift
-    elif [ "x$1" = "x--fast" ]; then
-        INTERP="fast"
-        msg "Using fast interpreter"
-        shift
-    elif [ "x$1" = "x--portable" ]; then
-        INTERP="portable"
-        msg "Using portable interpreter"
-        shift
-    elif [ "x$1" = "x--debug" ]; then
-        DEBUG="y"
-        shift
-    elif [ "x$1" = "x--gdb" ]; then
-        GDB="y"
-        shift
-    elif [ "x$1" = "x--valgrind" ]; then
-        VALGRIND="y"
-        shift
-    elif [ "x$1" = "x--dev" ]; then
-        DEV_MODE="y"
-        shift
-    elif [ "x$1" = "x--no-verify" ]; then
-        VERIFY="n"
-        shift
-    elif [ "x$1" = "x--no-optimize" ]; then
-        OPTIMIZE="n"
-        shift
-    elif [ "x$1" = "x--no-precise" ]; then
-        PRECISE="n"
-        shift
-    elif [ "x$1" = "x--" ]; then
-        shift
-        break
-    elif expr "x$1" : "x--" >/dev/null 2>&1; then
-        echo "unknown option: $1" 1>&2
-        exit 1
-    else
-        break
-    fi
-done
-
-if [ "x$INTERP" = "x" ]; then
-    INTERP="fast"
-    msg "Using fast interpreter by default"
-fi
-
-if [ "$OPTIMIZE" = "y" ]; then
-    if [ "$VERIFY" = "y" ]; then
-        DEX_OPTIMIZE="-Xdexopt:verified"
-    else
-        DEX_OPTIMIZE="-Xdexopt:all"
-    fi
-    msg "Performing optimizations"
-else
-    DEX_OPTIMIZE="-Xdexopt:none"
-    msg "Skipping optimizations"
-fi
-
-if [ "$VERIFY" = "y" ]; then
-    DEX_VERIFY=""
-    msg "Performing verification"
-else
-    DEX_VERIFY="-Xverify:none"
-    msg "Skipping verification"
-fi
-
-if [ "$VALGRIND" = "y" ]; then
-    msg "Running with valgrind"
-    valgrind_cmd="valgrind"
-    #valgrind_cmd="valgrind --leak-check=full"
-else
-    valgrind_cmd=""
-fi
-
-if [ "$PRECISE" = "y" ]; then
-    GC_OPTS="-Xgc:precise -Xgenregmap"
-else
-    GC_OPTS="-Xgc:noprecise"
-fi
-
-msg "------------------------------"
-
-BASE="$OUT" # from build environment
-DATA_DIR=/tmp
-DEBUG_OPTS="-Xcheck:jni -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
-
-export ANDROID_PRINTF_LOG=brief
-if [ "$DEV_MODE" = "y" ]; then
-    export ANDROID_LOG_TAGS='*:d'
-else
-    export ANDROID_LOG_TAGS='*:s'
-fi
-export ANDROID_DATA="$DATA_DIR"
-export ANDROID_ROOT="${BASE}/system"
-export LD_LIBRARY_PATH="${BASE}/system/lib"
-export DYLD_LIBRARY_PATH="${BASE}/system/lib"
-
-exe="${BASE}/system/bin/dalvikvm"
-framework="${BASE}/system/framework"
-bpath="${framework}/core.jar:${framework}/ext.jar:${framework}/framework.jar"
-
-if [ "$DEBUG" = "y" ]; then
-    PORT=8000
-    msg "Waiting for debugger to connect on localhost:$PORT"
-    DEX_DEBUG="-agentlib:jdwp=transport=dt_socket,addres=$PORT,server=y,suspend=y"
-fi
-
-if [ "$GDB" = "y" ]; then
-    gdb=gdb
-    gdbargs="--args $exe"
-fi
-
-$valgrind_cmd $gdb $exe $gdbargs "-Xbootclasspath:${bpath}" \
-    $DEX_VERIFY $DEX_OPTIMIZE $DEX_DEBUG $GC_OPTS "-Xint:${INTERP}" -ea \
-    -cp test.jar Main "$@"
index 7704b18..f66cd76 100755 (executable)
@@ -37,10 +37,7 @@ run_args=""
 usage="no"
 
 while true; do
-    if [ "x$1" = "x--local" ]; then
-        run_args="${run_args} --local"
-        shift
-    elif [ "x$1" = "x--host" ]; then
+    if [ "x$1" = "x--host" ]; then
         run_args="${run_args} --host"
         shift
     elif [ "x$1" = "x--reference" ]; then
@@ -95,10 +92,10 @@ if [ "$usage" = "yes" ]; then
         echo "  $prog --help     Print this message."
         echo "  $prog [options]  Run all tests with the given options."
         echo "  Options are all passed to run-test; refer to that for " \
-           "further documentation:"
-        echo "    --debug --dev --fast --local --no-optimize --no-verify" \
-           "--portable"
-       echo "    --reference --update --valgrind --zygote --host"
+             "further documentation:"
+        echo "    --debug --dev --fast --host --no-optimize --no-verify" \
+             "--portable"
+        echo "    --reference --update --valgrind --zygote"
     ) 1>&2
     exit 1
 fi
index df9fa4d..fb758d7 100755 (executable)
@@ -51,15 +51,12 @@ debug_mode="no"
 usage="no"
 
 while true; do
-    if [ "x$1" = "x--local" ]; then
-        RUN="${progdir}/etc/local-run-test-jar"
+    if [ "x$1" = "x--host" ]; then
+        RUN="${progdir}/etc/host-run-test-jar"
         shift
     elif [ "x$1" = "x--reference" ]; then
         RUN="${progdir}/etc/reference-run-test-classes"
         shift
-    elif [ "x$1" = "x--host" ]; then
-        RUN="${progdir}/etc/host-run-test-jar"
-        shift
     elif [ "x$1" = "x--jit" ]; then
         run_args="${run_args} --jit"
         shift
@@ -143,11 +140,11 @@ if [ "$usage" = "yes" ]; then
         echo "  $prog --help                          Print this message."
         echo "  $prog [options] [test-name]           Run test normally."
         echo "  $prog --dev [options] [test-name]     Development mode" \
-           "(dumps to stdout)."
+             "(dumps to stdout)."
         echo "  $prog --update [options] [test-name]  Update mode" \
-           "(replaces expected.txt)."
+             "(replaces expected.txt)."
         echo '  Omitting the test name or specifying "-" will use the' \
-           "current directory."
+             "current directory."
         echo "  Runtime Options:"
         echo "    --fast         Use the fast interpreter (the default)."
         echo "    --jit          Use the jit."
@@ -158,9 +155,8 @@ if [ "$usage" = "yes" ]; then
         echo "    --no-optimize  Turn off optimization (on by default)."
         echo "    --no-precise   Turn off precise GC (on by default)."
         echo "    --zygote       Spawn the process from the Zygote." \
-           "If used, then the"
-       echo "                   other runtime options are ignored."
-        echo "    --local        Use a host-local virtual machine."
+             "If used, then the"
+        echo "                   other runtime options are ignored."
         echo "    --host         Use the host-mode virtual machine."
         echo "    --valgrind     Use valgrind when running locally."
         echo "    --reference    Use a host-local reference virtual machine."
@@ -212,7 +208,7 @@ elif [ "$update_mode" = "yes" ]; then
     build_exit="$?"
     if [ "$build_exit" = '0' ]; then
         "./${run}" $run_args "$@" >"$output" 2>&1
-       sed -e 's/[[:cntrl:]]$//g' < "$output" >"${td_expected}"
+        sed -e 's/[[:cntrl:]]$//g' < "$output" >"${td_expected}"
         good="yes"
     else
         cat "$build_output" 1>&2