From e1a52604d35166adfd2dde8789bd32d7a53c0e41 Mon Sep 17 00:00:00 2001 From: Tongbo Liu Date: Thu, 22 Feb 2024 17:38:13 +0800 Subject: [PATCH] [DO NOT MERGE] Build MCTS on mainline branches Ignore-AOSP-First: test for mainline internal branch Bug: 323532076 Test: m mcts Change-Id: Id43fad9082af479d5238ee8e143549637a070e4b --- core/tasks/mcts.mk | 32 +++++++++++++++++++++++++++++++ core/tasks/tools/compatibility.mk | 13 ++++++++++--- 2 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 core/tasks/mcts.mk diff --git a/core/tasks/mcts.mk b/core/tasks/mcts.mk new file mode 100644 index 0000000000..0ab74c6e40 --- /dev/null +++ b/core/tasks/mcts.mk @@ -0,0 +1,32 @@ +# Copyright (C) 2024 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +ifneq ($(wildcard test/mts/README.md),) + +mcts_test_suites := +mcts_test_suites += mcts + +$(foreach module, $(mts_modules), $(eval mcts_test_suites += mcts-$(module))) + +$(foreach suite, $(mcts_test_suites), \ + $(eval test_suite_name := $(suite)) \ + $(eval test_suite_tradefed := mts-tradefed) \ + $(eval test_suite_readme := test/mts/README.md) \ + $(eval include $(BUILD_SYSTEM)/tasks/tools/compatibility.mk) \ + $(eval .PHONY: $(suite)) \ + $(eval $(suite): $(compatibility_zip)) \ + $(eval $(call dist-for-goals, $(suite), $(compatibility_zip))) \ +) + +endif diff --git a/core/tasks/tools/compatibility.mk b/core/tasks/tools/compatibility.mk index b42476dc6b..cb6c0cbfa1 100644 --- a/core/tasks/tools/compatibility.mk +++ b/core/tasks/tools/compatibility.mk @@ -26,7 +26,14 @@ # Output variables: # compatibility_zip: the path to the output zip file. -test_suite_subdir := android-$(test_suite_name) +special_mts_test_suites := +special_mts_test_suites += mcts +ifneq ($(filter $(special_mts_test_suites),$(subst -, ,$(test_suite_name))),) + test_suite_subdir := android-mts +else + test_suite_subdir := android-$(test_suite_name) +endif + out_dir := $(HOST_OUT)/$(test_suite_name)/$(test_suite_subdir) test_artifacts := $(COMPATIBILITY.$(test_suite_name).FILES) test_tools := $(HOST_OUT_JAVA_LIBRARIES)/tradefed.jar \ @@ -101,9 +108,9 @@ test_suite_notice_html := $(out_dir)/NOTICE.html compatibility_zip_deps += $(test_suite_notice_txt) compatibility_zip_resources += $(test_suite_notice_txt) -compatibility_tests_list_zip := $(out_dir)-tests_list.zip +compatibility_tests_list_zip := $(HOST_OUT)/$(test_suite_name)/android-$(test_suite_name)-tests_list.zip -compatibility_zip := $(out_dir).zip +compatibility_zip := $(HOST_OUT)/$(test_suite_name)/android-$(test_suite_name).zip $(compatibility_zip) : .KATI_IMPLICIT_OUTPUTS := $(compatibility_tests_list_zip) $(compatibility_zip): PRIVATE_OUT_DIR := $(out_dir) $(compatibility_zip): PRIVATE_TOOLS := $(test_tools) $(test_suite_prebuilt_tools)