The Android Open Source Project | 2ad60cf | 2008-10-21 07:00:00 -0700 | [diff] [blame^] | 1 | #!/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 | |
| 17 | datadir=/tmp/${USER} |
| 18 | base=$OUT |
| 19 | framework=$base/system/framework |
| 20 | |
| 21 | export ANDROID_PRINTF_LOG=tag |
| 22 | export ANDROID_LOG_TAGS='*:w' # was: jdwp:i dalvikvm:i dalvikvmi:i' |
| 23 | export ANDROID_DATA=$datadir |
| 24 | export ANDROID_ROOT=$base/system |
| 25 | |
| 26 | debug_opts=-Xcheck:jni |
| 27 | debug_opts="$debug_opts -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n" |
| 28 | |
| 29 | export LD_LIBRARY_PATH=$base/system/lib |
| 30 | export DYLD_LIBRARY_PATH=$base/system/lib |
| 31 | |
| 32 | exe=$base/system/bin/dalvikvm |
| 33 | bpath=$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 | |
| 41 | rm -rf ${datadir}/xml_source |
| 42 | mkdir ${datadir}/xml_source |
| 43 | cp -R libcore/xml/src/test/resources/* ${datadir}/xml_source |
| 44 | |
| 45 | cd $tmp |
| 46 | exec $valgrind $exe -Djava.io.tmpdir=$tmp -Xmx512M -Xss32K -Xbootclasspath:$bpath $debug_opts com.google.coretests.Main "$@" |