blob: 1fdb296ac642e181344443c5c05705e9909166a8 [file] [log] [blame]
The Android Open Source Project88b60792009-03-03 19:28:42 -08001# 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
Neil Fuller4fdf6742014-05-29 13:18:35 +010020JUNIT_HOST_JAR := $(HOST_OUT_JAVA_LIBRARIES)/junit.jar
Phil Dubach3b7521b2009-08-19 16:26:40 -070021HOSTTESTLIB_JAR := $(HOST_OUT_JAVA_LIBRARIES)/hosttestlib.jar
Brett Chabot358b2472011-01-30 15:07:21 -080022TF_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
Brett Chabote847a392011-02-18 15:13:50 -080025CTS_TF_README_PATH := $(cts_tools_src_dir)/tradefed-host/README
Brett Chabot67bae7f2009-06-26 14:41:30 -070026
Ying Wang02d75da2012-08-21 11:54:49 -070027VMTESTSTF_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,vm-tests-tf,HOST)
Brian Muramatsuc0a69242012-01-05 18:24:43 -080028VMTESTSTF_JAR := $(VMTESTSTF_INTERMEDIATES)/android.core.vm-tests-tf.jar
29
Narayan Kamath13a3fe82013-12-31 15:15:41 +000030# The list of test packages that core-tests (libcore/Android.mk)
31# is split into.
Brian Carlstromb6a08f02010-05-28 17:02:57 -070032CTS_CORE_CASE_LIST := \
Brian Carlstromaf850002011-05-27 00:04:57 -070033 android.core.tests.libcore.package.dalvik \
34 android.core.tests.libcore.package.com \
Kenny Root69c00c92013-09-05 15:10:44 -070035 android.core.tests.libcore.package.conscrypt \
Brian Carlstromaf850002011-05-27 00:04:57 -070036 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 \
Tsu Chiang Chuangd1f75012013-08-21 11:46:03 -070040 android.core.tests.libcore.package.jsr166 \
Tsu Chiang Chuang6b874c92012-10-24 16:47:49 -070041 android.core.tests.libcore.package.harmony_annotation \
Narayan Kamath13a3fe82013-12-31 15:15:41 +000042 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 \
Neil Fuller4fdf6742014-05-29 13:18:35 +010050 android.core.tests.libcore.package.okhttp \
Narayan Kamath13a3fe82013-12-31 15:15:41 +000051 android.core.tests.runner
52
Neil Fuller56128c52015-03-13 14:22:11 +000053# Additional CTS packages for code under libcore
54CTS_CORE_CASE_LIST += \
55 android.core.tests.libcore.package.tzdata
56
Narayan Kamath13a3fe82013-12-31 15:15:41 +000057# The list of test packages that apache-harmony-tests (external/apache-harmony/Android.mk)
58# is split into.
59CTS_CORE_CASE_LIST += \
Tsu Chiang Chuang6b874c92012-10-24 16:47:49 -070060 android.core.tests.libcore.package.harmony_beans \
61 android.core.tests.libcore.package.harmony_logging \
Tsu Chiang Chuang6b874c92012-10-24 16:47:49 -070062 android.core.tests.libcore.package.harmony_prefs \
Narayan Kamath13a3fe82013-12-31 15:15:41 +000063 android.core.tests.libcore.package.harmony_sql
Urs Grobb3c6b2d2009-04-17 11:27:08 -070064
Tsu Chiang Chuangbcf11b02014-06-18 09:59:49 -070065
66CTS_TEST_JAR_LIST := \
Tsu Chiang Chuangc73d2002014-06-26 11:40:02 -070067 cts-junit \
Tsu Chiang Chuangbcf11b02014-06-18 09:59:49 -070068 CtsJdwp
69
Brian Muramatsuc0a69242012-01-05 18:24:43 -080070# 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)
Tsu Chiang Chuangbcf11b02014-06-18 09:59:49 -070073CTS_TEST_JAR_FILES := $(foreach c,$(CTS_TEST_JAR_LIST),$(call intermediates-dir-for,JAVA_LIBRARIES,$(c))/javalib.jar)
Brian Muramatsuc0a69242012-01-05 18:24:43 -080074
Brian Muramatsufa3d88f2010-07-22 14:46:53 -070075-include cts/CtsTestCaseList.mk
76CTS_CASE_LIST := $(CTS_CORE_CASE_LIST) $(CTS_TEST_CASE_LIST)
The Android Open Source Project88b60792009-03-03 19:28:42 -080077
Ying Wang89ec7982014-10-01 11:46:30 -070078# A module may have mutliple installed files (e.g. split apks)
79CTS_CASE_LIST_APKS :=
80CTS_CASE_LIST_APKS_DIR := $(cts_dir)/$(cts_name)/repository/testcases/
81$(foreach m, $(CTS_CASE_LIST),\
82 $(foreach fp, $(ALL_MODULES.$(m).BUILT_INSTALLED),\
83 $(eval pair := $(subst :,$(space),$(fp)))\
84 $(eval built := $(word 1,$(pair)))\
85 $(eval installed := $(CTS_CASE_LIST_APKS_DIR)/$(notdir $(word 2,$(pair))))\
86 $(eval $(call copy-one-file, $(built), $(installed)))\
87 $(eval CTS_CASE_LIST_APKS += $(installed))))
88
Joe Onorato80042662010-06-15 17:29:19 -040089DEFAULT_TEST_PLAN := $(cts_dir)/$(cts_name)/resource/plans
Ying Wang89ec7982014-10-01 11:46:30 -070090$(cts_dir)/all_cts_files_stamp: $(CTS_CORE_CASES) $(CTS_TEST_CASES) $(CTS_CASE_LIST_APKS) $(JUNIT_HOST_JAR) $(HOSTTESTLIB_JAR) $(CTS_HOST_LIBRARY_JARS) $(TF_JAR) $(VMTESTSTF_JAR) $(CTS_TF_JAR) $(CTS_TF_EXEC_PATH) $(CTS_TF_README_PATH) $(ACP) $(CTS_TEST_JAR_FILES)
The Android Open Source Project88b60792009-03-03 19:28:42 -080091# Make necessary directory for CTS
Brian Muramatsu1cf9e0e2010-12-06 12:49:13 -080092 $(hide) mkdir -p $(TMP_DIR)
93 $(hide) mkdir -p $(PRIVATE_DIR)/docs
94 $(hide) mkdir -p $(PRIVATE_DIR)/tools
95 $(hide) mkdir -p $(PRIVATE_DIR)/repository/testcases
96 $(hide) mkdir -p $(PRIVATE_DIR)/repository/plans
Brian Muramatsu45a971d2010-09-02 12:36:59 -070097# Copy executable and JARs to CTS directory
Brian Muramatsuc0a69242012-01-05 18:24:43 -080098 $(hide) $(ACP) -fp $(VMTESTSTF_JAR) $(PRIVATE_DIR)/repository/testcases
Brett Chabotcf1d2b12014-09-25 12:38:36 -070099 $(hide) $(ACP) -fp $(HOSTTESTLIB_JAR) $(CTS_HOST_LIBRARY_JARS) $(TF_JAR) $(CTS_TF_JAR) $(CTS_TF_EXEC_PATH) $(CTS_TF_README_PATH) $(PRIVATE_DIR)/tools
The Android Open Source Project88b60792009-03-03 19:28:42 -0800100# Change mode of the executables
Tsu Chiang Chuangbcf11b02014-06-18 09:59:49 -0700101 $(foreach jar,$(CTS_TEST_JAR_LIST),$(call copy-testcase-jar,$(jar)))
Brian Muramatsu237fa072011-12-12 23:54:49 -0800102 $(foreach testcase,$(CTS_TEST_CASES),$(call copy-testcase,$(testcase)))
The Android Open Source Project88b60792009-03-03 19:28:42 -0800103 $(hide) touch $@
104
Urs Grobb3c6b2d2009-04-17 11:27:08 -0700105# Generate the test descriptions for the core-tests
Phil Dubachc539dbe2009-08-07 10:59:04 -0700106# Parameters:
107# $1 : The output file where the description should be written (without the '.xml' extension)
108# $2 : The AndroidManifest.xml corresponding to the test package
Brian Carlstrombb7c6d82011-04-01 15:45:58 -0700109# $3 : The jar file name on PRIVATE_CLASSPATH containing junit tests to search for
Brian Carlstromaf850002011-05-27 00:04:57 -0700110# $4 : The package prefix of classes to include, possible empty
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700111# $5 : The architecture of the current build
112# $6 : The directory containing vogar expectations files
113# $7 : The Android.mk corresponding to the test package (required for host-side tests only)
Urs Grobb3c6b2d2009-04-17 11:27:08 -0700114define generate-core-test-description
115@echo "Generate core-test description ("$(notdir $(1))")"
Brian Carlstrombb7c6d82011-04-01 15:45:58 -0700116$(hide) java -Xmx256M \
Neil Fuller4fdf6742014-05-29 13:18:35 +0100117 -Xbootclasspath/a:$(PRIVATE_CLASSPATH):$(JUNIT_HOST_JAR) \
118 -classpath $(HOST_OUT_JAVA_LIBRARIES)/descGen.jar:$(HOST_JDK_TOOLS_JAR) \
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700119 $(PRIVATE_PARAMS) CollectAllTests $(1) $(2) $(3) "$(4)" $(5) $(6) $(7)
Urs Grobb3c6b2d2009-04-17 11:27:08 -0700120endef
The Android Open Source Project6a5f7f02009-03-05 14:34:30 -0800121
Brian Carlstromb1dafb12014-06-18 15:11:01 -0700122CORE_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,core-libart,,COMMON)
Kenny Rootdfaf3842013-04-29 13:25:29 -0700123CONSCRYPT_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,conscrypt,,COMMON)
Brian Carlstrombb7c6d82011-04-01 15:45:58 -0700124BOUNCYCASTLE_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,bouncycastle,,COMMON)
125APACHEXML_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,apache-xml,,COMMON)
Neil Fuller4fdf6742014-05-29 13:18:35 +0100126OKHTTP_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,okhttp-nojarjar,,COMMON)
127OKHTTPTESTS_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,okhttp-tests-nojarjar,,COMMON)
128OKHTTP_REPACKAGED_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,okhttp,,COMMON)
129APACHEHARMONYTESTS_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,apache-harmony-tests,,COMMON)
Brian Carlstrombb7c6d82011-04-01 15:45:58 -0700130SQLITEJDBC_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,sqlite-jdbc,,COMMON)
Brian Carlstromd05d74b2010-05-28 18:47:17 -0700131JUNIT_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,core-junit,,COMMON)
Brian Carlstrombb7c6d82011-04-01 15:45:58 -0700132CORETESTS_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,core-tests,,COMMON)
Tsu Chiang Chuangd1f75012013-08-21 11:46:03 -0700133JSR166TESTS_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,jsr166-tests,,COMMON)
Kenny Root69c00c92013-09-05 15:10:44 -0700134CONSCRYPTTESTS_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,conscrypt-tests,,COMMON)
Neil Fuller56128c52015-03-13 14:22:11 +0000135TZDATAUPDATETESTS_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,tzdata_update-tests,,COMMON)
Brian Carlstrombb7c6d82011-04-01 15:45:58 -0700136
Neil Fuller56128c52015-03-13 14:22:11 +0000137GEN_CLASSPATH := \
138 $(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
The Android Open Source Project6a5f7f02009-03-05 14:34:30 -0800139
Brian Muramatsuc0a69242012-01-05 18:24:43 -0800140CTS_CORE_XMLS := \
141 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.dalvik.xml \
142 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.com.xml \
Kenny Root69c00c92013-09-05 15:10:44 -0700143 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.conscrypt.xml \
Brian Muramatsuc0a69242012-01-05 18:24:43 -0800144 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.sun.xml \
145 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.tests.xml \
146 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.org.xml \
Tsu Chiang Chuangd1f75012013-08-21 11:46:03 -0700147 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.libcore.xml \
Tsu Chiang Chuang6b874c92012-10-24 16:47:49 -0700148 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.jsr166.xml \
149 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_annotation.xml \
Narayan Kamath13a3fe82013-12-31 15:15:41 +0000150 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_io.xml \
151 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_lang.xml \
152 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_math.xml \
153 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_net.xml \
154 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_nio.xml \
155 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_text.xml \
156 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_util.xml \
157 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_javax_security.xml \
Tsu Chiang Chuang6b874c92012-10-24 16:47:49 -0700158 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_beans.xml \
159 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_logging.xml \
Tsu Chiang Chuang6b874c92012-10-24 16:47:49 -0700160 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_prefs.xml \
Tsu Chiang Chuang6b874c92012-10-24 16:47:49 -0700161 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_sql.xml \
Neil Fuller4fdf6742014-05-29 13:18:35 +0100162 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.okhttp.xml \
Neil Fuller56128c52015-03-13 14:22:11 +0000163 $(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.tzdata.xml \
Brian Muramatsuc0a69242012-01-05 18:24:43 -0800164
165$(CTS_CORE_XMLS): PRIVATE_CLASSPATH:=$(GEN_CLASSPATH)
The Android Open Source Project6a5f7f02009-03-05 14:34:30 -0800166# Why does this depend on javalib.jar instead of classes.jar? Because
167# even though the tool will operate on the classes.jar files, the
168# build system requires that dependencies use javalib.jar. If
169# javalib.jar is up-to-date, then classes.jar is as well. Depending
170# on classes.jar will build the files incorrectly.
Neil Fuller4fdf6742014-05-29 13:18:35 +0100171CTS_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 build/core/tasks/cts.mk | $(ACP)
Ying Wang6238cd92013-07-10 16:58:52 -0700172
173$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.dalvik.xml: $(CTS_CORE_XMLS_DEPS)
Brian Muramatsuc0a69242012-01-05 18:24:43 -0800174 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
175 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.dalvik,\
Brian Carlstromaf850002011-05-27 00:04:57 -0700176 cts/tests/core/libcore/dalvik/AndroidManifest.xml,\
177 $(CORETESTS_INTERMEDIATES)/javalib.jar,dalvik,\
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700178 $(TARGET_ARCH),libcore/expectations)
Ying Wang6238cd92013-07-10 16:58:52 -0700179
180$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.com.xml: $(CTS_CORE_XMLS_DEPS)
181 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
Brian Muramatsuc0a69242012-01-05 18:24:43 -0800182 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.com,\
Brian Carlstromaf850002011-05-27 00:04:57 -0700183 cts/tests/core/libcore/com/AndroidManifest.xml,\
184 $(CORETESTS_INTERMEDIATES)/javalib.jar,com,\
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700185 $(TARGET_ARCH),libcore/expectations)
Ying Wang6238cd92013-07-10 16:58:52 -0700186
Kenny Root69c00c92013-09-05 15:10:44 -0700187$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.conscrypt.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.conscrypt,\
190 cts/tests/core/libcore/conscrypt/AndroidManifest.xml,\
191 $(CONSCRYPTTESTS_INTERMEDIATES)/javalib.jar,,\
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700192 $(TARGET_ARCH),libcore/expectations)
Kenny Root69c00c92013-09-05 15:10:44 -0700193
Ying Wang6238cd92013-07-10 16:58:52 -0700194$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.sun.xml: $(CTS_CORE_XMLS_DEPS)
195 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
Brian Muramatsuc0a69242012-01-05 18:24:43 -0800196 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.sun,\
Brian Carlstromaf850002011-05-27 00:04:57 -0700197 cts/tests/core/libcore/sun/AndroidManifest.xml,\
198 $(CORETESTS_INTERMEDIATES)/javalib.jar,sun,\
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700199 $(TARGET_ARCH),libcore/expectations)
Ying Wang6238cd92013-07-10 16:58:52 -0700200
201$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.tests.xml: $(CTS_CORE_XMLS_DEPS)
202 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
Brian Muramatsuc0a69242012-01-05 18:24:43 -0800203 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.tests,\
Brian Carlstromaf850002011-05-27 00:04:57 -0700204 cts/tests/core/libcore/tests/AndroidManifest.xml,\
205 $(CORETESTS_INTERMEDIATES)/javalib.jar,tests,\
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700206 $(TARGET_ARCH),libcore/expectations)
Ying Wang6238cd92013-07-10 16:58:52 -0700207
208$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.org.xml: $(CTS_CORE_XMLS_DEPS)
209 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
Brian Muramatsuc0a69242012-01-05 18:24:43 -0800210 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.org,\
Brian Carlstromaf850002011-05-27 00:04:57 -0700211 cts/tests/core/libcore/org/AndroidManifest.xml,\
212 $(CORETESTS_INTERMEDIATES)/javalib.jar,org,\
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700213 $(TARGET_ARCH),libcore/expectations)
Ying Wang6238cd92013-07-10 16:58:52 -0700214
215$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.libcore.xml: $(CTS_CORE_XMLS_DEPS)
216 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
Brian Muramatsuc0a69242012-01-05 18:24:43 -0800217 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.libcore,\
Brian Carlstromaf850002011-05-27 00:04:57 -0700218 cts/tests/core/libcore/libcore/AndroidManifest.xml,\
219 $(CORETESTS_INTERMEDIATES)/javalib.jar,libcore,\
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700220 $(TARGET_ARCH),libcore/expectations)
The Android Open Source Project6a5f7f02009-03-05 14:34:30 -0800221
Tsu Chiang Chuangd1f75012013-08-21 11:46:03 -0700222$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.jsr166.xml: $(CTS_CORE_XMLS_DEPS)
223 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
224 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.jsr166,\
225 cts/tests/core/libcore/jsr166/AndroidManifest.xml,\
226 $(JSR166TESTS_INTERMEDIATES)/javalib.jar,jsr166,\
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700227 $(TARGET_ARCH),libcore/expectations)
Tsu Chiang Chuangd1f75012013-08-21 11:46:03 -0700228
Tsu Chiang Chuang6b874c92012-10-24 16:47:49 -0700229$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_annotation.xml: $(CTS_CORE_XMLS_DEPS)
230 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
231 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_annotation,\
232 cts/tests/core/libcore/harmony_annotation/AndroidManifest.xml,\
Narayan Kamath13a3fe82013-12-31 15:15:41 +0000233 $(CORETESTS_INTERMEDIATES)/javalib.jar,org.apache.harmony.annotation.tests,\
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700234 $(TARGET_ARCH),libcore/expectations)
Tsu Chiang Chuang6b874c92012-10-24 16:47:49 -0700235
Narayan Kamath13a3fe82013-12-31 15:15:41 +0000236$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_io.xml: $(CTS_CORE_XMLS_DEPS)
Tsu Chiang Chuang6b874c92012-10-24 16:47:49 -0700237 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
Narayan Kamath13a3fe82013-12-31 15:15:41 +0000238 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_io,\
239 cts/tests/core/libcore/harmony_java_io/AndroidManifest.xml,\
240 $(CORETESTS_INTERMEDIATES)/javalib.jar,org.apache.harmony.tests.java.io,\
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700241 $(TARGET_ARCH),libcore/expectations)
Narayan Kamath13a3fe82013-12-31 15:15:41 +0000242
243$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_lang.xml: $(CTS_CORE_XMLS_DEPS)
244 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
245 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_lang,\
246 cts/tests/core/libcore/harmony_java_lang/AndroidManifest.xml,\
247 $(CORETESTS_INTERMEDIATES)/javalib.jar,org.apache.harmony.tests.java.lang,\
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700248 $(TARGET_ARCH),libcore/expectations)
Narayan Kamath13a3fe82013-12-31 15:15:41 +0000249
250$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_math.xml: $(CTS_CORE_XMLS_DEPS)
251 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
252 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_math,\
253 cts/tests/core/libcore/harmony_java_math/AndroidManifest.xml,\
254 $(CORETESTS_INTERMEDIATES)/javalib.jar,org.apache.harmony.tests.java.math,\
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700255 $(TARGET_ARCH),libcore/expectations)
Narayan Kamath13a3fe82013-12-31 15:15:41 +0000256
257$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_net.xml: $(CTS_CORE_XMLS_DEPS)
258 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
259 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_net,\
260 cts/tests/core/libcore/harmony_java_net/AndroidManifest.xml,\
261 $(CORETESTS_INTERMEDIATES)/javalib.jar,org.apache.harmony.tests.java.net,\
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700262 $(TARGET_ARCH),libcore/expectations)
Narayan Kamath13a3fe82013-12-31 15:15:41 +0000263
264$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_nio.xml: $(CTS_CORE_XMLS_DEPS)
265 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
266 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_nio,\
267 cts/tests/core/libcore/harmony_java_nio/AndroidManifest.xml,\
268 $(CORETESTS_INTERMEDIATES)/javalib.jar,org.apache.harmony.tests.java.nio,\
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700269 $(TARGET_ARCH),libcore/expectations)
Narayan Kamath13a3fe82013-12-31 15:15:41 +0000270
271$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_text.xml: $(CTS_CORE_XMLS_DEPS)
272 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
273 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_text,\
274 cts/tests/core/libcore/harmony_java_text/AndroidManifest.xml,\
275 $(CORETESTS_INTERMEDIATES)/javalib.jar,org.apache.harmony.tests.java.text,\
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700276 $(TARGET_ARCH),libcore/expectations)
Narayan Kamath13a3fe82013-12-31 15:15:41 +0000277
278$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_util.xml: $(CTS_CORE_XMLS_DEPS)
279 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
280 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_java_util,\
281 cts/tests/core/libcore/harmony_java_util/AndroidManifest.xml,\
282 $(CORETESTS_INTERMEDIATES)/javalib.jar,org.apache.harmony.tests.java.util,\
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700283 $(TARGET_ARCH),libcore/expectations)
Narayan Kamath13a3fe82013-12-31 15:15:41 +0000284
285$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_javax_security.xml: $(CTS_CORE_XMLS_DEPS)
286 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
287 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_javax_security,\
288 cts/tests/core/libcore/harmony_javax_security/AndroidManifest.xml,\
289 $(CORETESTS_INTERMEDIATES)/javalib.jar,org.apache.harmony.tests.javax.security,\
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700290 $(TARGET_ARCH),libcore/expectations)
Tsu Chiang Chuang6b874c92012-10-24 16:47:49 -0700291
292$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_beans.xml: $(CTS_CORE_XMLS_DEPS)
293 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
294 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_beans,\
295 cts/tests/core/libcore/harmony_beans/AndroidManifest.xml,\
Neil Fuller4fdf6742014-05-29 13:18:35 +0100296 $(APACHEHARMONYTESTS_INTERMEDIATES)/javalib.jar,com.android.org.apache.harmony.beans,\
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700297 $(TARGET_ARCH),libcore/expectations external/apache-harmony/Android.mk)
Tsu Chiang Chuang6b874c92012-10-24 16:47:49 -0700298
299$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_logging.xml: $(CTS_CORE_XMLS_DEPS)
300 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
301 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_logging,\
302 cts/tests/core/libcore/harmony_logging/AndroidManifest.xml,\
Neil Fuller4fdf6742014-05-29 13:18:35 +0100303 $(APACHEHARMONYTESTS_INTERMEDIATES)/javalib.jar,com.android.org.apache.harmony.logging,\
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700304 $(TARGET_ARCH),libcore/expectations external/apache-harmony/Android.mk)
Tsu Chiang Chuang6b874c92012-10-24 16:47:49 -0700305
Tsu Chiang Chuang6b874c92012-10-24 16:47:49 -0700306$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_prefs.xml: $(CTS_CORE_XMLS_DEPS)
307 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
308 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_prefs,\
309 cts/tests/core/libcore/harmony_prefs/AndroidManifest.xml,\
Neil Fuller4fdf6742014-05-29 13:18:35 +0100310 $(APACHEHARMONYTESTS_INTERMEDIATES)/javalib.jar,com.android.org.apache.harmony.prefs,\
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700311 $(TARGET_ARCH),libcore/expectations external/apache-harmony/Android.mk)
Tsu Chiang Chuang6b874c92012-10-24 16:47:49 -0700312
Tsu Chiang Chuang6b874c92012-10-24 16:47:49 -0700313$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_sql.xml: $(CTS_CORE_XMLS_DEPS)
314 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
315 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.harmony_sql,\
316 cts/tests/core/libcore/harmony_sql/AndroidManifest.xml,\
Neil Fuller4fdf6742014-05-29 13:18:35 +0100317 $(APACHEHARMONYTESTS_INTERMEDIATES)/javalib.jar,com.android.org.apache.harmony.sql,\
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700318 $(TARGET_ARCH),libcore/expectations external/apache-harmony/Android.mk)
Tsu Chiang Chuang6b874c92012-10-24 16:47:49 -0700319
Neil Fuller4fdf6742014-05-29 13:18:35 +0100320$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.okhttp.xml: $(CTS_CORE_XMLS_DEPS)
321 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
322 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.okhttp,\
323 cts/tests/core/libcore/okhttp/AndroidManifest.xml,\
324 $(OKHTTPTESTS_INTERMEDIATES)/javalib.jar,,\
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700325 $(TARGET_ARCH),libcore/expectations)
Neil Fuller4fdf6742014-05-29 13:18:35 +0100326
Neil Fuller56128c52015-03-13 14:22:11 +0000327$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.tzdata.xml: $(CTS_CORE_XMLS_DEPS)
328 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
329 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.tests.libcore.package.tzdata,\
330 cts/tests/core/libcore/tzdata/AndroidManifest.xml,\
331 $(TZDATAUPDATETESTS_INTERMEDIATES)/javalib.jar,,\
332 $(TARGET_ARCH),libcore/expectations)
333
Tsu Chiang Chuang9d047ac2011-04-27 17:01:32 -0700334# ----- Generate the test descriptions for the vm-tests-tf -----
335#
Brian Muramatsuc0a69242012-01-05 18:24:43 -0800336CORE_VM_TEST_TF_DESC := $(CTS_TESTCASES_OUT)/android.core.vm-tests-tf.xml
Tsu Chiang Chuang9d047ac2011-04-27 17:01:32 -0700337
Tsu Chiang Chuang9d047ac2011-04-27 17:01:32 -0700338# core tests only needed to get hold of junit-framework-classes
Neil Fullerc61caf12014-06-19 11:21:08 +0100339CORE_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,core-libart,,COMMON)
Tsu Chiang Chuang9d047ac2011-04-27 17:01:32 -0700340JUNIT_INTERMEDIATES :=$(call intermediates-dir-for,JAVA_LIBRARIES,core-junit,,COMMON)
341
Brett Chabotcf1d2b12014-09-25 12:38:36 -0700342GEN_CLASSPATH := $(CORE_INTERMEDIATES)/classes.jar:$(JUNIT_INTERMEDIATES)/classes.jar:$(VMTESTSTF_JAR):$(TF_JAR)
Tsu Chiang Chuang9d047ac2011-04-27 17:01:32 -0700343
344$(CORE_VM_TEST_TF_DESC): PRIVATE_CLASSPATH:=$(GEN_CLASSPATH)
345# Please see big comment above on why this line depends on javalib.jar instead of classes.jar
Brett Chabotcf1d2b12014-09-25 12:38:36 -0700346$(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)
Brian Muramatsuc0a69242012-01-05 18:24:43 -0800347 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
348 $(call generate-core-test-description,$(CTS_TESTCASES_OUT)/android.core.vm-tests-tf,\
Tsu Chiang Chuang9d047ac2011-04-27 17:01:32 -0700349 cts/tests/vm-tests-tf/AndroidManifest.xml,\
Brian Muramatsuc0a69242012-01-05 18:24:43 -0800350 $(VMTESTSTF_JAR),"",\
Stuart Scottf06c6ef2014-10-08 19:01:37 -0700351 $(TARGET_ARCH),\
Tsu Chiang Chuang9d047ac2011-04-27 17:01:32 -0700352 libcore/expectations,\
353 cts/tools/vm-tests-tf/Android.mk)
Brian Muramatsu237fa072011-12-12 23:54:49 -0800354
The Android Open Source Project88b60792009-03-03 19:28:42 -0800355# Generate the default test plan for User.
Phil Dubach5e3ab042009-08-14 13:48:34 -0700356# Usage: buildCts.py <testRoot> <ctsOutputDir> <tempDir> <androidRootDir> <docletPath>
Brian Muramatsu237fa072011-12-12 23:54:49 -0800357
Brian Muramatsuc0a69242012-01-05 18:24:43 -0800358$(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) | $(ACP)
359 $(hide) $(ACP) -fp $(CTS_CORE_XMLS) $(CTS_TEST_XMLS) $(CORE_VM_TEST_TF_DESC) $(PRIVATE_DIR)/repository/testcases
Phil Dubach5e3ab042009-08-14 13:48:34 -0700360 $(hide) $(cts_tools_src_dir)/utils/buildCts.py cts/tests/tests/ $(PRIVATE_DIR) $(TMP_DIR) \
361 $(TOP) $(HOST_OUT_JAVA_LIBRARIES)/descGen.jar
Ying Wang51a1ae12013-07-10 11:33:27 -0700362 $(hide) mkdir -p $(dir $@) && touch $@
The Android Open Source Project88b60792009-03-03 19:28:42 -0800363
364# Package CTS and clean up.
365#
366# TODO:
367# Pack cts.bat into the same zip file as well. See http://buganizer/issue?id=1656821 for more details
368INTERNAL_CTS_TARGET := $(cts_dir)/$(cts_name).zip
369$(INTERNAL_CTS_TARGET): PRIVATE_NAME := $(cts_name)
370$(INTERNAL_CTS_TARGET): PRIVATE_CTS_DIR := $(cts_dir)
371$(INTERNAL_CTS_TARGET): PRIVATE_DIR := $(cts_dir)/$(cts_name)
372$(INTERNAL_CTS_TARGET): TMP_DIR := $(cts_dir)/temp
Brian Muramatsu5fc00572011-12-16 13:07:15 -0800373$(INTERNAL_CTS_TARGET): $(cts_dir)/all_cts_files_stamp $(DEFAULT_TEST_PLAN)
Brian Muramatsu1cf9e0e2010-12-06 12:49:13 -0800374 $(hide) echo "Package CTS: $@"
The Android Open Source Project88b60792009-03-03 19:28:42 -0800375 $(hide) cd $(dir $@) && zip -rq $(notdir $@) $(PRIVATE_NAME)
376
377.PHONY: cts
378cts: $(INTERNAL_CTS_TARGET) adb
379$(call dist-for-goals,cts,$(INTERNAL_CTS_TARGET))
380
Brian Muramatsu237fa072011-12-12 23:54:49 -0800381
382define copy-testcase
383
384$(hide) $(ACP) -fp $(1) $(PRIVATE_DIR)/repository/testcases/$(notdir $1)
385
386endef
Tsu Chiang Chuangbcf11b02014-06-18 09:59:49 -0700387
388define copy-testcase-jar
389
390$(hide) $(ACP) -fp $(call intermediates-dir-for,JAVA_LIBRARIES,$(1))/javalib.jar \
391 $(PRIVATE_DIR)/repository/testcases/$(1).jar
392
393endef