Dan Shi | f740f61 | 2020-09-24 15:23:08 -0700 | [diff] [blame] | 1 | # Copyright (C) 2020 The Android Open Source Project |
| 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 | |
| 15 | .PHONY: art-host-tests |
| 16 | |
| 17 | intermediates_dir := $(call intermediates-dir-for,PACKAGING,art-host-tests) |
| 18 | art_host_tests_zip := $(PRODUCT_OUT)/art-host-tests.zip |
Dan Shi | cb8655c | 2020-10-21 14:16:25 -0700 | [diff] [blame] | 19 | # Get the hostside libraries to be packaged in the test zip. Unlike |
| 20 | # device-tests.mk or general-tests.mk, the files are not copied to the |
| 21 | # testcases directory. |
| 22 | my_host_shared_lib_for_art_host_tests := $(foreach f,$(COMPATIBILITY.art-host-tests.HOST_SHARED_LIBRARY.FILES),$(strip \ |
| 23 | $(eval _cmf_tuple := $(subst :, ,$(f))) \ |
| 24 | $(eval _cmf_src := $(word 1,$(_cmf_tuple))) \ |
| 25 | $(_cmf_src))) |
| 26 | |
Dan Shi | 7c2982a | 2023-03-08 23:53:34 +0000 | [diff] [blame] | 27 | # Create an artifact to include a list of test config files in art-host-tests. |
| 28 | art_host_tests_list_zip := $(PRODUCT_OUT)/art-host-tests_list.zip |
| 29 | # Create an artifact to include all test config files in art-host-tests. |
| 30 | art_host_tests_configs_zip := $(PRODUCT_OUT)/art-host-tests_configs.zip |
| 31 | # Create an artifact to include all shared library files in art-host-tests. |
| 32 | art_host_tests_host_shared_libs_zip := $(PRODUCT_OUT)/art-host-tests_host-shared-libs.zip |
Dan Shi | cb8655c | 2020-10-21 14:16:25 -0700 | [diff] [blame] | 33 | |
Dan Shi | 7c2982a | 2023-03-08 23:53:34 +0000 | [diff] [blame] | 34 | $(art_host_tests_zip) : PRIVATE_HOST_SHARED_LIBS := $(my_host_shared_lib_for_art_host_tests) |
| 35 | $(art_host_tests_zip) : PRIVATE_art_host_tests_list_zip := $(art_host_tests_list_zip) |
| 36 | $(art_host_tests_zip) : PRIVATE_art_host_tests_configs_zip := $(art_host_tests_configs_zip) |
| 37 | $(art_host_tests_zip) : PRIVATE_art_host_tests_host_shared_libs_zip := $(art_host_tests_host_shared_libs_zip) |
| 38 | $(art_host_tests_zip) : .KATI_IMPLICIT_OUTPUTS := $(art_host_tests_list_zip) $(art_host_tests_configs_zip) $(art_host_tests_host_shared_libs_zip) |
| 39 | $(art_host_tests_zip) : PRIVATE_INTERMEDIATES_DIR := $(intermediates_dir) |
Dan Shi | cb8655c | 2020-10-21 14:16:25 -0700 | [diff] [blame] | 40 | $(art_host_tests_zip) : $(COMPATIBILITY.art-host-tests.FILES) $(my_host_shared_lib_for_art_host_tests) $(SOONG_ZIP) |
Dan Shi | 7c2982a | 2023-03-08 23:53:34 +0000 | [diff] [blame] | 41 | rm -rf $(PRIVATE_INTERMEDIATES_DIR) |
| 42 | rm -f $@ $(PRIVATE_art_host_tests_list_zip) |
| 43 | mkdir -p $(PRIVATE_INTERMEDIATES_DIR) |
| 44 | echo $(sort $(COMPATIBILITY.art-host-tests.FILES)) | tr " " "\n" > $(PRIVATE_INTERMEDIATES_DIR)/list |
| 45 | grep $(HOST_OUT_TESTCASES) $(PRIVATE_INTERMEDIATES_DIR)/list > $(PRIVATE_INTERMEDIATES_DIR)/host.list || true |
| 46 | $(hide) touch $(PRIVATE_INTERMEDIATES_DIR)/shared-libs.list |
Dan Shi | cb8655c | 2020-10-21 14:16:25 -0700 | [diff] [blame] | 47 | $(hide) for shared_lib in $(PRIVATE_HOST_SHARED_LIBS); do \ |
Dan Shi | 7c2982a | 2023-03-08 23:53:34 +0000 | [diff] [blame] | 48 | echo $$shared_lib >> $(PRIVATE_INTERMEDIATES_DIR)/shared-libs.list; \ |
Dan Shi | cb8655c | 2020-10-21 14:16:25 -0700 | [diff] [blame] | 49 | done |
Dan Shi | 7c2982a | 2023-03-08 23:53:34 +0000 | [diff] [blame] | 50 | grep $(TARGET_OUT_TESTCASES) $(PRIVATE_INTERMEDIATES_DIR)/list > $(PRIVATE_INTERMEDIATES_DIR)/target.list || true |
| 51 | $(hide) $(SOONG_ZIP) -d -o $@ -P host -C $(HOST_OUT) -l $(PRIVATE_INTERMEDIATES_DIR)/host.list \ |
| 52 | -P target -C $(PRODUCT_OUT) -l $(PRIVATE_INTERMEDIATES_DIR)/target.list \ |
Julien Desprez | 7b94cc7 | 2023-06-27 19:12:18 +0000 | [diff] [blame] | 53 | -P host/testcases -C $(HOST_OUT) -l $(PRIVATE_INTERMEDIATES_DIR)/shared-libs.list \ |
| 54 | -sha256 |
Dan Shi | 7c2982a | 2023-03-08 23:53:34 +0000 | [diff] [blame] | 55 | grep -e .*\\.config$$ $(PRIVATE_INTERMEDIATES_DIR)/host.list > $(PRIVATE_INTERMEDIATES_DIR)/host-test-configs.list || true |
| 56 | grep -e .*\\.config$$ $(PRIVATE_INTERMEDIATES_DIR)/target.list > $(PRIVATE_INTERMEDIATES_DIR)/target-test-configs.list || true |
| 57 | $(hide) $(SOONG_ZIP) -d -o $(PRIVATE_art_host_tests_configs_zip) \ |
| 58 | -P host -C $(HOST_OUT) -l $(PRIVATE_INTERMEDIATES_DIR)/host-test-configs.list \ |
| 59 | -P target -C $(PRODUCT_OUT) -l $(PRIVATE_INTERMEDIATES_DIR)/target-test-configs.list |
| 60 | grep $(HOST_OUT) $(PRIVATE_INTERMEDIATES_DIR)/shared-libs.list > $(PRIVATE_INTERMEDIATES_DIR)/host-shared-libs.list || true |
| 61 | $(hide) $(SOONG_ZIP) -d -o $(PRIVATE_art_host_tests_host_shared_libs_zip) \ |
| 62 | -P host -C $(HOST_OUT) -l $(PRIVATE_INTERMEDIATES_DIR)/host-shared-libs.list |
| 63 | grep -e .*\\.config$$ $(PRIVATE_INTERMEDIATES_DIR)/host.list | sed s%$(HOST_OUT)%host%g > $(PRIVATE_INTERMEDIATES_DIR)/art-host-tests_list |
| 64 | grep -e .*\\.config$$ $(PRIVATE_INTERMEDIATES_DIR)/target.list | sed s%$(PRODUCT_OUT)%target%g >> $(PRIVATE_INTERMEDIATES_DIR)/art-host-tests_list |
| 65 | $(hide) $(SOONG_ZIP) -d -o $(PRIVATE_art_host_tests_list_zip) -C $(PRIVATE_INTERMEDIATES_DIR) -f $(PRIVATE_INTERMEDIATES_DIR)/art-host-tests_list |
Dan Shi | f740f61 | 2020-09-24 15:23:08 -0700 | [diff] [blame] | 66 | |
| 67 | art-host-tests: $(art_host_tests_zip) |
Dan Shi | 7c2982a | 2023-03-08 23:53:34 +0000 | [diff] [blame] | 68 | $(call dist-for-goals, art-host-tests, $(art_host_tests_zip) $(art_host_tests_list_zip) $(art_host_tests_configs_zip) $(art_host_tests_host_shared_libs_zip)) |
Dan Shi | f740f61 | 2020-09-24 15:23:08 -0700 | [diff] [blame] | 69 | |
Bob Badour | 3a0f0c1 | 2022-04-05 10:43:45 -0700 | [diff] [blame] | 70 | $(call declare-1p-container,$(art_host_tests_zip),) |
| 71 | $(call declare-container-license-deps,$(art_host_tests_zip),$(COMPATIBILITY.art-host-tests.FILES) $(my_host_shared_lib_for_art_host_tests),$(PRODUCT_OUT)/:/) |
| 72 | |
Dan Shi | f740f61 | 2020-09-24 15:23:08 -0700 | [diff] [blame] | 73 | tests: art-host-tests |
Dan Shi | 7c2982a | 2023-03-08 23:53:34 +0000 | [diff] [blame] | 74 | |
| 75 | intermediates_dir := |
| 76 | art_host_tests_zip := |
| 77 | art_host_tests_list_zip := |
| 78 | art_host_tests_configs_zip := |
| 79 | art_host_tests_host_shared_libs_zip := |