aboutsummaryrefslogtreecommitdiff
path: root/build/test_host_java_library.mk
blob: 25bd9ba078bf86bc529179cd2cc6dfeebba3fe8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

#
# Builds a host library and defines a rule to generate the associated test
# package XML needed by CTS.
#
# Replace "include $(BUILD_HOST_JAVA_LIBRARY)" with "include $(BUILD_AFW_TEST_HOST_JAVA_LIBRARY)"
#

include $(BUILD_HOST_JAVA_LIBRARY)
include $(BUILD_AFW_TEST_MODULE_TEST_CONFIG)

afw_test_library_jar := $(AFW_TH_TESTCASES_OUT)/$(LOCAL_MODULE).jar
$(afw_test_library_jar): $(LOCAL_BUILT_MODULE)
	$(copy-file-to-target)

afw_test_src_dirs := $(LOCAL_PATH)/src
afw_test_src_dirs += $(sort $(dir $(LOCAL_GENERATED_SOURCES)))
afw_test_src_dirs := $(addprefix -s , $(afw_test_src_dirs))

afw_test_library_xml := $(AFW_TH_TESTCASES_OUT)/$(LOCAL_MODULE).xml
$(afw_test_library_xml): PRIVATE_SRC_DIRS := $(afw_test_src_dirs)
$(afw_test_library_xml): PRIVATE_AFW_TEST_TEST_PACKAGE_NAME_ := com.android.afwtest.$(notdir $(LOCAL_PATH))
$(afw_test_library_xml): PRIVATE_TEST_PACKAGE := $(PRIVATE_AFW_TEST_TEST_PACKAGE_NAME_)
$(afw_test_library_xml): PRIVATE_LIBRARY := $(LOCAL_MODULE)
$(afw_test_library_xml): PRIVATE_JAR_PATH := $(LOCAL_MODULE).jar
$(afw_test_library_xml): $(afw_test_library_jar)
$(afw_test_library_xml): $(afw_test_module_test_config)
$(afw_test_library_xml): $(CTS_EXPECTATIONS) $(CTS_UNSUPPORTED_ABIS) $(CTS_JAVA_TEST_SCANNER_DOCLET) $(CTS_JAVA_TEST_SCANNER) $(CTS_XML_GENERATOR)
	$(hide) echo Generating test description for host library $(PRIVATE_LIBRARY)
	$(hide) mkdir -p $(AFW_TH_TESTCASES_OUT)
	$(hide) $(CTS_JAVA_TEST_SCANNER) $(PRIVATE_SRC_DIRS) \
						-d $(CTS_JAVA_TEST_SCANNER_DOCLET) | \
			$(CTS_XML_GENERATOR) -t hostSideOnly \
						-j $(PRIVATE_JAR_PATH) \
						-n $(PRIVATE_LIBRARY) \
						-p $(PRIVATE_TEST_PACKAGE) \
						-e $(CTS_EXPECTATIONS) \
						-b $(CTS_UNSUPPORTED_ABIS) \
						-a $(CTS_TARGET_ARCH) \
						-o $@

# Have the module name depend on the cts files; so the cts files get generated when you run mm/mmm/mma/mmma.
$(my_register_name) : $(afw_test_library_jar) $(afw_test_library_xml) $(afw_test_module_test_config)