Brian Muramatsu | 2f8eead | 2010-09-24 14:56:43 -0700 | [diff] [blame] | 1 | # |
| 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 | |
Brian Muramatsu | 61bd88c | 2011-04-11 13:48:08 -0700 | [diff] [blame] | 20 | cts_api_coverage_exe := $(HOST_OUT_EXECUTABLES)/cts-api-coverage |
| 21 | dexdeps_exe := $(HOST_OUT_EXECUTABLES)/dexdeps |
Brian Muramatsu | 2f8eead | 2010-09-24 14:56:43 -0700 | [diff] [blame] | 22 | |
Brian Muramatsu | 61bd88c | 2011-04-11 13:48:08 -0700 | [diff] [blame] | 23 | coverage_out := $(HOST_OUT)/cts-api-coverage |
Ying Wang | 50889ab | 2010-12-01 16:29:54 -0800 | [diff] [blame] | 24 | |
Jared Lim | 8093954 | 2019-03-26 17:26:53 -0700 | [diff] [blame] | 25 | api_xml_description := $(TARGET_OUT_COMMON_INTERMEDIATES)/api.xml |
Ying Wang | 50889ab | 2010-12-01 16:29:54 -0800 | [diff] [blame] | 26 | |
Sam Lin | 921218b | 2017-09-26 14:21:33 -0700 | [diff] [blame] | 27 | napi_text_description := cts/tools/cts-api-coverage/etc/ndk-api.xml |
| 28 | napi_xml_description := $(coverage_out)/ndk-api.xml |
| 29 | $(napi_xml_description) : $(napi_text_description) $(ACP) |
| 30 | $(hide) echo "Preparing NDK API XML: $@" |
| 31 | $(hide) mkdir -p $(dir $@) |
| 32 | $(hide) $(ACP) $< $@ |
| 33 | |
Ruslan Tkhakokhov | d88a5d8 | 2019-06-25 22:58:18 +0100 | [diff] [blame] | 34 | system_api_xml_description := $(TARGET_OUT_COMMON_INTERMEDIATES)/system-api.xml |
| 35 | |
Brian Muramatsu | 61bd88c | 2011-04-11 13:48:08 -0700 | [diff] [blame] | 36 | cts-test-coverage-report := $(coverage_out)/test-coverage.html |
Ruslan Tkhakokhov | d88a5d8 | 2019-06-25 22:58:18 +0100 | [diff] [blame] | 37 | cts-system-api-coverage-report := $(coverage_out)/system-api-coverage.html |
| 38 | cts-system-api-xml-coverage-report := $(coverage_out)/system-api-coverage.xml |
Brian Muramatsu | 61bd88c | 2011-04-11 13:48:08 -0700 | [diff] [blame] | 39 | cts-verifier-coverage-report := $(coverage_out)/verifier-coverage.html |
Keun young Park | 506ca41 | 2012-08-28 10:52:31 -0700 | [diff] [blame] | 40 | cts-combined-coverage-report := $(coverage_out)/combined-coverage.html |
Nicholas Sauer | 0130e90 | 2015-12-23 20:37:15 -0800 | [diff] [blame] | 41 | cts-combined-xml-coverage-report := $(coverage_out)/combined-coverage.xml |
Brian Muramatsu | 61bd88c | 2011-04-11 13:48:08 -0700 | [diff] [blame] | 42 | |
Sam Lin | 921218b | 2017-09-26 14:21:33 -0700 | [diff] [blame] | 43 | cts_api_coverage_dependencies := $(cts_api_coverage_exe) $(dexdeps_exe) $(api_xml_description) $(napi_xml_description) |
Ruslan Tkhakokhov | d88a5d8 | 2019-06-25 22:58:18 +0100 | [diff] [blame] | 44 | cts_system_api_coverage_dependencies := $(cts_api_coverage_exe) $(dexdeps_exe) $(system_api_xml_description) |
Brian Muramatsu | 61bd88c | 2011-04-11 13:48:08 -0700 | [diff] [blame] | 45 | |
Nicholas Sauer | 3a2cc27 | 2016-08-12 07:56:00 -0700 | [diff] [blame] | 46 | android_cts_zip := $(HOST_OUT)/cts/android-cts.zip |
Nicholas Sauer | 12b986f | 2016-01-06 10:54:44 -0800 | [diff] [blame] | 47 | cts_verifier_apk := $(call intermediates-dir-for,APPS,CtsVerifier)/package.apk |
| 48 | |
Nicholas Sauer | 3a2cc27 | 2016-08-12 07:56:00 -0700 | [diff] [blame] | 49 | $(cts-test-coverage-report): PRIVATE_TEST_CASES := $(COMPATIBILITY_TESTCASES_OUT_cts) |
Ying Wang | 697ebf0 | 2013-08-01 11:09:25 -0700 | [diff] [blame] | 50 | $(cts-test-coverage-report): PRIVATE_CTS_API_COVERAGE_EXE := $(cts_api_coverage_exe) |
| 51 | $(cts-test-coverage-report): PRIVATE_DEXDEPS_EXE := $(dexdeps_exe) |
| 52 | $(cts-test-coverage-report): PRIVATE_API_XML_DESC := $(api_xml_description) |
Sam Lin | 921218b | 2017-09-26 14:21:33 -0700 | [diff] [blame] | 53 | $(cts-test-coverage-report): PRIVATE_NAPI_XML_DESC := $(napi_xml_description) |
Nicholas Sauer | 12b986f | 2016-01-06 10:54:44 -0800 | [diff] [blame] | 54 | $(cts-test-coverage-report) : $(android_cts_zip) $(cts_api_coverage_dependencies) | $(ACP) |
Sam Lin | 921218b | 2017-09-26 14:21:33 -0700 | [diff] [blame] | 55 | $(call generate-coverage-report-cts,"CTS Tests API-NDK Coverage Report",\ |
Nicholas Sauer | 12b986f | 2016-01-06 10:54:44 -0800 | [diff] [blame] | 56 | $(PRIVATE_TEST_CASES),html) |
Brian Muramatsu | 4b32d08 | 2010-12-02 13:08:44 -0800 | [diff] [blame] | 57 | |
Ruslan Tkhakokhov | d88a5d8 | 2019-06-25 22:58:18 +0100 | [diff] [blame] | 58 | $(cts-system-api-coverage-report): PRIVATE_TEST_CASES := $(COMPATIBILITY_TESTCASES_OUT_cts) |
| 59 | $(cts-system-api-coverage-report): PRIVATE_CTS_API_COVERAGE_EXE := $(cts_api_coverage_exe) |
| 60 | $(cts-system-api-coverage-report): PRIVATE_DEXDEPS_EXE := $(dexdeps_exe) |
| 61 | $(cts-system-api-coverage-report): PRIVATE_API_XML_DESC := $(system_api_xml_description) |
| 62 | $(cts-system-api-coverage-report): PRIVATE_NAPI_XML_DESC := "" |
| 63 | $(cts-system-api-coverage-report) : $(android_cts_zip) $(cts_system_api_coverage_dependencies) | $(ACP) |
| 64 | $(call generate-coverage-report-cts,"CTS System API Coverage Report",\ |
| 65 | $(PRIVATE_TEST_CASES),html) |
| 66 | |
| 67 | $(cts-system-api-xml-coverage-report): PRIVATE_TEST_CASES := $(COMPATIBILITY_TESTCASES_OUT_cts) |
| 68 | $(cts-system-api-xml-coverage-report): PRIVATE_CTS_API_COVERAGE_EXE := $(cts_api_coverage_exe) |
| 69 | $(cts-system-api-xml-coverage-report): PRIVATE_DEXDEPS_EXE := $(dexdeps_exe) |
| 70 | $(cts-system-api-xml-coverage-report): PRIVATE_API_XML_DESC := $(system_api_xml_description) |
| 71 | $(cts-system-api-xml-coverage-report): PRIVATE_NAPI_XML_DESC := "" |
| 72 | $(cts-system-api-xml-coverage-report) : $(android_cts_zip) $(cts_system_api_coverage_dependencies) | $(ACP) |
| 73 | $(call generate-coverage-report-cts,"CTS System API Coverage Report - XML",\ |
| 74 | $(PRIVATE_TEST_CASES),xml) |
| 75 | |
Nicholas Sauer | 12b986f | 2016-01-06 10:54:44 -0800 | [diff] [blame] | 76 | $(cts-verifier-coverage-report): PRIVATE_TEST_CASES := $(cts_verifier_apk) |
Ying Wang | 697ebf0 | 2013-08-01 11:09:25 -0700 | [diff] [blame] | 77 | $(cts-verifier-coverage-report): PRIVATE_CTS_API_COVERAGE_EXE := $(cts_api_coverage_exe) |
| 78 | $(cts-verifier-coverage-report): PRIVATE_DEXDEPS_EXE := $(dexdeps_exe) |
| 79 | $(cts-verifier-coverage-report): PRIVATE_API_XML_DESC := $(api_xml_description) |
Sam Lin | 921218b | 2017-09-26 14:21:33 -0700 | [diff] [blame] | 80 | $(cts-verifier-coverage-report): PRIVATE_NAPI_XML_DESC := $(napi_xml_description) |
Nicholas Sauer | 12b986f | 2016-01-06 10:54:44 -0800 | [diff] [blame] | 81 | $(cts-verifier-coverage-report) : $(cts_verifier_apk) $(cts_api_coverage_dependencies) | $(ACP) |
Sam Lin | 921218b | 2017-09-26 14:21:33 -0700 | [diff] [blame] | 82 | $(call generate-coverage-report-cts,"CTS Verifier API Coverage Report",\ |
Nicholas Sauer | 12b986f | 2016-01-06 10:54:44 -0800 | [diff] [blame] | 83 | $(PRIVATE_TEST_CASES),html) |
Brian Muramatsu | 2f8eead | 2010-09-24 14:56:43 -0700 | [diff] [blame] | 84 | |
Nicholas Sauer | 3a2cc27 | 2016-08-12 07:56:00 -0700 | [diff] [blame] | 85 | $(cts-combined-coverage-report): PRIVATE_TEST_CASES := $(foreach c, $(cts_verifier_apk) $(COMPATIBILITY_TESTCASES_OUT_cts), $(c)) |
Ying Wang | 697ebf0 | 2013-08-01 11:09:25 -0700 | [diff] [blame] | 86 | $(cts-combined-coverage-report): PRIVATE_CTS_API_COVERAGE_EXE := $(cts_api_coverage_exe) |
| 87 | $(cts-combined-coverage-report): PRIVATE_DEXDEPS_EXE := $(dexdeps_exe) |
| 88 | $(cts-combined-coverage-report): PRIVATE_API_XML_DESC := $(api_xml_description) |
Sam Lin | 921218b | 2017-09-26 14:21:33 -0700 | [diff] [blame] | 89 | $(cts-combined-coverage-report): PRIVATE_NAPI_XML_DESC := $(napi_xml_description) |
Nicholas Sauer | 12b986f | 2016-01-06 10:54:44 -0800 | [diff] [blame] | 90 | $(cts-combined-coverage-report) : $(android_cts_zip) $(cts_verifier_apk) $(cts_api_coverage_dependencies) | $(ACP) |
Sam Lin | 921218b | 2017-09-26 14:21:33 -0700 | [diff] [blame] | 91 | $(call generate-coverage-report-cts,"CTS Combined API Coverage Report",\ |
Nicholas Sauer | 12b986f | 2016-01-06 10:54:44 -0800 | [diff] [blame] | 92 | $(PRIVATE_TEST_CASES),html) |
Keun young Park | 506ca41 | 2012-08-28 10:52:31 -0700 | [diff] [blame] | 93 | |
Nicholas Sauer | 3a2cc27 | 2016-08-12 07:56:00 -0700 | [diff] [blame] | 94 | $(cts-combined-xml-coverage-report): PRIVATE_TEST_CASES := $(foreach c, $(cts_verifier_apk) $(COMPATIBILITY_TESTCASES_OUT_cts), $(c)) |
Nicholas Sauer | 0130e90 | 2015-12-23 20:37:15 -0800 | [diff] [blame] | 95 | $(cts-combined-xml-coverage-report): PRIVATE_CTS_API_COVERAGE_EXE := $(cts_api_coverage_exe) |
| 96 | $(cts-combined-xml-coverage-report): PRIVATE_DEXDEPS_EXE := $(dexdeps_exe) |
| 97 | $(cts-combined-xml-coverage-report): PRIVATE_API_XML_DESC := $(api_xml_description) |
Sam Lin | 921218b | 2017-09-26 14:21:33 -0700 | [diff] [blame] | 98 | $(cts-combined-xml-coverage-report): PRIVATE_NAPI_XML_DESC := $(napi_xml_description) |
Nicholas Sauer | 12b986f | 2016-01-06 10:54:44 -0800 | [diff] [blame] | 99 | $(cts-combined-xml-coverage-report) : $(android_cts_zip) $(cts_verifier_apk) $(cts_api_coverage_dependencies) | $(ACP) |
Sam Lin | 921218b | 2017-09-26 14:21:33 -0700 | [diff] [blame] | 100 | $(call generate-coverage-report-cts,"CTS Combined API Coverage Report - XML",\ |
Nicholas Sauer | 12b986f | 2016-01-06 10:54:44 -0800 | [diff] [blame] | 101 | $(PRIVATE_TEST_CASES),xml) |
Nicholas Sauer | 0130e90 | 2015-12-23 20:37:15 -0800 | [diff] [blame] | 102 | |
Ying Wang | 50889ab | 2010-12-01 16:29:54 -0800 | [diff] [blame] | 103 | .PHONY: cts-test-coverage |
| 104 | cts-test-coverage : $(cts-test-coverage-report) |
| 105 | |
Ruslan Tkhakokhov | d88a5d8 | 2019-06-25 22:58:18 +0100 | [diff] [blame] | 106 | .PHONY: cts-system-api-coverage |
| 107 | cts-system-api-coverage : $(cts-system-api-coverage-report) |
| 108 | |
| 109 | .PHONY: cts-system-api-xml-coverage |
| 110 | cts-system-api-xml-coverage : $(cts-system-api-xml-coverage-report) |
| 111 | |
Brian Muramatsu | 4b32d08 | 2010-12-02 13:08:44 -0800 | [diff] [blame] | 112 | .PHONY: cts-verifier-coverage |
| 113 | cts-verifier-coverage : $(cts-verifier-coverage-report) |
| 114 | |
Keun young Park | 506ca41 | 2012-08-28 10:52:31 -0700 | [diff] [blame] | 115 | .PHONY: cts-combined-coverage |
| 116 | cts-combined-coverage : $(cts-combined-coverage-report) |
| 117 | |
Nicholas Sauer | 0130e90 | 2015-12-23 20:37:15 -0800 | [diff] [blame] | 118 | .PHONY: cts-combined-xml-coverage |
| 119 | cts-combined-xml-coverage : $(cts-combined-xml-coverage-report) |
| 120 | |
Dan Willemsen | 02b5fb8 | 2018-06-19 16:38:24 -0700 | [diff] [blame] | 121 | .PHONY: cts-coverage-report-all cts-api-coverage |
Guang Zhu | 75f8dfd | 2018-04-13 10:22:42 -0700 | [diff] [blame] | 122 | cts-coverage-report-all: cts-test-coverage cts-verifier-coverage cts-combined-coverage cts-combined-xml-coverage |
| 123 | |
| 124 | # Put the test coverage report in the dist dir if "cts-api-coverage" is among the build goals. |
| 125 | $(call dist-for-goals, cts-api-coverage, $(cts-test-coverage-report):cts-test-coverage-report.html) |
Ruslan Tkhakokhov | d88a5d8 | 2019-06-25 22:58:18 +0100 | [diff] [blame] | 126 | $(call dist-for-goals, cts-api-coverage, $(cts-system-api-coverage-report):cts-system-api-coverage-report.html) |
| 127 | $(call dist-for-goals, cts-api-coverage, $(cts-system-api-xml-coverage-report):cts-system-api-coverage-report.xml) |
Guang Zhu | 75f8dfd | 2018-04-13 10:22:42 -0700 | [diff] [blame] | 128 | $(call dist-for-goals, cts-api-coverage, $(cts-verifier-coverage-report):cts-verifier-coverage-report.html) |
| 129 | $(call dist-for-goals, cts-api-coverage, $(cts-combined-coverage-report):cts-combined-coverage-report.html) |
| 130 | $(call dist-for-goals, cts-api-coverage, $(cts-combined-xml-coverage-report):cts-combined-coverage-report.xml) |
Ying Wang | 50889ab | 2010-12-01 16:29:54 -0800 | [diff] [blame] | 131 | |
Brian Muramatsu | 2f8eead | 2010-09-24 14:56:43 -0700 | [diff] [blame] | 132 | # Arguments; |
| 133 | # 1 - Name of the report printed out on the screen |
Ying Wang | 1a83373 | 2013-07-10 11:29:35 -0700 | [diff] [blame] | 134 | # 2 - List of apk files that will be scanned to generate the report |
| 135 | # 3 - Format of the report |
Sam Lin | 921218b | 2017-09-26 14:21:33 -0700 | [diff] [blame] | 136 | define generate-coverage-report-cts |
Ying Wang | 697ebf0 | 2013-08-01 11:09:25 -0700 | [diff] [blame] | 137 | $(hide) mkdir -p $(dir $@) |
Sam Lin | 921218b | 2017-09-26 14:21:33 -0700 | [diff] [blame] | 138 | $(hide) $(PRIVATE_CTS_API_COVERAGE_EXE) -d $(PRIVATE_DEXDEPS_EXE) -a $(PRIVATE_API_XML_DESC) -n $(PRIVATE_NAPI_XML_DESC) -f $(3) -o $@ $(2) |
Dan Willemsen | 4483b29 | 2017-10-06 11:25:33 -0700 | [diff] [blame] | 139 | @ echo $(1): file://$$(cd $(dir $@); pwd)/$(notdir $@) |
Brian Muramatsu | 2f8eead | 2010-09-24 14:56:43 -0700 | [diff] [blame] | 140 | endef |
Ying Wang | 697ebf0 | 2013-08-01 11:09:25 -0700 | [diff] [blame] | 141 | |
| 142 | # Reset temp vars |
| 143 | cts_api_coverage_dependencies := |
Ruslan Tkhakokhov | d88a5d8 | 2019-06-25 22:58:18 +0100 | [diff] [blame] | 144 | cts_system_api_coverage_dependencies := |
Ying Wang | 697ebf0 | 2013-08-01 11:09:25 -0700 | [diff] [blame] | 145 | cts-combined-coverage-report := |
Nicholas Sauer | 0130e90 | 2015-12-23 20:37:15 -0800 | [diff] [blame] | 146 | cts-combined-xml-coverage-report := |
Ying Wang | 697ebf0 | 2013-08-01 11:09:25 -0700 | [diff] [blame] | 147 | cts-verifier-coverage-report := |
| 148 | cts-test-coverage-report := |
Ruslan Tkhakokhov | d88a5d8 | 2019-06-25 22:58:18 +0100 | [diff] [blame] | 149 | cts-system-api-coverage-report := |
| 150 | cts-system-api-xml-coverage-report := |
Ying Wang | 697ebf0 | 2013-08-01 11:09:25 -0700 | [diff] [blame] | 151 | api_xml_description := |
| 152 | api_text_description := |
Ruslan Tkhakokhov | d88a5d8 | 2019-06-25 22:58:18 +0100 | [diff] [blame] | 153 | system_api_xml_description := |
Sam Lin | 921218b | 2017-09-26 14:21:33 -0700 | [diff] [blame] | 154 | napi_xml_description := |
| 155 | napi_text_description := |
Ying Wang | 697ebf0 | 2013-08-01 11:09:25 -0700 | [diff] [blame] | 156 | coverage_out := |
| 157 | dexdeps_exe := |
| 158 | cts_api_coverage_exe := |
Nicholas Sauer | eeb749c | 2016-01-05 17:42:50 -0800 | [diff] [blame] | 159 | cts_verifier_apk := |
Nicholas Sauer | 12b986f | 2016-01-06 10:54:44 -0800 | [diff] [blame] | 160 | android_cts_zip := |