blob: fe1000a9d79212423aca63e74359e223529abc4f [file] [log] [blame]
Tsu Chiang Chuang06f4c562014-06-18 09:57:57 -07001# Copyright (C) 2014 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 host library and defines a rule to generate the associated test
17# package XML needed by CTS.
18#
19# Disable by default so "m cts" will work in emulator builds
20LOCAL_DEX_PREOPT := false
21include $(BUILD_JAVA_LIBRARY)
Guang Zhu17db1092015-05-05 13:41:40 -070022include $(BUILD_CTS_MODULE_TEST_CONFIG)
Stuart Scott0337dbf2015-02-04 10:37:07 -080023
Tsu Chiang Chuang06f4c562014-06-18 09:57:57 -070024cts_library_jar := $(CTS_TESTCASES_OUT)/$(LOCAL_MODULE).jar
Stuart Scott0337dbf2015-02-04 10:37:07 -080025$(cts_library_jar): $(LOCAL_BUILT_MODULE)
Tsu Chiang Chuang06f4c562014-06-18 09:57:57 -070026 $(copy-file-to-target)
27
28cts_library_xml := $(CTS_TESTCASES_OUT)/$(LOCAL_MODULE).xml
29$(cts_library_xml): $(cts_library_jar)
30$(cts_library_xml): PRIVATE_PATH := $(LOCAL_PATH)/src
31$(cts_library_xml): PRIVATE_TEST_PACKAGE := $(LOCAL_CTS_TEST_PACKAGE)
32$(cts_library_xml): PRIVATE_LIBRARY := $(LOCAL_MODULE)
33$(cts_library_xml): PRIVATE_JAR_PATH := $(LOCAL_MODULE).jar
34$(cts_library_xml): PRIVATE_RUNTIME_ARGS := $(LOCAL_CTS_TARGET_RUNTIME_ARGS)
Stuart Scott544aec02015-03-11 16:41:43 -070035$(cts_library_xml): $(cts_library_jar)
Guang Zhu17db1092015-05-05 13:41:40 -070036$(cts_library_xml): $(cts_module_test_config)
Stuart Scott544aec02015-03-11 16:41:43 -070037$(cts_library_xml): $(CTS_EXPECTATIONS) $(CTS_UNSUPPORTED_ABIS) $(CTS_JAVA_TEST_SCANNER_DOCLET) $(CTS_JAVA_TEST_SCANNER) $(CTS_XML_GENERATOR)
Tsu Chiang Chuang06f4c562014-06-18 09:57:57 -070038 $(hide) echo Generating test description for target library $(PRIVATE_LIBRARY)
39 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
40 $(hide) $(CTS_JAVA_TEST_SCANNER) -s $(PRIVATE_PATH) \
41 -d $(CTS_JAVA_TEST_SCANNER_DOCLET) | \
42 $(CTS_XML_GENERATOR) -t jUnitDeviceTest \
43 -j $(PRIVATE_JAR_PATH) \
44 -n $(PRIVATE_LIBRARY) \
45 -p $(PRIVATE_TEST_PACKAGE) \
46 -e $(CTS_EXPECTATIONS) \
Stuart Scott34c8fc82014-09-08 13:25:16 -070047 -b $(CTS_UNSUPPORTED_ABIS) \
Stuart Scottccdc00b2014-09-29 20:42:08 +000048 -a $(CTS_TARGET_ARCH) \
Tsu Chiang Chuangd688d4b2014-06-26 11:12:37 -070049 -x "runtimeArgs->$(PRIVATE_RUNTIME_ARGS)" \
Tsu Chiang Chuang06f4c562014-06-18 09:57:57 -070050 -o $@
Ying Wang1aed9cd2015-01-28 16:59:57 -080051
52# Have the module name depend on the cts files; so the cts files get generated when you run mm/mmm/mma/mmma.
Guang Zhu17db1092015-05-05 13:41:40 -070053$(my_register_name) : $(cts_library_jar) $(cts_library_xml $(cts_module_test_config))