blob: e0352ba8e04ee14c3539e0f0c1b162842aaec517 [file] [log] [blame]
Brian Muramatsu88d32a82011-12-02 10:55:12 -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 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
26include $(BUILD_EXECUTABLE)
27
Brian Muramatsu5df641c2011-12-28 15:46:57 -080028cts_executable_xml := $(CTS_TESTCASES_OUT)/$(LOCAL_MODULE).xml
Brian Muramatsu88d32a82011-12-02 10:55:12 -080029
Brian Muramatsu88d32a82011-12-02 10:55:12 -080030$(cts_executable_xml): PRIVATE_TEST_PACKAGE := $(LOCAL_CTS_TEST_PACKAGE)
31$(cts_executable_xml): PRIVATE_EXECUTABLE := $(LOCAL_MODULE)
Christopher Ferris2830d722014-02-05 13:09:00 -080032$(cts_executable_xml): PRIVATE_LIST_EXECUTABLE := $(HOST_OUT_EXECUTABLES)/$(LOCAL_MODULE)_list
33$(cts_executable_xml): $(HOST_OUT_EXECUTABLES)/$(LOCAL_MODULE)_list
Stuart Scott34c8fc82014-09-08 13:25:16 -070034$(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 Muramatsu88d32a82011-12-02 10:55:12 -080035 $(hide) echo Generating test description for native package $(PRIVATE_TEST_PACKAGE)
Brian Muramatsu5df641c2011-12-28 15:46:57 -080036 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
Christopher Ferris2830d722014-02-05 13:09:00 -080037 $(hide) $(PRIVATE_LIST_EXECUTABLE) --gtest_list_tests | \
38 $(CTS_NATIVE_TEST_SCANNER) -t $(PRIVATE_TEST_PACKAGE) | \
Brian Muramatsu5df641c2011-12-28 15:46:57 -080039 $(CTS_XML_GENERATOR) -t native \
40 -n $(PRIVATE_EXECUTABLE) \
Brian Muramatsuad207372011-12-16 18:41:45 -080041 -p $(PRIVATE_TEST_PACKAGE) \
42 -e $(CTS_EXPECTATIONS) \
Stuart Scott34c8fc82014-09-08 13:25:16 -070043 -b $(CTS_UNSUPPORTED_ABIS) \
Stuart Scottccdc00b2014-09-29 20:42:08 +000044 -a $(CTS_TARGET_ARCH) \
Brian Muramatsuad207372011-12-16 18:41:45 -080045 -o $@