Brian Muramatsu | 88d32a8 | 2011-12-02 10:55:12 -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 an executable and defines a rule to generate the associated test |
| 17 | # package XML needed by CTS. |
| 18 | # |
| 19 | # 1. Replace "include $(BUILD_EXECUTABLE)" |
| 20 | # with "include $(BUILD_CTS_EXECUTABLE)" |
| 21 | # |
| 22 | # 2. Define LOCAL_CTS_TEST_PACKAGE to group the tests under a package |
| 23 | # as needed by CTS. |
| 24 | # |
| 25 | |
Dan Albert | 703a5f1 | 2014-09-26 16:49:16 -0700 | [diff] [blame] | 26 | LOCAL_CXX_STL := libc++ |
Brian Muramatsu | 88d32a8 | 2011-12-02 10:55:12 -0800 | [diff] [blame] | 27 | include $(BUILD_EXECUTABLE) |
| 28 | |
Stuart Scott | 0337dbf | 2015-02-04 10:37:07 -0800 | [diff] [blame^] | 29 | cts_executable_bin := |
| 30 | $(foreach fp, $(ALL_MODULES.$(LOCAL_MODULE).BUILT) $(ALL_MODULES.$(LOCAL_MODULE)$(TARGET_2ND_ARCH_MODULE_SUFFIX).BUILT),\ |
| 31 | $(eval installed := $(CTS_TESTCASES_OUT)/$(notdir $(fp)))\ |
| 32 | $(eval $(call copy-one-file, $(fp), $(installed)))\ |
| 33 | $(eval cts_executable_bin += $(installed))) |
Brian Muramatsu | 88d32a8 | 2011-12-02 10:55:12 -0800 | [diff] [blame] | 34 | |
Stuart Scott | 0337dbf | 2015-02-04 10:37:07 -0800 | [diff] [blame^] | 35 | cts_executable_xml := $(CTS_TESTCASES_OUT)/$(LOCAL_MODULE).xml |
Brian Muramatsu | 88d32a8 | 2011-12-02 10:55:12 -0800 | [diff] [blame] | 36 | $(cts_executable_xml): PRIVATE_TEST_PACKAGE := $(LOCAL_CTS_TEST_PACKAGE) |
| 37 | $(cts_executable_xml): PRIVATE_EXECUTABLE := $(LOCAL_MODULE) |
Christopher Ferris | 2830d72 | 2014-02-05 13:09:00 -0800 | [diff] [blame] | 38 | $(cts_executable_xml): PRIVATE_LIST_EXECUTABLE := $(HOST_OUT_EXECUTABLES)/$(LOCAL_MODULE)_list |
| 39 | $(cts_executable_xml): $(HOST_OUT_EXECUTABLES)/$(LOCAL_MODULE)_list |
Stuart Scott | 34c8fc8 | 2014-09-08 13:25:16 -0700 | [diff] [blame] | 40 | $(cts_executable_xml): $(addprefix $(LOCAL_PATH)/,$(LOCAL_SRC_FILES)) $(CTS_EXPECTATIONS) $(CTS_UNSUPPORTED_ABIS) $(CTS_NATIVE_TEST_SCANNER) $(CTS_XML_GENERATOR) $(cts_list_executable) |
Brian Muramatsu | 88d32a8 | 2011-12-02 10:55:12 -0800 | [diff] [blame] | 41 | $(hide) echo Generating test description for native package $(PRIVATE_TEST_PACKAGE) |
Brian Muramatsu | 5df641c | 2011-12-28 15:46:57 -0800 | [diff] [blame] | 42 | $(hide) mkdir -p $(CTS_TESTCASES_OUT) |
Christopher Ferris | 2830d72 | 2014-02-05 13:09:00 -0800 | [diff] [blame] | 43 | $(hide) $(PRIVATE_LIST_EXECUTABLE) --gtest_list_tests | \ |
| 44 | $(CTS_NATIVE_TEST_SCANNER) -t $(PRIVATE_TEST_PACKAGE) | \ |
Brian Muramatsu | 5df641c | 2011-12-28 15:46:57 -0800 | [diff] [blame] | 45 | $(CTS_XML_GENERATOR) -t native \ |
| 46 | -n $(PRIVATE_EXECUTABLE) \ |
Brian Muramatsu | ad20737 | 2011-12-16 18:41:45 -0800 | [diff] [blame] | 47 | -p $(PRIVATE_TEST_PACKAGE) \ |
| 48 | -e $(CTS_EXPECTATIONS) \ |
Stuart Scott | 34c8fc8 | 2014-09-08 13:25:16 -0700 | [diff] [blame] | 49 | -b $(CTS_UNSUPPORTED_ABIS) \ |
Stuart Scott | ccdc00b | 2014-09-29 20:42:08 +0000 | [diff] [blame] | 50 | -a $(CTS_TARGET_ARCH) \ |
Brian Muramatsu | ad20737 | 2011-12-16 18:41:45 -0800 | [diff] [blame] | 51 | -o $@ |
Ying Wang | 1aed9cd | 2015-01-28 16:59:57 -0800 | [diff] [blame] | 52 | |
| 53 | # Have the module name depend on the cts files; so the cts files get generated when you run mm/mmm/mma/mmma. |
Stuart Scott | 0337dbf | 2015-02-04 10:37:07 -0800 | [diff] [blame^] | 54 | $(my_register_name) : $(cts_executable_bin) $(cts_executable_xml) |