blob: af7eec4b6a5ca00a0db4be4a2a855bb9174326b8 [file] [log] [blame]
#!/bin/bash
#
# Copyright (C) 2008 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Set up prog to be the path of this script, including following symlinks,
# and set up progdir to be the fully-qualified pathname of its directory.
prog="$0"
while [ -h "${prog}" ]; do
newProg=`/bin/ls -ld "${prog}"`
newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
if expr "x${newProg}" : 'x/' >/dev/null; then
prog="${newProg}"
else
progdir=`dirname "${prog}"`
prog="${progdir}/${newProg}"
fi
done
oldwd=`pwd`
progdir=`dirname "${prog}"`
cd "${progdir}"
progdir=`pwd`
prog="${progdir}"/`basename "${prog}"`
cd "${oldwd}"
libdir=`dirname $progdir`/framework
# Parse the test type, by default it will run against all tests
# FIXME:
# This should be removed after vm-tests and core-tests have been integrated
# in CTS.
testType="all"
if [ ! -z $1 ]; then
if [ $1 == "all" -o $1 == "dalvik" -o $1 == "android" ]; then
testType=$1
shift
fi
fi
javaOpts=""
while expr "x$1" : 'x-J' >/dev/null; do
opt=`expr "$1" : '-J\(.*\)'`
javaOpts="${javaOpts} -${opt}"
shift
done
#exec java $javaOpts -jar $libdir/hat.jar "$@"
#######################################################################
# Original content of invocation script follows. Uses values cleverly
# deduced by the above code. If you want to use this for a different
# set of packages, adjust both the list of source directories and the
# list of packages.
#######################################################################
export CLASSES=$progdir/../framework/test-progress-new.jar
export INPUT=$ANDROID_BUILD_TOP
export OUTPUT=$ANDROID_BUILD_TOP/out/target/common/cts/test-progress-new
TESTCOVERAGE_FLAGS="countdisabled,acceptcandx"
if [[ ("$1" == "-f") && ("$2" != "") ]]; then
TESTCOVERAGE_FLAGS=$2
echo "running with flag '$TESTCOVERAGE_FLAGS'"
else
if [ "$1" != "" ]; then
export OUTPUT=$1
fi
fi
DALVIK_SOURCE_PATH="\
$INPUT/dalvik/libcore/annotation/src/main/java:\
$INPUT/dalvik/libcore/archive/src/main/java:\
$INPUT/dalvik/libcore/auth/src/main/java:\
$INPUT/dalvik/libcore/awt-kernel/src/main/java:\
$INPUT/dalvik/libcore/concurrent/src/main/java:\
$INPUT/dalvik/libcore/crypto/src/main/java:\
$INPUT/dalvik/libcore/dalvik/src/main/java:\
$INPUT/dalvik/libcore/icu/src/main/java:\
$INPUT/dalvik/libcore/json/src/main/java:\
$INPUT/dalvik/libcore/junit/src/main/java:\
$INPUT/dalvik/libcore/logging/src/main/java:\
$INPUT/dalvik/libcore/luni-kernel/src/main/java:\
$INPUT/dalvik/libcore/luni/src/main/java:\
$INPUT/dalvik/libcore/math/src/main/java:\
$INPUT/dalvik/libcore/nio_char/src/main/java:\
$INPUT/dalvik/libcore/nio/src/main/java:\
$INPUT/dalvik/libcore/openssl/src/main/java:\
$INPUT/dalvik/libcore/prefs/src/main/java:\
$INPUT/dalvik/libcore/regex/src/main/java:\
$INPUT/dalvik/libcore/security-kernel/src/main/java:\
$INPUT/dalvik/libcore/security/src/main/java:\
$INPUT/dalvik/libcore/sql/src/main/java:\
$INPUT/dalvik/libcore/suncompat/src/main/java:\
$INPUT/dalvik/libcore/text/src/main/java:\
$INPUT/dalvik/libcore/xml/src/main/java:\
$INPUT/dalvik/libcore/x-net/src/main/java:\
$INPUT/tests/HttpClient:\
$INPUT/dalvik/libcore/annotation/src/test/java:\
$INPUT/dalvik/libcore/archive/src/test/java:\
$INPUT/dalvik/libcore/crypto/src/test/java:\
$INPUT/dalvik/libcore/crypto/src/test/java/support/common/java:\
$INPUT/dalvik/libcore/dalvik/src/test/java:\
$INPUT/dalvik/libcore/logging/src/test/java:\
$INPUT/dalvik/libcore/luni-kernel/src/test/java:\
$INPUT/dalvik/libcore/luni/src/test/java:\
$INPUT/dalvik/libcore/math/src/test/java:\
$INPUT/dalvik/libcore/nio_char/src/test/java:\
$INPUT/dalvik/libcore/nio/src/test/java:\
$INPUT/dalvik/libcore/prefs/src/test/java:\
$INPUT/dalvik/libcore/regex/src/test/java:\
$INPUT/dalvik/libcore/security/src/test/java:\
$INPUT/dalvik/libcore/sql/src/test/java:\
$INPUT/dalvik/libcore/support/src/test/java:\
$INPUT/dalvik/libcore/text/src/test/java:\
$INPUT/dalvik/libcore/xml/src/test/java:\
$INPUT/dalvik/libcore/x-net/src/test/java"
DALVIK_PACKAGE="\
junit.framework \
org.apache.harmony.annotation.tests.java.lang.annotation \
org.apache.harmony.archive.tests.java.util.jar \
org.apache.harmony.archive.tests.java.util.zip \
org.apache.harmony.crypto.tests.javax.crypto \
org.apache.harmony.crypto.tests.javax.crypto.spec \
org.apache.harmony.crypto.tests.javax.crypto.interfaces \
org.apache.harmony.logging.tests.java.util.logging \
org.apache.harmony.luni.tests.internal.net.www.protocol.http \
org.apache.harmony.luni.tests.internal.net.www.protocol.https \
org.apache.harmony.luni.tests.java.io \
org.apache.harmony.luni.tests.java.lang \
org.apache.harmony.luni.tests.java.net \
org.apache.harmony.luni.tests.java.util \
org.apache.harmony.luni.tests.util \
org.apache.harmony.math.tests.java.math \
org.apache.harmony.nio_char.tests.java.nio.charset \
org.apache.harmony.nio_char.tests.java.nio.charset.spi \
org.apache.harmony.nio.tests.java.nio \
org.apache.harmony.nio.tests.java.nio.channels \
org.apache.harmony.nio.tests.java.nio.channels.spi \
org.apache.harmony.prefs.tests.java.util.prefs \
org.apache.harmony.regex.tests.java.util.regex \
org.apache.harmony.security.tests.java.security \
org.apache.harmony.sql.tests.java.sql \
org.apache.harmony.sql.tests.javax.sql \
tests.SQLite \
org.apache.harmony.testframework.serialization \
org.apache.harmony.text.tests.java.text \
targets \
tests.api.java.io \
tests.api.java.lang \
tests.api.java.lang.ref \
tests.api.java.lang.reflect \
tests.api.java.math \
tests.api.java.net \
tests.api.java.nio.charset \
tests.api.java.security \
tests.api.java.util \
tests.api.javax.net \
tests.api.javax.net.ssl \
tests.api.javax.security.auth \
tests.api.javax.security.cert \
tests.api.javax.xml.parsers \
tests.api.org.xml.sax \
tests.api.org.xml.sax.ext \
tests.api.org.xml.sax.helpers \
tests.api.org.apache.harmony.kernel.dalvik \
tests.java.security \
tests.java.sql \
tests.javax.sql \
tests.org.w3c.dom \
tests.security \
tests.security.acl \
tests.security.cert \
tests.security.interfaces \
tests.security.permissions \
tests.security.spec \
tests.sql \
tests.support \
tests.targets.security \
tests.targets.security.cert \
tests.xml \
java.io \
java.lang \
java.lang.annotation \
java.lang.ref \
java.lang.reflect \
java.math \
java.net \
java.nio \
java.nio.channels \
java.nio.channels.spi \
java.nio.charset \
java.nio.charset.spi \
java.security \
java.security.acl \
java.security.cert \
java.security.interfaces \
java.security.spec \
java.sql \
java.text \
java.util \
java.util.jar \
java.util.logging \
java.util.prefs \
java.util.regex \
java.util.zip \
javax.crypto \
javax.crypto.interfaces \
javax.crypto.spec \
javax.net \
javax.net.ssl \
javax.security.auth \
javax.security.auth.callback \
javax.security.auth.login \
javax.security.auth.x500 \
javax.security.cert \
javax.sql \
javax.xml.parsers \
org.xml.sax \
org.xml.sax.ext \
org.xml.sax.helpers"
ANDROID_SOURCE_PATH="\
${INPUT}/frameworks/base/core/java:\
${INPUT}/frameworks/base/graphics/java:\
${INPUT}/frameworks/base/location/java:\
${INPUT}/frameworks/base/media/java:\
${INPUT}/frameworks/base/opengl/java:\
${INPUT}/frameworks/base/sax/java:\
${INPUT}/frameworks/base/telephony/java:\
${INPUT}/frameworks/base/wifi/java:\
${INPUT}/cts/tests/tests/app/src:\
${INPUT}/cts/tests/tests/content/src:\
${INPUT}/cts/tests/tests/database/src:\
${INPUT}/cts/tests/tests/graphics/src:\
${INPUT}/cts/tests/tests/hardware/src:\
${INPUT}/cts/tests/tests/location/src:\
${INPUT}/cts/tests/tests/media/src:\
${INPUT}/cts/tests/tests/net/src:\
${INPUT}/cts/tests/tests/opengl/src:\
${INPUT}/cts/tests/tests/os/src:\
${INPUT}/cts/tests/tests/preference/src:\
${INPUT}/cts/tests/tests/provider/src:\
${INPUT}/cts/tests/tests/sax/src:\
${INPUT}/cts/tests/tests/security/src:\
${INPUT}/cts/tests/tests/speech/src:\
${INPUT}/cts/tests/tests/telephony/src:\
${INPUT}/cts/tests/tests/text/src:\
${INPUT}/cts/tests/tests/util/src:\
${INPUT}/cts/tests/tests/view/src:\
${INPUT}/cts/tests/tests/webkit/src:\
${INPUT}/cts/tests/tests/widget/src:\
${INPUT}/cts/tests/src:\
${INPUT}/frameworks/base/test-runner:\
${INPUT}/dalvik/libcore/dalvik/src/main/java:\
${INPUT}/dalvik/libcore/xml/src/main/java:\
${INPUT}/dalvik/libcore/junit/src/main/java:"
ANDROID_PACKAGE="\
android.accessibilityservice \
android.accessibilityservice.cts \
android.accounts \
android.accounts.cts \
android.app \
android.app.cts \
android.bluetooth \
android.content \
android.content.cts \
android.content.pm \
android.content.pm.cts \
android.content.res \
android.content.res.cts \
android.database \
android.database.cts \
android.database.sqlite \
android.database.sqlite.cts \
android.gesture \
android.gesture.cts \
android.graphics \
android.graphics.cts \
android.graphics.drawable \
android.graphics.drawable.cts \
android.graphics.drawable.shapes \
android.graphics.drawable.shapes.cts \
android.hardware \
android.hardware.cts \
android.location \
android.location.cts \
android.media \
android.media.cts \
android.net \
android.net.cts \
android.net.http \
android.net.http.cts \
android.net.wifi \
android.net.wifi.cts \
android.opengl \
android.opengl.cts \
android.os \
android.os.cts \
android.preference \
android.preference.cts \
android.provider \
android.provider.cts \
android.sax \
android.sax.cts \
android.security \
android.security.cts \
android.speech.srec \
android.speech.srec.cts \
android.speech.tts \
android.speech.tts.cts \
android.telephony \
android.telephony.cdma \
android.telephony.cts \
android.telephony.gsm \
android.telephony.gsm.cts \
android.text \
android.text.cts \
android.text.format \
android.text.format.cts \
android.text.method \
android.text.method.cts \
android.text.style \
android.text.style.cts \
android.text.util \
android.text.util.cts \
android.util \
android.util.cts \
android.view \
android.view.cts \
android.view.accessibility \
android.view.accessibility.cts \
android.view.animation \
android.view.animation.cts \
android.view.inputmethod \
android.view.inputmethod.cts \
android.webkit \
android.webkit.cts \
android.widget \
android.widget.cts"
ALL_SOURCE_PATH="${DALVIK_SOURCE_PATH}:${ANDROID_SOURCE_PATH}"
ALL_PACKAGE="${DALVIK_PACKAGE} ${ANDROID_PACKAGE}"
SOURCE_PATH=""
if [ ${testType} == "all" ]; then
SOURCE_PATH="${ALL_SOURCE_PATH} ${ALL_PACKAGE}"
elif [ ${testType} == "dalvik" ]; then
SOURCE_PATH="${DALVIK_SOURCE_PATH} ${DALVIK_PACKAGE}"
elif [ ${testType} == "android" ]; then
SOURCE_PATH="${ANDROID_SOURCE_PATH} ${ANDROID_PACKAGE}"
fi
javadoc -J-Xmx1024M -docletpath $CLASSES -doclet testprogress2.TestCoverageDoclet -f $TESTCOVERAGE_FLAGS -d $OUTPUT -sourcepath $SOURCE_PATH
# left out on purpose:
# org.w3c.dom packages: the tests in the xml module are superseded by the
# official w3c test suite located in the dom module.
#
# left out on purpose:
# concurrent packages: a full test suite exists (JCP JSR166 test suite) and it located at
# device/dalvik/libcore/concurrent/src/test/java/tests/api/java/util/concurrent
#
#java.util.concurrent \
#java.util.concurrent.atomic \
#java.util.concurrent.locks \
#
# left out on purpose: (100% coverage/jsr)
# tests/api/java/util/concurrent
# tests.api.java.util.concurrent
# all test source path found by:
# find . -type d | sed -e '/.svn/d' | grep "src/test/java" | sed -e 's/test\/java.*/test\/java/g' | sort -u
# the list of packages (test only) was taken from:
# egrep -R "[ \.]TestCase" dalvik/* | sed -e '/.svn/d' | cut -d':' -f 1 | cut -d'.' -f1 | sed -e's/.*src\/test\/java\///g;s/\/[^\/]*$//g' | sort -u