3 # Run the core library tests.
5 # You can build and run the unit tests as follows (assuming sh/bash;
6 # csh users should modify to suit):
13 # $ ./dalvik/run-core-tests.sh
15 # Note: You may also specify a specific test as an argument.
19 framework=$base/system/framework
22 export ANDROID_PRINTF_LOG=tag
23 export ANDROID_LOG_TAGS='*:w' # was: jdwp:i dalvikvm:i dalvikvmi:i'
24 export ANDROID_DATA=$datadir
25 export ANDROID_ROOT=$base/system
27 debug_opts=-Xcheck:jni
29 OPTS=`getopt -o dl: --long debug,log:,help -n $0 -- "$@"`
31 if [ $? != 0 ]; then echo "Terminating..." >&2; exit 1; fi
37 -d|--debug) debug_opts="$debug_opts -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=y"; shift ;;
38 -l) export ANDROID_LOG_TAGS='*:'$2; shift 2 ;;
39 --log) export ANDROID_LOG_TAGS="$2"; shift 2 ;;
41 echo usage: $0 [-d\|--debug] [-l\|--log] test.class.name;
42 printf "\t%-15s%s\n" "-d|--debug" "wait for the debugger";
43 printf "\t%-15s%s\n" "-l" "set the global logging level";
44 printf "\t%-15s%s\n" "--log" "set the logging TAG";
45 printf "\t%-15s%s\n" "--help" "this message";
49 *) echo "Internal Error!" >&2; exit 1 ;;
53 export LD_LIBRARY_PATH=$base/system/lib
54 export DYLD_LIBRARY_PATH=$base/system/lib
56 exe=$base/system/bin/dalvikvm
57 bpath=$framework/core.jar:$framework/ext.jar:$framework/framework.jar
58 cpath=$framework/core-tests.jar
61 # (1) The IO tests create lots of files in the current directory, so we change
63 # (2) Some of the core tests need a hell of a lot of memory, so we use a
64 # large value for both heap and stack.
66 rm -rf ${datadir}/xml_source
67 mkdir -p ${datadir}/xml_source
68 mkdir -p ${datadir}/dalvik-cache
69 cd $ANDROID_BUILD_TOP/dalvik
70 cp -R libcore/xml/src/test/resources/* ${datadir}/xml_source
74 -Duser.language=en -Duser.region=US -Djava.io.tmpdir=$datadir \
76 -Xbootclasspath:$bpath -classpath $cpath $debug_opts \
77 com.google.coretests.Main "$@"