blob: 071acee6c1d8b29e89a638d57e03e2c886bda426 [file] [log] [blame]
Brian Muramatsu5df641c2011-12-28 15:46:57 -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 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_PACKAGE)"
20#
21
Brian Carlstromcb711272012-06-16 23:32:47 -070022# Disable by default so "m cts" will work in emulator builds
23LOCAL_DEX_PREOPT := false
24
Brian Muramatsu5df641c2011-12-28 15:46:57 -080025include $(BUILD_PACKAGE)
26
27cts_package_apk := $(CTS_TESTCASES_OUT)/$(LOCAL_PACKAGE_NAME).apk
28cts_package_xml := $(CTS_TESTCASES_OUT)/$(LOCAL_PACKAGE_NAME).xml
29
30$(cts_package_apk): PRIVATE_PACKAGE := $(LOCAL_PACKAGE_NAME)
31$(cts_package_apk): $(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME))/package.apk | $(ACP)
32 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
33 $(hide) $(ACP) -fp $(call intermediates-dir-for,APPS,$(PRIVATE_PACKAGE))/package.apk $@
34
35$(cts_package_xml): PRIVATE_PATH := $(LOCAL_PATH)
36$(cts_package_xml): PRIVATE_INSTRUMENTATION := $(LOCAL_INSTRUMENTATION_FOR)
37$(cts_package_xml): PRIVATE_PACKAGE := $(LOCAL_PACKAGE_NAME)
38$(cts_package_xml): PRIVATE_TEST_PACKAGE := android.$(notdir $(LOCAL_PATH))
39$(cts_package_xml): PRIVATE_MANIFEST := $(LOCAL_PATH)/AndroidManifest.xml
Svetoslav Ganovb803f802012-03-07 19:13:05 -080040$(cts_package_xml): PRIVATE_TEST_TYPE := $(if $(LOCAL_CTS_TEST_RUNNER),$(LOCAL_CTS_TEST_RUNNER),'')
Brian Muramatsu5df641c2011-12-28 15:46:57 -080041$(cts_package_xml): $(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME))/package.apk $(CTS_EXPECTATIONS) $(CTS_JAVA_TEST_SCANNER_DOCLET) $(CTS_JAVA_TEST_SCANNER) $(CTS_XML_GENERATOR)
42 $(hide) echo Generating test description for java package $(PRIVATE_PACKAGE)
43 $(hide) mkdir -p $(CTS_TESTCASES_OUT)
Svetoslav Ganovb803f802012-03-07 19:13:05 -080044 $(hide) $(CTS_JAVA_TEST_SCANNER) \
45 -s $(PRIVATE_PATH) \
Brian Muramatsu5df641c2011-12-28 15:46:57 -080046 -d $(CTS_JAVA_TEST_SCANNER_DOCLET) | \
Svetoslav Ganovb803f802012-03-07 19:13:05 -080047 $(CTS_XML_GENERATOR) \
48 -t $(PRIVATE_TEST_TYPE) \
49 -m $(PRIVATE_MANIFEST) \
Brian Muramatsu5df641c2011-12-28 15:46:57 -080050 -i "$(PRIVATE_INSTRUMENTATION)" \
51 -n $(PRIVATE_PACKAGE) \
52 -p $(PRIVATE_TEST_PACKAGE) \
53 -e $(CTS_EXPECTATIONS) \
54 -o $@