1# Copyright (C) 2008 The Android Open Source Project 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15cts_dir := $(HOST_OUT)/cts 16cts_tools_src_dir := cts/tools 17 18cts_name := android-cts 19 20JUNIT_HOST_JAR := $(HOST_OUT_JAVA_LIBRARIES)/junit.jar 21HOSTTESTLIB_JAR := $(HOST_OUT_JAVA_LIBRARIES)/hosttestlib.jar 22TF_JAR := $(HOST_OUT_JAVA_LIBRARIES)/tradefed-prebuilt.jar 23CTS_TF_JAR := $(HOST_OUT_JAVA_LIBRARIES)/cts-tradefed.jar 24CTS_TF_EXEC_PATH ?= $(HOST_OUT_EXECUTABLES)/cts-tradefed 25CTS_TF_README_PATH := $(cts_tools_src_dir)/tradefed-host/README 26 27VMTESTSTF_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,vm-tests-tf,HOST) 28VMTESTSTF_JAR := $(VMTESTSTF_INTERMEDIATES)/android.core.vm-tests-tf.jar 29 30# The list of test packages that core-tests (libcore/Android.mk) 31# is split into. 32CTS_CORE_CASE_LIST := \ 33 android.core.tests.libcore.package.dalvik \ 34 android.core.tests.libcore.package.com \ 35 android.core.tests.libcore.package.conscrypt \ 36 android.core.tests.libcore.package.sun \ 37 android.core.tests.libcore.package.tests \ 38 android.core.tests.libcore.package.org \ 39 android.core.tests.libcore.package.libcore \ 40 android.core.tests.libcore.package.jsr166 \ 41 android.core.tests.libcore.package.harmony_annotation \ 42 android.core.tests.libcore.package.harmony_java_io \ 43 android.core.tests.libcore.package.harmony_java_lang \ 44 android.core.tests.libcore.package.harmony_java_math \ 45 android.core.tests.libcore.package.harmony_java_net \ 46 android.core.tests.libcore.package.harmony_java_nio \ 47 android.core.tests.libcore.package.harmony_java_text \ 48 android.core.tests.libcore.package.harmony_java_util \ 49 android.core.tests.libcore.package.harmony_javax_security \ 50 android.core.tests.libcore.package.okhttp \ 51 android.core.tests.runner 52 53# Additional CTS packages for code under libcore 54CTS_CORE_CASE_LIST += \ 55 android.core.tests.libcore.package.tzdata 56 57# The list of test packages that apache-harmony-tests (external/apache-harmony/Android.mk) 58# is split into. 59CTS_CORE_CASE_LIST += \ 60 android.core.tests.libcore.package.harmony_beans \ 61 android.core.tests.libcore.package.harmony_logging \ 62 android.core.tests.libcore.package.harmony_prefs \ 63 android.core.tests.libcore.package.harmony_sql 64 65 66CTS_TEST_JAR_LIST := \ 67 cts-junit \ 68 CtsJdwp 69 70# Depend on the full package paths rather than the phony targets to avoid 71# rebuilding the packages every time. 72CTS_CORE_CASES := $(foreach pkg,$(CTS_CORE_CASE_LIST),$(call intermediates-dir-for,APPS,$(pkg))/package.apk) 73CTS_TEST_JAR_FILES := $(foreach c,$(CTS_TEST_JAR_LIST),$(call intermediates-dir-for,JAVA_LIBRARIES,$(c))/javalib.jar) 74 75-include cts/CtsTestCaseList.mk 76 77# A module may have mutliple installed files (e.g. split apks) 78CTS_CASE_LIST_APKS := 79$(foreach m, $(CTS_TEST_CASE_LIST),\ 80 $(foreach fp, $(ALL_MODULES.$(m).BUILT_INSTALLED),\ 81 $(eval pair := $(subst :,$(space),$(fp)))\ 82 $(eval CTS_CASE_LIST_APKS += $(CTS_TESTCASES_OUT)/$(notdir $(word 2,$(pair))))))\ 83$(foreach m, $(CTS_CORE_CASE_LIST),\ 84 $(foreach fp, $(ALL_MODULES.$(m).BUILT_INSTALLED),\ 85 $(eval pair := $(subst :,$(space),$(fp)))\ 86 $(eval built := $(word 1,$(pair)))\ 87 $(eval installed := $(CTS_TESTCASES_OUT)/$(notdir $(word 2,$(pair))))\ 88 $(eval $(call copy-one-file, $(built), $(installed)))\ 89 $(eval CTS_CASE_LIST_APKS += $(installed)))) 90 91CTS_CASE_LIST_JARS := 92$(foreach m, $(CTS_TEST_JAR_LIST),\ 93 $(eval CTS_CASE_LIST_JARS += $(CTS_TESTCASES_OUT)/$(m).jar)) 94 95CTS_SHARED_LIBS := 96 97DEFAULT_TEST_PLAN := $(cts_dir)/$(cts_name)/resource/plans 98$(cts_dir)/all_cts_files_stamp: $(CTS_CORE_CASES) $(CTS_TEST_JAR_FILES) $(CTS_TEST_CASES) $(CTS_CASE_LIST_APKS) $(CTS_CASE_LIST_JARS) $(JUNIT_HOST_JAR) $(HOSTTESTLIB_JAR) $(CTS_HOST_LIBRARY_JARS) $(TF_JAR) $(VMTESTSTF_JAR) $(CTS_TF_JAR) $(CTS_TF_EXEC_PATH) $(CTS_TF_README_PATH) $(ADDITIONAL_TF_JARS) $(ACP) $(CTS_SHARED_LIBS) 99 100# Make necessary directory for CTS 101 $(hide) mkdir -p $(TMP_DIR) 102 $(hide) mkdir -p $(PRIVATE_DIR)/docs 103 $(hide) mkdir -p $(PRIVATE_DIR)/tools 104 $(hide) mkdir -p $(PRIVATE_DIR)/repository/testcases 105 $(hide) mkdir -p $(PRIVATE_DIR)/repository/plans 106# Copy executable and JARs to CTS directory 107 $(hide) $(ACP) -fp $(VMTESTSTF_JAR) $(CTS_TESTCASES_OUT) 108 $(hide) $(ACP) -fp $(HOSTTESTLIB_JAR) $(CTS_HOST_LIBRARY_JARS) $(TF_JAR) $(CTS_TF_JAR) $(CTS_TF_EXEC_PATH) $(ADDITIONAL_TF_JARS) $(CTS_TF_README_PATH) $(PRIVATE_DIR)/tools 109 $(hide) $(call copy-files-with-structure, $(CTS_SHARED_LIBS),$(HOST_OUT)/,$(PRIVATE_DIR)) 110 $(hide) touch $@ 111 112# Generate the test descriptions for the core-tests 113# Parameters: 114# $1 : The output file where the description should be written (without the '.xml' extension) 115# $2 : The AndroidManifest.xml corresponding to the test package 116# $3 : The jar file name on PRIVATE_CLASSPATH containing junit tests to search for 117# $4 : The package prefix of classes to include, possible empty 118# $5 : The architecture of the current build 119# $6 : The directory containing vogar expectations files 120# $7 : The Android.mk corresponding to the test package (required for host-side tests only) 121define generate-core-test-description 122@echo "Generate core-test description ("$(notdir $(1))")" 123$(hide) java -Xmx256M \ 124 -Xbootclasspath/a:$(PRIVATE_CLASSPATH):$(JUNIT_HOST_JAR) \ 125 -classpath $(HOST_OUT_JAVA_LIBRARIES)/descGen.jar:$(HOST_JDK_TOOLS_JAR) \ 126 $(PRIVATE_PARAMS) CollectAllTests $(1) $(2) $(3) "$(4)" $(5) $(6) $(7) 127endef 128 129CORE_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,core-libart,,COMMON) 130CONSCRYPT_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,conscrypt,,COMMON) 131BOUNCYCASTLE_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,bouncycastle,,COMMON) 132APACHEXML_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,apache-xml,,COMMON) 133OKHTTP_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,okhttp-nojarjar,,COMMON) 134OKHTTPTESTS_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,okhttp-tests-nojarjar,,COMMON) 135OKHTTP_REPACKAGED_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,okhttp,,COMMON) 136APACHEHARMONYTESTS_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,apache-harmony-tests,,COMMON) 137SQLITEJDBC_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,sqlite-jdbc,,COMMON) 138JUNIT_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,core-junit,,COMMON) 139CORETESTS_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,core-tests,,COMMON) 140JSR166TESTS_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,jsr166-tests,,COMMON) 141CONSCRYPTTESTS_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,conscrypt-tests,,COMMON) 142TZDATAUPDATETESTS_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,tzdata_update-tests,,COMMON) 143 144GEN_CLASSPATH := \ 145 $(CORE_INTERMEDIATES)/classes.jar:$(CONSCRYPT_INTERMEDIATES)/classes.jar:$(BOUNCYCASTLE_INTERMEDIATES)/classes.jar:$(APACHEXML_INTERMEDIATES)/classes.jar:$(APACHEHARMONYTESTS_INTERMEDIATES)/classes.jar:$(OKHTTP_INTERMEDIATES)/classes.jar:$(OKHTTPTESTS_INTERMEDIATES)/classes.jar:$(OKHTTP_REPACKAGED_INTERMEDIATES)/classes.jar:$(JUNIT_INTERMEDIATES)/classes.jar:$(SQLITEJDBC_INTERMEDIATES)/javalib.jar:$(CORETESTS_INTERMEDIATES)/javalib.jar:$(JSR166TESTS_INTERMEDIATES)/javalib.jar:$(CONSCRYPTTESTS_INTERMEDIATES)/javalib.jar:$(TZDATAUPDATETESTS_INTERMEDIATES)/javalib.jar 146 147CTS_CORE_XMLS := \ 148 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.dalvik.xml \ 149 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.com.xml \ 150 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.conscrypt.xml \ 151 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.sun.xml \ 152 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.tests.xml \ 153 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.org.xml \ 154 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.libcore.xml \ 155 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.jsr166.xml \ 156 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_annotation.xml \ 157 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_io.xml \ 158 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_lang.xml \ 159 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_math.xml \ 160 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_net.xml \ 161 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_nio.xml \ 162 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_text.xml \ 163 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_util.xml \ 164 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_javax_security.xml \ 165 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_beans.xml \ 166 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_logging.xml \ 167 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_prefs.xml \ 168 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_sql.xml \ 169 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.okhttp.xml \ 170 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.tzdata.xml \ 171 172$(CTS_CORE_XMLS): PRIVATE_CLASSPATH:=$(GEN_CLASSPATH) 173# Why does this depend on javalib.jar instead of classes.jar? Because 174# even though the tool will operate on the classes.jar files, the 175# build system requires that dependencies use javalib.jar. If 176# javalib.jar is up-to-date, then classes.jar is as well. Depending 177# on classes.jar will build the files incorrectly. 178CTS_CORE_XMLS_DEPS := $(CTS_CORE_CASES) $(HOST_OUT_JAVA_LIBRARIES)/descGen.jar $(JUNIT_HOST_JAR) $(CORE_INTERMEDIATES)/javalib.jar $(BOUNCYCASTLE_INTERMEDIATES)/javalib.jar $(APACHEXML_INTERMEDIATES)/javalib.jar $(APACHEHARMONYTESTS_INTERMEDIATES)/javalib.jar $(OKHTTP_INTERMEDIATES)/javalib.jar $(OKHTTPTESTS_INTERMEDIATES)/javalib.jar $(OKHTTP_REPACKAGED_INTERMEDIATES)/javalib.jar $(SQLITEJDBC_INTERMEDIATES)/javalib.jar $(JUNIT_INTERMEDIATES)/javalib.jar $(CORETESTS_INTERMEDIATES)/javalib.jar $(JSR166TESTS_INTERMEDIATES)/javalib.jar $(CONSCRYPTTESTS_INTERMEDIATES)/javalib.jar $(TZDATAUPDATETESTS_INTERMEDIATES)/javalib.jar build/core/tasks/cts.mk | $(ACP) 179 180$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.dalvik.xml: $(CTS_CORE_XMLS_DEPS) 181 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 182 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.dalvik,\ 183 cts/tests/core/libcore/dalvik/AndroidManifest.xml,\ 184 $(CORETESTS_INTERMEDIATES)/javalib.jar,dalvik,\ 185 $(TARGET_ARCH),libcore/expectations) 186 187$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.com.xml: $(CTS_CORE_XMLS_DEPS) 188 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 189 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.com,\ 190 cts/tests/core/libcore/com/AndroidManifest.xml,\ 191 $(CORETESTS_INTERMEDIATES)/javalib.jar,com,\ 192 $(TARGET_ARCH),libcore/expectations) 193 194$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.conscrypt.xml: $(CTS_CORE_XMLS_DEPS) 195 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 196 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.conscrypt,\ 197 cts/tests/core/libcore/conscrypt/AndroidManifest.xml,\ 198 $(CONSCRYPTTESTS_INTERMEDIATES)/javalib.jar,,\ 199 $(TARGET_ARCH),libcore/expectations) 200 201$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.sun.xml: $(CTS_CORE_XMLS_DEPS) 202 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 203 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.sun,\ 204 cts/tests/core/libcore/sun/AndroidManifest.xml,\ 205 $(CORETESTS_INTERMEDIATES)/javalib.jar,sun,\ 206 $(TARGET_ARCH),libcore/expectations) 207 208$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.tests.xml: $(CTS_CORE_XMLS_DEPS) 209 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 210 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.tests,\ 211 cts/tests/core/libcore/tests/AndroidManifest.xml,\ 212 $(CORETESTS_INTERMEDIATES)/javalib.jar,tests,\ 213 $(TARGET_ARCH),libcore/expectations) 214 215$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.org.xml: $(CTS_CORE_XMLS_DEPS) 216 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 217 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.org,\ 218 cts/tests/core/libcore/org/AndroidManifest.xml,\ 219 $(CORETESTS_INTERMEDIATES)/javalib.jar,\ 220 org.w3c.domts:\ 221 org.apache.harmony.security.tests:\ 222 org.apache.harmony.nio.tests:\ 223 org.apache.harmony.crypto.tests:\ 224 org.apache.harmony.regex.tests:\ 225 org.apache.harmony.luni.tests:\ 226 org.apache.harmony.tests.internal.net.www.protocol:\ 227 org.apache.harmony.tests.javax.net:\ 228 org.json,\ 229 $(TARGET_ARCH),libcore/expectations) 230 231$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.libcore.xml: $(CTS_CORE_XMLS_DEPS) 232 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 233 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.libcore,\ 234 cts/tests/core/libcore/libcore/AndroidManifest.xml,\ 235 $(CORETESTS_INTERMEDIATES)/javalib.jar,libcore,\ 236 $(TARGET_ARCH),libcore/expectations) 237 238$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.jsr166.xml: $(CTS_CORE_XMLS_DEPS) 239 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 240 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.jsr166,\ 241 cts/tests/core/libcore/jsr166/AndroidManifest.xml,\ 242 $(JSR166TESTS_INTERMEDIATES)/javalib.jar,jsr166,\ 243 $(TARGET_ARCH),libcore/expectations) 244 245$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_annotation.xml: $(CTS_CORE_XMLS_DEPS) 246 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 247 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_annotation,\ 248 cts/tests/core/libcore/harmony_annotation/AndroidManifest.xml,\ 249 $(CORETESTS_INTERMEDIATES)/javalib.jar,org.apache.harmony.annotation.tests,\ 250 $(TARGET_ARCH),libcore/expectations) 251 252$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_io.xml: $(CTS_CORE_XMLS_DEPS) 253 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 254 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_io,\ 255 cts/tests/core/libcore/harmony_java_io/AndroidManifest.xml,\ 256 $(CORETESTS_INTERMEDIATES)/javalib.jar,org.apache.harmony.tests.java.io,\ 257 $(TARGET_ARCH),libcore/expectations) 258 259$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_lang.xml: $(CTS_CORE_XMLS_DEPS) 260 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 261 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_lang,\ 262 cts/tests/core/libcore/harmony_java_lang/AndroidManifest.xml,\ 263 $(CORETESTS_INTERMEDIATES)/javalib.jar,org.apache.harmony.tests.java.lang,\ 264 $(TARGET_ARCH),libcore/expectations) 265 266$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_math.xml: $(CTS_CORE_XMLS_DEPS) 267 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 268 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_math,\ 269 cts/tests/core/libcore/harmony_java_math/AndroidManifest.xml,\ 270 $(CORETESTS_INTERMEDIATES)/javalib.jar,org.apache.harmony.tests.java.math,\ 271 $(TARGET_ARCH),libcore/expectations) 272 273$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_net.xml: $(CTS_CORE_XMLS_DEPS) 274 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 275 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_net,\ 276 cts/tests/core/libcore/harmony_java_net/AndroidManifest.xml,\ 277 $(CORETESTS_INTERMEDIATES)/javalib.jar,org.apache.harmony.tests.java.net,\ 278 $(TARGET_ARCH),libcore/expectations) 279 280$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_nio.xml: $(CTS_CORE_XMLS_DEPS) 281 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 282 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_nio,\ 283 cts/tests/core/libcore/harmony_java_nio/AndroidManifest.xml,\ 284 $(CORETESTS_INTERMEDIATES)/javalib.jar,org.apache.harmony.tests.java.nio,\ 285 $(TARGET_ARCH),libcore/expectations) 286 287$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_text.xml: $(CTS_CORE_XMLS_DEPS) 288 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 289 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_text,\ 290 cts/tests/core/libcore/harmony_java_text/AndroidManifest.xml,\ 291 $(CORETESTS_INTERMEDIATES)/javalib.jar,org.apache.harmony.tests.java.text,\ 292 $(TARGET_ARCH),libcore/expectations) 293 294$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_util.xml: $(CTS_CORE_XMLS_DEPS) 295 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 296 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_util,\ 297 cts/tests/core/libcore/harmony_java_util/AndroidManifest.xml,\ 298 $(CORETESTS_INTERMEDIATES)/javalib.jar,org.apache.harmony.tests.java.util,\ 299 $(TARGET_ARCH),libcore/expectations) 300 301$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_javax_security.xml: $(CTS_CORE_XMLS_DEPS) 302 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 303 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_javax_security,\ 304 cts/tests/core/libcore/harmony_javax_security/AndroidManifest.xml,\ 305 $(CORETESTS_INTERMEDIATES)/javalib.jar,org.apache.harmony.tests.javax.security,\ 306 $(TARGET_ARCH),libcore/expectations) 307 308$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_beans.xml: $(CTS_CORE_XMLS_DEPS) 309 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 310 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_beans,\ 311 cts/tests/core/libcore/harmony_beans/AndroidManifest.xml,\ 312 $(APACHEHARMONYTESTS_INTERMEDIATES)/javalib.jar,com.android.org.apache.harmony.beans,\ 313 $(TARGET_ARCH),libcore/expectations external/apache-harmony/Android.mk) 314 315$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_logging.xml: $(CTS_CORE_XMLS_DEPS) 316 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 317 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_logging,\ 318 cts/tests/core/libcore/harmony_logging/AndroidManifest.xml,\ 319 $(APACHEHARMONYTESTS_INTERMEDIATES)/javalib.jar,com.android.org.apache.harmony.logging,\ 320 $(TARGET_ARCH),libcore/expectations external/apache-harmony/Android.mk) 321 322$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_prefs.xml: $(CTS_CORE_XMLS_DEPS) 323 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 324 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_prefs,\ 325 cts/tests/core/libcore/harmony_prefs/AndroidManifest.xml,\ 326 $(APACHEHARMONYTESTS_INTERMEDIATES)/javalib.jar,com.android.org.apache.harmony.prefs,\ 327 $(TARGET_ARCH),libcore/expectations external/apache-harmony/Android.mk) 328 329$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_sql.xml: $(CTS_CORE_XMLS_DEPS) 330 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 331 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_sql,\ 332 cts/tests/core/libcore/harmony_sql/AndroidManifest.xml,\ 333 $(APACHEHARMONYTESTS_INTERMEDIATES)/javalib.jar,com.android.org.apache.harmony.sql,\ 334 $(TARGET_ARCH),libcore/expectations external/apache-harmony/Android.mk) 335 336$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.okhttp.xml: $(CTS_CORE_XMLS_DEPS) 337 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 338 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.okhttp,\ 339 cts/tests/core/libcore/okhttp/AndroidManifest.xml,\ 340 $(OKHTTPTESTS_INTERMEDIATES)/javalib.jar,,\ 341 $(TARGET_ARCH),libcore/expectations) 342 343$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.tzdata.xml: $(CTS_CORE_XMLS_DEPS) 344 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 345 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.tzdata,\ 346 cts/tests/core/libcore/tzdata/AndroidManifest.xml,\ 347 $(TZDATAUPDATETESTS_INTERMEDIATES)/javalib.jar,,\ 348 $(TARGET_ARCH),libcore/expectations) 349 350# ----- Generate the test descriptions for the vm-tests-tf ----- 351# 352CORE_VM_TEST_TF_DESC := $(CTS_TESTCASES_OUT)/android.core.vm-tests-tf.xml 353 354# core tests only needed to get hold of junit-framework-classes 355CORE_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,core-libart,,COMMON) 356JUNIT_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,core-junit,,COMMON) 357 358GEN_CLASSPATH := $(CORE_INTERMEDIATES)/classes.jar:$(JUNIT_INTERMEDIATES)/classes.jar:$(VMTESTSTF_JAR):$(TF_JAR) 359 360$(CORE_VM_TEST_TF_DESC): PRIVATE_CLASSPATH:=$(GEN_CLASSPATH) 361# Please see big comment above on why this line depends on javalib.jar instead of classes.jar 362$(CORE_VM_TEST_TF_DESC): $(HOST_OUT_JAVA_LIBRARIES)/descGen.jar $(JUNIT_HOST_JAR) $(CORE_INTERMEDIATES)/javalib.jar $(JUNIT_INTERMEDIATES)/javalib.jar $(VMTESTSTF_JAR) | $(ACP) 363 $(hide) mkdir -p $(CTS_TESTCASES_OUT) 364 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.vm-tests-tf,\ 365 cts/tests/vm-tests-tf/AndroidManifest.xml,\ 366 $(VMTESTSTF_JAR),"",\ 367 $(TARGET_ARCH),\ 368 libcore/expectations,\ 369 cts/tools/vm-tests-tf/Android.mk) 370 371# Generate the default test plan for User. 372# Usage: buildCts.py <testRoot> <ctsOutputDir> <tempDir> <androidRootDir> <docletPath> 373 374$(DEFAULT_TEST_PLAN): $(cts_dir)/all_cts_files_stamp $(cts_tools_src_dir)/utils/buildCts.py $(HOST_OUT_JAVA_LIBRARIES)/descGen.jar $(CTS_CORE_XMLS) $(CTS_TEST_XMLS) $(CORE_VM_TEST_TF_DESC) 375 $(hide) $(cts_tools_src_dir)/utils/buildCts.py cts/tests/tests/ $(PRIVATE_DIR) $(TMP_DIR) \ 376 $(TOP) $(HOST_OUT_JAVA_LIBRARIES)/descGen.jar 377 $(hide) mkdir -p $(dir $@) && touch $@ 378 379# Package CTS and clean up. 380# 381# TODO: 382# Pack cts.bat into the same zip file as well. See http://buganizer/issue?id=1656821 for more details 383INTERNAL_CTS_TARGET := $(cts_dir)/$(cts_name).zip 384$(INTERNAL_CTS_TARGET): PRIVATE_NAME := $(cts_name) 385$(INTERNAL_CTS_TARGET): PRIVATE_CTS_DIR := $(cts_dir) 386$(INTERNAL_CTS_TARGET): PRIVATE_DIR := $(cts_dir)/$(cts_name) 387$(INTERNAL_CTS_TARGET): TMP_DIR := $(cts_dir)/temp 388$(INTERNAL_CTS_TARGET): $(cts_dir)/all_cts_files_stamp $(DEFAULT_TEST_PLAN) 389 $(hide) echo "Package CTS: $@" 390 $(hide) cd $(dir $@) && zip -rq $(notdir $@) $(PRIVATE_NAME) 391 392.PHONY: cts 393cts: $(INTERNAL_CTS_TARGET) adb 394$(call dist-for-goals,cts,$(INTERNAL_CTS_TARGET)) 395 396