Stuart Scott | 794308f | 2016-02-19 11:15:15 -0800 | [diff] [blame] | 1 | # Copyright (C) 2015 The Android Open Source Project |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 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 | |
Stuart Scott | 794308f | 2016-02-19 11:15:15 -0800 | [diff] [blame] | 15 | test_suite_name := cts |
| 16 | test_suite_tradefed := cts-tradefed |
Julien Desprez | 79af988 | 2020-10-15 14:09:39 -0700 | [diff] [blame] | 17 | test_suite_dynamic_config := cts/tools/cts-tradefed/DynamicConfig.xml |
| 18 | test_suite_readme := cts/tools/cts-tradefed/README |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 19 | |
Stuart Scott | 794308f | 2016-02-19 11:15:15 -0800 | [diff] [blame] | 20 | include $(BUILD_SYSTEM)/tasks/tools/compatibility.mk |
The Android Open Source Project | 88b6079 | 2009-03-03 19:28:42 -0800 | [diff] [blame] | 21 | |
| 22 | .PHONY: cts |
Stuart Scott | 794308f | 2016-02-19 11:15:15 -0800 | [diff] [blame] | 23 | cts: $(compatibility_zip) |
| 24 | $(call dist-for-goals, cts, $(compatibility_zip)) |
Stuart Scott | cc52da8 | 2016-03-02 08:42:41 -0800 | [diff] [blame] | 25 | |
| 26 | .PHONY: cts_v2 |
| 27 | cts_v2: cts |
Yuntao Xu | 89c09d9 | 2021-08-26 13:39:49 -0700 | [diff] [blame] | 28 | |
| 29 | # platform version check (b/32056228) |
| 30 | # ============================================================ |
| 31 | ifneq (,$(wildcard cts/)) |
| 32 | cts_platform_version_path := cts/tests/tests/os/assets/platform_versions.txt |
| 33 | cts_platform_version_string := $(shell cat $(cts_platform_version_path)) |
| 34 | cts_platform_release_path := cts/tests/tests/os/assets/platform_releases.txt |
| 35 | cts_platform_release_string := $(shell cat $(cts_platform_release_path)) |
| 36 | |
| 37 | ifeq (,$(findstring $(PLATFORM_VERSION),$(cts_platform_version_string))) |
| 38 | define error_msg |
| 39 | ============================================================ |
| 40 | Could not find version "$(PLATFORM_VERSION)" in CTS platform version file: |
| 41 | $(cts_platform_version_path) |
| 42 | Most likely PLATFORM_VERSION in build/core/version_defaults.mk |
| 43 | has changed and a new version must be added to this CTS file. |
| 44 | ============================================================ |
| 45 | endef |
| 46 | $(error $(error_msg)) |
| 47 | endif |
| 48 | ifeq (,$(findstring $(PLATFORM_VERSION_LAST_STABLE),$(cts_platform_release_string))) |
| 49 | define error_msg |
| 50 | ============================================================ |
| 51 | Could not find version "$(PLATFORM_VERSION_LAST_STABLE)" in CTS platform release file: |
| 52 | $(cts_platform_release_path) |
| 53 | Most likely PLATFORM_VERSION_LAST_STABLE in build/core/version_defaults.mk |
| 54 | has changed and a new version must be added to this CTS file. |
| 55 | ============================================================ |
| 56 | endef |
| 57 | $(error $(error_msg)) |
| 58 | endif |
| 59 | endif |
Yuntao Xu | 26b9e3b | 2021-09-07 16:46:37 -0700 | [diff] [blame^] | 60 | |
| 61 | # Creates a "cts-verifier" directory that will contain: |
| 62 | # |
| 63 | # 1. Out directory with a "android-cts-verifier" containing the CTS Verifier |
| 64 | # and other binaries it needs. |
| 65 | # |
| 66 | # 2. Zipped version of the android-cts-verifier directory to be included with |
| 67 | # the build distribution. |
| 68 | ## |
| 69 | cts-dir := $(HOST_OUT)/cts-verifier |
| 70 | verifier-dir-name := android-cts-verifier |
| 71 | verifier-dir := $(cts-dir)/$(verifier-dir-name) |
| 72 | verifier-zip-name := $(verifier-dir-name).zip |
| 73 | verifier-zip := $(cts-dir)/$(verifier-zip-name) |
| 74 | |
| 75 | cts : $(verifier-zip) |
| 76 | $(verifier-zip): PRIVATE_DIR := $(cts-dir) |
| 77 | $(verifier-zip): $(SOONG_ANDROID_CTS_VERIFIER_ZIP) |
| 78 | rm -rf $(PRIVATE_DIR) |
| 79 | mkdir -p $(PRIVATE_DIR) |
| 80 | unzip -q -d $(PRIVATE_DIR) $< |
| 81 | $(copy-file-to-target) |