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 | |
| 27 | $(art_host_tests_zip) : PRIVATE_HOST_SHARED_LIBS := $(my_host_shared_lib_for_art_host_tests) |
| 28 | |
| 29 | $(art_host_tests_zip) : $(COMPATIBILITY.art-host-tests.FILES) $(my_host_shared_lib_for_art_host_tests) $(SOONG_ZIP) |
Dan Shi | f740f61 | 2020-09-24 15:23:08 -0700 | [diff] [blame] | 30 | echo $(sort $(COMPATIBILITY.art-host-tests.FILES)) | tr " " "\n" > $@.list |
| 31 | grep $(HOST_OUT_TESTCASES) $@.list > $@-host.list || true |
Roland Levillain | 4d9d0aa | 2021-07-27 15:00:48 +0100 | [diff] [blame] | 32 | $(hide) touch $@-host-libs.list |
Dan Shi | cb8655c | 2020-10-21 14:16:25 -0700 | [diff] [blame] | 33 | $(hide) for shared_lib in $(PRIVATE_HOST_SHARED_LIBS); do \ |
| 34 | echo $$shared_lib >> $@-host-libs.list; \ |
| 35 | done |
Dan Shi | f740f61 | 2020-09-24 15:23:08 -0700 | [diff] [blame] | 36 | grep $(TARGET_OUT_TESTCASES) $@.list > $@-target.list || true |
Dan Shi | cb8655c | 2020-10-21 14:16:25 -0700 | [diff] [blame] | 37 | $(hide) $(SOONG_ZIP) -d -o $@ -P host -C $(HOST_OUT) -l $@-host.list \ |
| 38 | -P target -C $(PRODUCT_OUT) -l $@-target.list \ |
| 39 | -P host/testcases -C $(HOST_OUT) -l $@-host-libs.list |
| 40 | rm -f $@.list $@-host.list $@-target.list $@-host-libs.list |
Dan Shi | f740f61 | 2020-09-24 15:23:08 -0700 | [diff] [blame] | 41 | |
| 42 | art-host-tests: $(art_host_tests_zip) |
| 43 | $(call dist-for-goals, art-host-tests, $(art_host_tests_zip)) |
| 44 | |
Bob Badour | 3a0f0c1 | 2022-04-05 10:43:45 -0700 | [diff] [blame] | 45 | $(call declare-1p-container,$(art_host_tests_zip),) |
| 46 | $(call declare-container-license-deps,$(art_host_tests_zip),$(COMPATIBILITY.art-host-tests.FILES) $(my_host_shared_lib_for_art_host_tests),$(PRODUCT_OUT)/:/) |
| 47 | |
Dan Shi | f740f61 | 2020-09-24 15:23:08 -0700 | [diff] [blame] | 48 | tests: art-host-tests |