blob: fb1e1c61ff4a210825a860a84e712beb08a8c7ce [file] [log] [blame]
nelsonli3d51ac072019-07-24 16:25:05 +08001# Copyright (C) 2019 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: vts-core
16
17vts-core-zip := $(PRODUCT_OUT)/vts-core-tests.zip
18# Create an artifact to include a list of test config files in vts-core.
19vts-core-list-zip := $(PRODUCT_OUT)/vts-core_list.zip
20# Create an artifact to include all test config files in vts-core.
21vts-core-configs-zip := $(PRODUCT_OUT)/vts-core_configs.zip
22my_host_shared_lib_for_vts_core := $(call copy-many-files,$(COMPATIBILITY.vts-core.HOST_SHARED_LIBRARY.FILES))
23$(vts-core-zip) : .KATI_IMPLICIT_OUTPUTS := $(vts-core-list-zip) $(vts-core-configs-zip)
24$(vts-core-zip) : PRIVATE_vts_core_list := $(PRODUCT_OUT)/vts-core_list
25$(vts-core-zip) : PRIVATE_HOST_SHARED_LIBS := $(my_host_shared_lib_for_vts_core)
26$(vts-core-zip) : $(COMPATIBILITY.vts-core.FILES) $(my_host_shared_lib_for_vts_core) $(SOONG_ZIP)
27 echo $(sort $(COMPATIBILITY.vts-core.FILES)) | tr " " "\n" > $@.list
28 grep $(HOST_OUT_TESTCASES) $@.list > $@-host.list || true
29 grep -e .*\\.config$$ $@-host.list > $@-host-test-configs.list || true
30 $(hide) for shared_lib in $(PRIVATE_HOST_SHARED_LIBS); do \
31 echo $$shared_lib >> $@-host.list; \
32 done
33 grep $(TARGET_OUT_TESTCASES) $@.list > $@-target.list || true
34 grep -e .*\\.config$$ $@-target.list > $@-target-test-configs.list || true
35 $(hide) $(SOONG_ZIP) -d -o $@ -P host -C $(HOST_OUT) -l $@-host.list -P target -C $(PRODUCT_OUT) -l $@-target.list
36 $(hide) $(SOONG_ZIP) -d -o $(vts-core-configs-zip) \
37 -P host -C $(HOST_OUT) -l $@-host-test-configs.list \
38 -P target -C $(PRODUCT_OUT) -l $@-target-test-configs.list
39 rm -f $(PRIVATE_vts_core_list)
40 $(hide) grep -e .*\\.config$$ $@-host.list | sed s%$(HOST_OUT)%host%g > $(PRIVATE_vts_core_list)
41 $(hide) grep -e .*\\.config$$ $@-target.list | sed s%$(PRODUCT_OUT)%target%g >> $(PRIVATE_vts_core_list)
42 $(hide) $(SOONG_ZIP) -d -o $(vts-core-list-zip) -C $(dir $@) -f $(PRIVATE_vts_core_list)
43 rm -f $@.list $@-host.list $@-target.list $@-host-test-configs.list $@-target-test-configs.list \
44 $(PRIVATE_vts_core_list)
45
46vts-core: $(vts-core-zip)
47$(call dist-for-goals, vts-core, $(vts-core-zip) $(vts-core-list-zip) $(vts-core-configs-zip))
nelsonlie7b71a12019-08-14 09:47:21 +080048
49tests: vts-core