blob: 2af1deda7c729b744ffef1d6c2508dfc9887ebe4 [file] [log] [blame]
Dan Shif740f612020-09-24 15:23:08 -07001# 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
17intermediates_dir := $(call intermediates-dir-for,PACKAGING,art-host-tests)
18art_host_tests_zip := $(PRODUCT_OUT)/art-host-tests.zip
Dan Shicb8655c2020-10-21 14:16:25 -070019# 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.
22my_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 Shif740f612020-09-24 15:23:08 -070030 echo $(sort $(COMPATIBILITY.art-host-tests.FILES)) | tr " " "\n" > $@.list
31 grep $(HOST_OUT_TESTCASES) $@.list > $@-host.list || true
Roland Levillain4d9d0aa2021-07-27 15:00:48 +010032 $(hide) touch $@-host-libs.list
Dan Shicb8655c2020-10-21 14:16:25 -070033 $(hide) for shared_lib in $(PRIVATE_HOST_SHARED_LIBS); do \
34 echo $$shared_lib >> $@-host-libs.list; \
35 done
Dan Shif740f612020-09-24 15:23:08 -070036 grep $(TARGET_OUT_TESTCASES) $@.list > $@-target.list || true
Dan Shicb8655c2020-10-21 14:16:25 -070037 $(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 Shif740f612020-09-24 15:23:08 -070041
42art-host-tests: $(art_host_tests_zip)
43$(call dist-for-goals, art-host-tests, $(art_host_tests_zip))
44
Bob Badour3a0f0c12022-04-05 10:43:45 -070045$(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 Shif740f612020-09-24 15:23:08 -070048tests: art-host-tests