blob: 8702756f31998ed9c19967992c76ac2ed2d9ad9c [file] [log] [blame]
Julien Desprez100f6412024-05-20 11:12:30 -07001# Copyright (C) 2024 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
16.PHONY: performance-tests
17
Julien Desprezfdb60732024-05-23 11:55:47 -070018performance_tests_zip := $(PRODUCT_OUT)/performance-tests.zip
Julien Desprez100f6412024-05-20 11:12:30 -070019# Create an artifact to include a list of test config files in performance-tests.
Julien Desprezfdb60732024-05-23 11:55:47 -070020performance_tests_list_zip := $(PRODUCT_OUT)/performance-tests_list.zip
Julien Desprez100f6412024-05-20 11:12:30 -070021# Create an artifact to include all test config files in performance-tests.
Julien Desprezfdb60732024-05-23 11:55:47 -070022performance_tests_configs_zip := $(PRODUCT_OUT)/performance-tests_configs.zip
Julien Desprez100f6412024-05-20 11:12:30 -070023
Julien Desprezfdb60732024-05-23 11:55:47 -070024$(performance_tests_zip) : .KATI_IMPLICIT_OUTPUTS := $(performance_tests_list_zip) $(performance_tests_configs_zip)
25$(performance_tests_zip) : PRIVATE_performance_tests_list_zip := $(performance_tests_list_zip)
26$(performance_tests_zip) : PRIVATE_performance_tests_configs_zip := $(performance_tests_configs_zip)
27$(performance_tests_zip) : PRIVATE_performance_tests_list := $(PRODUCT_OUT)/performance-tests_list
28$(performance_tests_zip) : $(COMPATIBILITY.performance-tests.FILES) $(SOONG_ZIP)
Julien Desprez100f6412024-05-20 11:12:30 -070029 echo $(sort $(COMPATIBILITY.performance-tests.FILES)) | tr " " "\n" > $@.list
30 grep $(HOST_OUT_TESTCASES) $@.list > $@-host.list || true
31 grep -e .*\\.config$$ $@-host.list > $@-host-test-configs.list || true
32 grep $(TARGET_OUT_TESTCASES) $@.list > $@-target.list || true
33 grep -e .*\\.config$$ $@-target.list > $@-target-test-configs.list || true
34 $(hide) $(SOONG_ZIP) -d -o $@ -P host -C $(HOST_OUT) -l $@-host.list -P target -C $(PRODUCT_OUT) -l $@-target.list -sha256
Julien Desprezfdb60732024-05-23 11:55:47 -070035 $(hide) $(SOONG_ZIP) -d -o $(PRIVATE_performance_tests_configs_zip) \
Julien Desprez100f6412024-05-20 11:12:30 -070036 -P host -C $(HOST_OUT) -l $@-host-test-configs.list \
37 -P target -C $(PRODUCT_OUT) -l $@-target-test-configs.list
38 rm -f $(PRIVATE_performance_tests_list)
39 $(hide) grep -e .*\\.config$$ $@-host.list | sed s%$(HOST_OUT)%host%g > $(PRIVATE_performance_tests_list)
40 $(hide) grep -e .*\\.config$$ $@-target.list | sed s%$(PRODUCT_OUT)%target%g >> $(PRIVATE_performance_tests_list)
Julien Desprezfdb60732024-05-23 11:55:47 -070041 $(hide) $(SOONG_ZIP) -d -o $(PRIVATE_performance_tests_list_zip) -C $(dir $@) -f $(PRIVATE_performance_tests_list)
Julien Desprez100f6412024-05-20 11:12:30 -070042 rm -f $@.list $@-host.list $@-target.list $@-host-test-configs.list $@-target-test-configs.list \
43 $(PRIVATE_performance_tests_list)
44
Julien Desprezfdb60732024-05-23 11:55:47 -070045performance-tests: $(performance_tests_zip)
46$(call dist-for-goals, performance-tests, $(performance_tests_zip) $(performance_tests_list_zip) $(performance_tests_configs_zip))
Julien Desprez100f6412024-05-20 11:12:30 -070047
Julien Desprezfdb60732024-05-23 11:55:47 -070048$(call declare-1p-container,$(performance_tests_zip),)
49$(call declare-container-license-deps,$(performance_tests_zip),$(COMPATIBILITY.performance-tests.FILES),$(PRODUCT_OUT)/:/)
Julien Desprez100f6412024-05-20 11:12:30 -070050
51tests: performance-tests
52
53# Reset temp vars
Julien Desprezfdb60732024-05-23 11:55:47 -070054performance_tests_zip :=
55performance_tests_list_zip :=
56performance_tests_configs_zip :=