blob: 690e2e9fd2f639c840473ed22e4ce775acf485c3 [file] [log] [blame]
Brian Muramatsu5df641c2011-12-28 15:46:57 -08001# Copyright (C) 2011 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
15#
16# Builds a package and defines a rule to generate the associated test
17# package XML needed by CTS.
18#
19# Replace "include $(BUILD_PACKAGE)" with "include $(BUILD_CTS_PACKAGE)"
20#
21
Brian Carlstromcb711272012-06-16 23:32:47 -070022# Disable by default so "m cts" will work in emulator builds
23LOCAL_DEX_PREOPT := false
Ying Wang815d87d2013-08-23 13:54:26 -070024LOCAL_PROGUARD_ENABLED := disabled
Guang Zhu25f666d2016-06-02 10:17:48 -040025LOCAL_STATIC_JAVA_LIBRARIES += platform-test-annotations
Brian Carlstromcb711272012-06-16 23:32:47 -070026
Stuart Scott0337dbf2015-02-04 10:37:07 -080027include $(BUILD_CTS_SUPPORT_PACKAGE)
Guang Zhu7afa91e2015-02-06 00:44:34 -080028include $(BUILD_CTS_MODULE_TEST_CONFIG)
Brian Muramatsu5df641c2011-12-28 15:46:57 -080029
dcashman8e1f6e42014-10-24 16:16:30 -070030cts_src_dirs := $(LOCAL_PATH)
31cts_src_dirs += $(sort $(dir $(LOCAL_GENERATED_SOURCES)))
32cts_src_dirs := $(addprefix -s , $(cts_src_dirs))
33
Stuart Scott0337dbf2015-02-04 10:37:07 -080034cts_package_xml := $(CTS_TESTCASES_OUT)/$(LOCAL_PACKAGE_NAME).xml
Nicholas Sauera1715ac2014-12-02 17:43:53 -080035$(cts_package_xml): PRIVATE_SRC_DIRS := $(cts_src_dirs)
Brian Muramatsu5df641c2011-12-28 15:46:57 -080036$(cts_package_xml): PRIVATE_INSTRUMENTATION := $(LOCAL_INSTRUMENTATION_FOR)
37$(cts_package_xml): PRIVATE_PACKAGE := $(LOCAL_PACKAGE_NAME)
Stuart Scottd35f8eb2014-01-13 17:41:01 -080038ifneq ($(filter cts/suite/cts/%, $(LOCAL_PATH)),)
39PRIVATE_CTS_TEST_PACKAGE_NAME_ := com.android.cts.$(notdir $(LOCAL_PATH))
40else
41PRIVATE_CTS_TEST_PACKAGE_NAME_ := android.$(notdir $(LOCAL_PATH))
42endif
43$(cts_package_xml): PRIVATE_TEST_PACKAGE := $(PRIVATE_CTS_TEST_PACKAGE_NAME_)
Brian Muramatsu5df641c2011-12-28 15:46:57 -080044$(cts_package_xml): PRIVATE_MANIFEST := $(LOCAL_PATH)/AndroidManifest.xml
Svetoslav Ganovb803f802012-03-07 19:13:05 -080045$(cts_package_xml): PRIVATE_TEST_TYPE := $(if $(LOCAL_CTS_TEST_RUNNER),$(LOCAL_CTS_TEST_RUNNER),'')
Stuart Scott544aec02015-03-11 16:41:43 -070046$(cts_package_xml): $(cts_support_apks)
Guang Zhu7afa91e2015-02-06 00:44:34 -080047$(cts_package_xml): $(cts_module_test_config)
Stuart Scott0337dbf2015-02-04 10:37:07 -080048$(cts_package_xml): $(CTS_EXPECTATIONS) $(CTS_UNSUPPORTED_ABIS) $(CTS_JAVA_TEST_SCANNER_DOCLET) $(CTS_JAVA_TEST_SCANNER) $(CTS_XML_GENERATOR)
Brian Muramatsu5df641c2011-12-28 15:46:57 -080049 $(hide) echo Generating test description for java package $(PRIVATE_PACKAGE)
50 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
Svetoslav Ganovb803f802012-03-07 19:13:05 -080051 $(hide) $(CTS_JAVA_TEST_SCANNER) \
dcashman8e1f6e42014-10-24 16:16:30 -070052 $(PRIVATE_SRC_DIRS) \
Brian Muramatsu5df641c2011-12-28 15:46:57 -080053 -d $(CTS_JAVA_TEST_SCANNER_DOCLET) | \
Svetoslav Ganovb803f802012-03-07 19:13:05 -080054 $(CTS_XML_GENERATOR) \
55 -t $(PRIVATE_TEST_TYPE) \
56 -m $(PRIVATE_MANIFEST) \
Brian Muramatsu5df641c2011-12-28 15:46:57 -080057 -i "$(PRIVATE_INSTRUMENTATION)" \
58 -n $(PRIVATE_PACKAGE) \
59 -p $(PRIVATE_TEST_PACKAGE) \
60 -e $(CTS_EXPECTATIONS) \
Stuart Scott34c8fc82014-09-08 13:25:16 -070061 -b $(CTS_UNSUPPORTED_ABIS) \
Stuart Scottccdc00b2014-09-29 20:42:08 +000062 -a $(CTS_TARGET_ARCH) \
Brian Muramatsu5df641c2011-12-28 15:46:57 -080063 -o $@
Ying Wang1aed9cd2015-01-28 16:59:57 -080064# Have the module name depend on the cts files; so the cts files get generated when you run mm/mmm/mma/mmma.
Guang Zhu7afa91e2015-02-06 00:44:34 -080065$(my_register_name) : $(cts_package_xml) $(cts_module_test_config)