3 # Runs the core library tests on the Linux host.
6 # source build/envsetup.sh
9 # mmm dalvik # this builds the tests themselves
10 # ./dalvik/run-core-tests.sh
12 # Note: You may also specify a specific test as an argument to this script.
16 framework=$base/system/framework
19 export ANDROID_PRINTF_LOG=tag
20 export ANDROID_LOG_TAGS='*:w' # was: jdwp:i dalvikvm:i dalvikvmi:i'
21 export ANDROID_DATA=$datadir
22 export ANDROID_ROOT=$base/system
24 debug_opts=-Xcheck:jni
26 OPTS=`getopt -o dl: --long debug,log:,help -n $0 -- "$@"`
28 if [ $? != 0 ]; then echo "Terminating..." >&2; exit 1; fi
34 -d|--debug) debug_opts="$debug_opts -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"; shift ;;
35 -l) export ANDROID_LOG_TAGS='*:'$2; shift 2 ;;
36 --log) export ANDROID_LOG_TAGS="$2"; shift 2 ;;
38 echo usage: $0 [-d\|--debug] [-l\|--log] test.class.name;
39 printf "\t%-15s%s\n" "-d|--debug" "wait for the debugger";
40 printf "\t%-15s%s\n" "-l" "set the global logging level";
41 printf "\t%-15s%s\n" "--log" "set the logging TAG";
42 printf "\t%-15s%s\n" "--help" "this message";
46 *) echo "Internal Error!" >&2; exit 1 ;;
50 export LD_LIBRARY_PATH=$base/system/lib
51 export DYLD_LIBRARY_PATH=$base/system/lib
53 exe=$base/system/bin/dalvikvm
54 bpath=$framework/core.jar:$framework/ext.jar:$framework/framework.jar
56 # Build the classpath by putting together the jar file for each module.
57 classpath="$framework/sqlite-jdbc.jar" # Bonus item for jdbc testing.
58 modules="annotation archive concurrent crypto dom icu json \
59 logging luni-kernel luni math nio nio_char prefs regex security sql \
60 suncompat support text x-net xml"
61 for module in $modules; do
62 classpath="$classpath:$framework/core-tests-$module.jar"
66 # (1) The IO tests create lots of files in the current directory, so we change
68 # (2) Some of the core tests need a hell of a lot of memory, so we use a
69 # large value for both heap and stack.
71 rm -rf ${datadir}/xml_source
72 mkdir -p ${datadir}/xml_source
73 mkdir -p ${datadir}/dalvik-cache
74 cd $ANDROID_BUILD_TOP/dalvik
75 cp -R libcore/xml/src/test/resources/* ${datadir}/xml_source
85 -Duser.home=$datadir \
86 -Djava.io.tmpdir=$datadir \
87 -Djavax.net.ssl.trustStore=$base/system/etc/security/cacerts.bks \
88 -Xbootclasspath:$bpath \
89 -classpath $classpath \
92 com.google.coretests.Main "$@"