From dadf7ca4752d1f47cafc1133d35653bfdcb3aaf9 Mon Sep 17 00:00:00 2001 From: Dan Shi Date: Tue, 12 Apr 2022 15:47:30 -0700 Subject: [PATCH] Package vts kernel tests in general-tests.zip Bug: 228204473 Test: m dist general-tests Change-Id: Ic6dac4427f1cc2c3bbfdb6905936e2478e5a4350 --- core/tasks/general-tests.mk | 13 +++++++++++++ core/tasks/tools/vts-kernel-tests.mk | 26 ++++++++++++++++++++++++++ core/tasks/vts-core-tests.mk | 20 ++------------------ 3 files changed, 41 insertions(+), 18 deletions(-) create mode 100644 core/tasks/tools/vts-kernel-tests.mk diff --git a/core/tasks/general-tests.mk b/core/tasks/general-tests.mk index 0daf4465aa..525239422b 100644 --- a/core/tasks/general-tests.mk +++ b/core/tasks/general-tests.mk @@ -40,6 +40,18 @@ general_tests_configs_zip := $(PRODUCT_OUT)/general-tests_configs.zip # Create an artifact to include all shared librariy files in general-tests. general_tests_host_shared_libs_zip := $(PRODUCT_OUT)/general-tests_host-shared-libs.zip +# Copy kernel test modules to testcases directories +include $(BUILD_SYSTEM)/tasks/tools/vts-kernel-tests.mk +kernel_test_copy_pairs := \ + $(call target-native-copy-pairs,$(kernel_test_modules),$(kernel_test_host_out)) +copy_kernel_tests := $(call copy-many-files,$(kernel_test_copy_pairs)) + +# PHONY target to be used to build and test `vts_kernel_tests` without building full vts +.PHONY: vts_kernel_tests +vts_kernel_tests: $(copy_kernel_tests) + +$(general_tests_zip) : $(copy_kernel_tests) +$(general_tests_zip) : PRIVATE_KERNEL_TEST_HOST_OUT := $(kernel_test_host_out) $(general_tests_zip) : PRIVATE_general_tests_list_zip := $(general_tests_list_zip) $(general_tests_zip) : .KATI_IMPLICIT_OUTPUTS := $(general_tests_list_zip) $(general_tests_configs_zip) $(general_tests_host_shared_libs_zip) $(general_tests_zip) : PRIVATE_TOOLS := $(general_tests_tools) @@ -52,6 +64,7 @@ $(general_tests_zip) : $(COMPATIBILITY.general-tests.FILES) $(general_tests_tool rm -f $@ $(PRIVATE_general_tests_list_zip) mkdir -p $(PRIVATE_INTERMEDIATES_DIR) $(PRIVATE_INTERMEDIATES_DIR)/tools echo $(sort $(COMPATIBILITY.general-tests.FILES)) | tr " " "\n" > $(PRIVATE_INTERMEDIATES_DIR)/list + find $(PRIVATE_KERNEL_TEST_HOST_OUT) >> $(PRIVATE_INTERMEDIATES_DIR)/list grep $(HOST_OUT_TESTCASES) $(PRIVATE_INTERMEDIATES_DIR)/list > $(PRIVATE_INTERMEDIATES_DIR)/host.list || true grep $(TARGET_OUT_TESTCASES) $(PRIVATE_INTERMEDIATES_DIR)/list > $(PRIVATE_INTERMEDIATES_DIR)/target.list || true grep -e .*\\.config$$ $(PRIVATE_INTERMEDIATES_DIR)/host.list > $(PRIVATE_INTERMEDIATES_DIR)/host-test-configs.list || true diff --git a/core/tasks/tools/vts-kernel-tests.mk b/core/tasks/tools/vts-kernel-tests.mk new file mode 100644 index 0000000000..5fbb589f60 --- /dev/null +++ b/core/tasks/tools/vts-kernel-tests.mk @@ -0,0 +1,26 @@ +# Copyright (C) 2022 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. + +-include external/linux-kselftest/android/kselftest_test_list.mk +-include external/ltp/android/ltp_package_list.mk + +include $(BUILD_SYSTEM)/tasks/tools/vts_package_utils.mk + +# Copy kernel test modules to testcases directories +kernel_test_host_out := $(HOST_OUT_TESTCASES)/vts_kernel_tests +kernel_test_vts_out := $(HOST_OUT)/$(test_suite_name)/android-$(test_suite_name)/testcases/vts_kernel_tests +kernel_test_modules := \ + $(kselftest_modules) \ + ltp \ + $(ltp_packages) \ No newline at end of file diff --git a/core/tasks/vts-core-tests.mk b/core/tasks/vts-core-tests.mk index befde87099..5e1b5d5291 100644 --- a/core/tasks/vts-core-tests.mk +++ b/core/tasks/vts-core-tests.mk @@ -12,35 +12,19 @@ # See the License for the specific language governing permissions and # limitations under the License. --include external/linux-kselftest/android/kselftest_test_list.mk --include external/ltp/android/ltp_package_list.mk - -include $(BUILD_SYSTEM)/tasks/tools/vts_package_utils.mk - test_suite_name := vts test_suite_tradefed := vts-tradefed test_suite_readme := test/vts/tools/vts-core-tradefed/README -# Copy kernel test modules to testcases directories -kernel_test_host_out := $(HOST_OUT_TESTCASES)/vts_kernel_tests -kernel_test_vts_out := $(HOST_OUT)/$(test_suite_name)/android-$(test_suite_name)/testcases/vts_kernel_tests -kernel_test_modules := \ - $(kselftest_modules) \ - ltp \ - $(ltp_packages) +include $(BUILD_SYSTEM)/tasks/tools/vts-kernel-tests.mk kernel_test_copy_pairs := \ - $(call target-native-copy-pairs,$(kernel_test_modules),$(kernel_test_vts_out)) \ - $(call target-native-copy-pairs,$(kernel_test_modules),$(kernel_test_host_out)) + $(call target-native-copy-pairs,$(kernel_test_modules),$(kernel_test_vts_out)) copy_kernel_tests := $(call copy-many-files,$(kernel_test_copy_pairs)) test_suite_extra_deps := $(copy_kernel_tests) -# PHONY target to be used to build and test `vts_kernel_tests` without building full vts -.PHONY: vts_kernel_tests -vts_kernel_tests: $(copy_kernel_tests) - include $(BUILD_SYSTEM)/tasks/tools/compatibility.mk .PHONY: vts