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 17intermediates_dir := $(call intermediates-dir-for,PACKAGING,art-host-tests) 18art_host_tests_zip := $(PRODUCT_OUT)/art-host-tests.zip 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. 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) 30 echo $(sort $(COMPATIBILITY.art-host-tests.FILES)) | tr " " "\n" > $@.list 31 grep $(HOST_OUT_TESTCASES) $@.list > $@-host.list || true 32 $(hide) touch $@-host-libs.list 33 $(hide) for shared_lib in $(PRIVATE_HOST_SHARED_LIBS); do \ 34 echo $$shared_lib >> $@-host-libs.list; \ 35 done 36 grep $(TARGET_OUT_TESTCASES) $@.list > $@-target.list || true 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 41 42art-host-tests: $(art_host_tests_zip) 43$(call dist-for-goals, art-host-tests, $(art_host_tests_zip)) 44 45tests: art-host-tests 46