blob: 1be0734e9c9fd8121c607214488c8a33cf4f1acc [file] [log] [blame]
Thomas Tafertshoferb5385a62012-08-15 15:40:45 -07001# Copyright 2012 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_GTEST_PACKAGE)"
20#
21
22# Disable by default so "m cts" will work in emulator builds
23LOCAL_DEX_PREOPT := false
Ying Wang9c5e00a2013-08-23 18:47:27 -070024LOCAL_PROGUARD_ENABLED := disabled
Thomas Tafertshoferb5385a62012-08-15 15:40:45 -070025
Stuart Scott0337dbf2015-02-04 10:37:07 -080026include $(BUILD_CTS_SUPPORT_PACKAGE)
Thomas Tafertshoferb5385a62012-08-15 15:40:45 -070027
Christopher Ferris25d54d42014-03-03 18:31:00 -080028cts_test_list := $(LOCAL_PATH)/$(LOCAL_MODULE)_list.txt
Thomas Tafertshoferb5385a62012-08-15 15:40:45 -070029
Stuart Scott0337dbf2015-02-04 10:37:07 -080030cts_package_xml := $(CTS_TESTCASES_OUT)/$(LOCAL_PACKAGE_NAME).xml
Thomas Tafertshoferb5385a62012-08-15 15:40:45 -070031$(cts_package_xml): PRIVATE_PATH := $(LOCAL_PATH)
32$(cts_package_xml): PRIVATE_TEST_PACKAGE := android.$(notdir $(LOCAL_PATH))
33$(cts_package_xml): PRIVATE_EXECUTABLE := $(LOCAL_MODULE)
34$(cts_package_xml): PRIVATE_MANIFEST := $(LOCAL_PATH)/AndroidManifest.xml
Christopher Ferris25d54d42014-03-03 18:31:00 -080035$(cts_package_xml): PRIVATE_TEST_LIST := $(cts_test_list)
36$(cts_package_xml): $(addprefix $(LOCAL_PATH)/,$(LOCAL_SRC_FILES)) $(CTS_NATIVE_TEST_SCANNER) $(CTS_XML_GENERATOR) $(cts_test_list)
Thomas Tafertshoferb5385a62012-08-15 15:40:45 -070037 $(hide) echo Generating test description for wrapped native package $(PRIVATE_EXECUTABLE)
38 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
Christopher Ferris25d54d42014-03-03 18:31:00 -080039 $(hide) cat $(PRIVATE_TEST_LIST) | \
40 $(CTS_NATIVE_TEST_SCANNER) -t $(PRIVATE_TEST_PACKAGE) | \
Thomas Tafertshoferb5385a62012-08-15 15:40:45 -070041 $(CTS_XML_GENERATOR) -t wrappednative \
Christopher Ferris25d54d42014-03-03 18:31:00 -080042 -m $(PRIVATE_MANIFEST) \
Thomas Tafertshoferb5385a62012-08-15 15:40:45 -070043 -n $(PRIVATE_EXECUTABLE) \
44 -p $(PRIVATE_TEST_PACKAGE) \
45 -e $(CTS_EXPECTATIONS) \
Stuart Scott34c8fc82014-09-08 13:25:16 -070046 -b $(CTS_UNSUPPORTED_ABIS) \
Stuart Scottccdc00b2014-09-29 20:42:08 +000047 -a $(CTS_TARGET_ARCH) \
Thomas Tafertshoferb5385a62012-08-15 15:40:45 -070048 -o $@
Ying Wang1aed9cd2015-01-28 16:59:57 -080049
50# Have the module name depend on the cts files; so the cts files get generated when you run mm/mmm/mma/mmma.
Stuart Scott0337dbf2015-02-04 10:37:07 -080051$(my_register_name) : $(cts_package_xml)