blob: 966ceb7ba43b52993ad15e3cbda81165b082b215 [file] [log] [blame]
Stuart Scott794308f2016-02-19 11:15:15 -08001# Copyright (C) 2015 The Android Open Source Project
The Android Open Source Project88b60792009-03-03 19:28:42 -08002#
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 Scott794308f2016-02-19 11:15:15 -080015test_suite_name := cts
16test_suite_tradefed := cts-tradefed
Julien Desprez79af9882020-10-15 14:09:39 -070017test_suite_dynamic_config := cts/tools/cts-tradefed/DynamicConfig.xml
18test_suite_readme := cts/tools/cts-tradefed/README
The Android Open Source Project88b60792009-03-03 19:28:42 -080019
Stuart Scott794308f2016-02-19 11:15:15 -080020include $(BUILD_SYSTEM)/tasks/tools/compatibility.mk
The Android Open Source Project88b60792009-03-03 19:28:42 -080021
22.PHONY: cts
Stuart Scott794308f2016-02-19 11:15:15 -080023cts: $(compatibility_zip)
24$(call dist-for-goals, cts, $(compatibility_zip))
Stuart Scottcc52da82016-03-02 08:42:41 -080025
26.PHONY: cts_v2
27cts_v2: cts
Yuntao Xu89c09d92021-08-26 13:39:49 -070028
29# platform version check (b/32056228)
30# ============================================================
31ifneq (,$(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
59endif
Yuntao Xu26b9e3b2021-09-07 16:46:37 -070060
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##
69cts-dir := $(HOST_OUT)/cts-verifier
70verifier-dir-name := android-cts-verifier
71verifier-dir := $(cts-dir)/$(verifier-dir-name)
72verifier-zip-name := $(verifier-dir-name).zip
73verifier-zip := $(cts-dir)/$(verifier-zip-name)
74
75cts : $(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)