blob: b6ed423ae176f4e9f7edca8fce7e43b0622a7617 [file] [log] [blame]
The Android Open Source Project2ad60cf2008-10-21 07:00:00 -07001#!/bin/sh
2#
3# Run the core library tests.
4#
5# You can build and run the unit tests as follows (assuming sh/bash;
6# csh users should modify to suit):
7#
8# $ cd <client>/device
9# $ . envsetup.sh
10# $ lunch 2
11# $ make
12# $ make core-tests
13# $ ./dalvik/run-core-tests.sh
14#
15# Note: You may also specify a specific test as an argument.
16
17datadir=/tmp/${USER}
18base=$OUT
19framework=$base/system/framework
20
21export ANDROID_PRINTF_LOG=tag
22export ANDROID_LOG_TAGS='*:w' # was: jdwp:i dalvikvm:i dalvikvmi:i'
23export ANDROID_DATA=$datadir
24export ANDROID_ROOT=$base/system
25
26debug_opts=-Xcheck:jni
27debug_opts="$debug_opts -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"
28
29export LD_LIBRARY_PATH=$base/system/lib
30export DYLD_LIBRARY_PATH=$base/system/lib
31
32exe=$base/system/bin/dalvikvm
33bpath=$framework/core.jar:$framework/ext.jar:$framework/framework.jar:$framework/core-tests.jar:$framework/http-tests.jar
34
35# Notes:
36# (1) The IO tests create lots of files in the current directory, so we change
37# to /tmp first.
38# (2) Some of the core tests need a hell of a lot of memory, so we use a
39# large value for both heap and stack.
40
41rm -rf ${datadir}/xml_source
42mkdir ${datadir}/xml_source
43cp -R libcore/xml/src/test/resources/* ${datadir}/xml_source
44
45cd $tmp
46exec $valgrind $exe -Djava.io.tmpdir=$tmp -Xmx512M -Xss32K -Xbootclasspath:$bpath $debug_opts com.google.coretests.Main "$@"