Brian Muramatsu | 5df641c | 2011-12-28 15:46:57 -0800 | [diff] [blame] | 1 | # 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 Carlstrom | cb71127 | 2012-06-16 23:32:47 -0700 | [diff] [blame] | 22 | # Disable by default so "m cts" will work in emulator builds |
| 23 | LOCAL_DEX_PREOPT := false |
Ying Wang | 815d87d | 2013-08-23 13:54:26 -0700 | [diff] [blame] | 24 | LOCAL_PROGUARD_ENABLED := disabled |
Brian Carlstrom | cb71127 | 2012-06-16 23:32:47 -0700 | [diff] [blame] | 25 | |
Stuart Scott | 0337dbf | 2015-02-04 10:37:07 -0800 | [diff] [blame] | 26 | include $(BUILD_CTS_SUPPORT_PACKAGE) |
Guang Zhu | 7afa91e | 2015-02-06 00:44:34 -0800 | [diff] [blame] | 27 | include $(BUILD_CTS_MODULE_TEST_CONFIG) |
Brian Muramatsu | 5df641c | 2011-12-28 15:46:57 -0800 | [diff] [blame] | 28 | |
dcashman | 8e1f6e4 | 2014-10-24 16:16:30 -0700 | [diff] [blame] | 29 | cts_src_dirs := $(LOCAL_PATH) |
| 30 | cts_src_dirs += $(sort $(dir $(LOCAL_GENERATED_SOURCES))) |
| 31 | cts_src_dirs := $(addprefix -s , $(cts_src_dirs)) |
| 32 | |
Stuart Scott | 0337dbf | 2015-02-04 10:37:07 -0800 | [diff] [blame] | 33 | cts_package_xml := $(CTS_TESTCASES_OUT)/$(LOCAL_PACKAGE_NAME).xml |
Nicholas Sauer | a1715ac | 2014-12-02 17:43:53 -0800 | [diff] [blame] | 34 | $(cts_package_xml): PRIVATE_SRC_DIRS := $(cts_src_dirs) |
Brian Muramatsu | 5df641c | 2011-12-28 15:46:57 -0800 | [diff] [blame] | 35 | $(cts_package_xml): PRIVATE_INSTRUMENTATION := $(LOCAL_INSTRUMENTATION_FOR) |
| 36 | $(cts_package_xml): PRIVATE_PACKAGE := $(LOCAL_PACKAGE_NAME) |
Stuart Scott | d35f8eb | 2014-01-13 17:41:01 -0800 | [diff] [blame] | 37 | ifneq ($(filter cts/suite/cts/%, $(LOCAL_PATH)),) |
| 38 | PRIVATE_CTS_TEST_PACKAGE_NAME_ := com.android.cts.$(notdir $(LOCAL_PATH)) |
| 39 | else |
| 40 | PRIVATE_CTS_TEST_PACKAGE_NAME_ := android.$(notdir $(LOCAL_PATH)) |
| 41 | endif |
Jed Estep | 6aab9db | 2015-10-20 10:19:39 -0700 | [diff] [blame] | 42 | ifeq ($(cts_runtime_hint),) |
| 43 | $(cts_package_xml): PRIVATE_CTS_RUNTIME_HINT := "0" |
| 44 | else |
| 45 | $(cts_package_xml): PRIVATE_CTS_RUNTIME_HINT := $(cts_runtime_hint) |
| 46 | endif |
Stuart Scott | d35f8eb | 2014-01-13 17:41:01 -0800 | [diff] [blame] | 47 | $(cts_package_xml): PRIVATE_TEST_PACKAGE := $(PRIVATE_CTS_TEST_PACKAGE_NAME_) |
Brian Muramatsu | 5df641c | 2011-12-28 15:46:57 -0800 | [diff] [blame] | 48 | $(cts_package_xml): PRIVATE_MANIFEST := $(LOCAL_PATH)/AndroidManifest.xml |
Svetoslav Ganov | b803f80 | 2012-03-07 19:13:05 -0800 | [diff] [blame] | 49 | $(cts_package_xml): PRIVATE_TEST_TYPE := $(if $(LOCAL_CTS_TEST_RUNNER),$(LOCAL_CTS_TEST_RUNNER),'') |
Stuart Scott | 544aec0 | 2015-03-11 16:41:43 -0700 | [diff] [blame] | 50 | $(cts_package_xml): $(cts_support_apks) |
Guang Zhu | 7afa91e | 2015-02-06 00:44:34 -0800 | [diff] [blame] | 51 | $(cts_package_xml): $(cts_module_test_config) |
Stuart Scott | 0337dbf | 2015-02-04 10:37:07 -0800 | [diff] [blame] | 52 | $(cts_package_xml): $(CTS_EXPECTATIONS) $(CTS_UNSUPPORTED_ABIS) $(CTS_JAVA_TEST_SCANNER_DOCLET) $(CTS_JAVA_TEST_SCANNER) $(CTS_XML_GENERATOR) |
Brian Muramatsu | 5df641c | 2011-12-28 15:46:57 -0800 | [diff] [blame] | 53 | $(hide) echo Generating test description for java package $(PRIVATE_PACKAGE) |
| 54 | $(hide) mkdir -p $(CTS_TESTCASES_OUT) |
Svetoslav Ganov | b803f80 | 2012-03-07 19:13:05 -0800 | [diff] [blame] | 55 | $(hide) $(CTS_JAVA_TEST_SCANNER) \ |
dcashman | 8e1f6e4 | 2014-10-24 16:16:30 -0700 | [diff] [blame] | 56 | $(PRIVATE_SRC_DIRS) \ |
Brian Muramatsu | 5df641c | 2011-12-28 15:46:57 -0800 | [diff] [blame] | 57 | -d $(CTS_JAVA_TEST_SCANNER_DOCLET) | \ |
Svetoslav Ganov | b803f80 | 2012-03-07 19:13:05 -0800 | [diff] [blame] | 58 | $(CTS_XML_GENERATOR) \ |
| 59 | -t $(PRIVATE_TEST_TYPE) \ |
| 60 | -m $(PRIVATE_MANIFEST) \ |
Brian Muramatsu | 5df641c | 2011-12-28 15:46:57 -0800 | [diff] [blame] | 61 | -i "$(PRIVATE_INSTRUMENTATION)" \ |
| 62 | -n $(PRIVATE_PACKAGE) \ |
| 63 | -p $(PRIVATE_TEST_PACKAGE) \ |
Jed Estep | 6aab9db | 2015-10-20 10:19:39 -0700 | [diff] [blame] | 64 | -x "runtimeHint->$(PRIVATE_CTS_RUNTIME_HINT)" \ |
Brian Muramatsu | 5df641c | 2011-12-28 15:46:57 -0800 | [diff] [blame] | 65 | -e $(CTS_EXPECTATIONS) \ |
Stuart Scott | 34c8fc8 | 2014-09-08 13:25:16 -0700 | [diff] [blame] | 66 | -b $(CTS_UNSUPPORTED_ABIS) \ |
Stuart Scott | ccdc00b | 2014-09-29 20:42:08 +0000 | [diff] [blame] | 67 | -a $(CTS_TARGET_ARCH) \ |
Brian Muramatsu | 5df641c | 2011-12-28 15:46:57 -0800 | [diff] [blame] | 68 | -o $@ |
Ying Wang | 1aed9cd | 2015-01-28 16:59:57 -0800 | [diff] [blame] | 69 | # Have the module name depend on the cts files; so the cts files get generated when you run mm/mmm/mma/mmma. |
Guang Zhu | 7afa91e | 2015-02-06 00:44:34 -0800 | [diff] [blame] | 70 | $(my_register_name) : $(cts_package_xml) $(cts_module_test_config) |
Jed Estep | 6aab9db | 2015-10-20 10:19:39 -0700 | [diff] [blame] | 71 | |
| 72 | # Make sure we clear cts_runtime_hint, so other parents will use the default if they do not set cts_runtime_hint. |
| 73 | cts_runtime_hint := |