blob: 44a7b1a6d6a0956b19d5d3efdff3ceb2f1ece6df [file] [log] [blame]
Brian Muramatsu2f8eead2010-09-24 14:56:43 -07001#
2# Copyright (C) 2010 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17# Makefile for producing CTS coverage reports.
18# Run "make cts-test-coverage" in the $ANDROID_BUILD_TOP directory.
19
20include cts/CtsTestCaseList.mk
21
22CTS_API_COVERAGE_DEPENDENCIES := cts-api-coverage dexdeps $(ACP)
23
24.PHONY: cts-test-coverage
25cts-test-coverage: $(CTS_COVERAGE_TEST_CASE_LIST) $(CTS_API_COVERAGE_DEPENDENCIES)
26 $(call generate-coverage-report,"CTS Tests API Coverage Report",\
27 $(CTS_COVERAGE_TEST_CASE_LIST),xml,$(HOST_OUT)/cts/test-coverage,api-coverage.xml)
28
29.PHONY: cts-verifier-coverage
30cts-verifier-coverage: CtsVerifier $(CTS_API_COVERAGE_DEPENDENCIES)
31 $(call generate-coverage-report,"CTS Verifier API Coverage Report",\
32 CtsVerifier,xml,$(HOST_OUT)/cts/verifier-coverage,api-coverage.xml)
33
34# Arguments;
35# 1 - Name of the report printed out on the screen
36# 2 - Name of APK packages that will be scanned to generate the report
37# 3 - Format of the report
38# 4 - Output directory to put the report
39# 5 - Output file name of the report
40define generate-coverage-report
41 $(hide) rm -rf $(4)
42 $(hide) mkdir -p $(4)
43 $(hide) $(ACP) cts/tools/cts-api-coverage/res/* $(4)
44
45 $(foreach testcase,$(2),$(eval $(call add-testcase-apk,$(testcase))))
46 $(hide) cts-api-coverage -f $(3) -o $(4)/$(5) $(TEST_APKS)
47
48 @echo $(1): file://$(ANDROID_BUILD_TOP)/$(4)/$(5)
49endef
50
51define add-testcase-apk
52 TEST_APKS += $(call intermediates-dir-for,APPS,$(1))/package.apk
53endef