Julien Desprez | 100f641 | 2024-05-20 11:12:30 -0700 | [diff] [blame] | 1 | # 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 Desprez | fdb6073 | 2024-05-23 11:55:47 -0700 | [diff] [blame] | 18 | performance_tests_zip := $(PRODUCT_OUT)/performance-tests.zip |
Julien Desprez | 100f641 | 2024-05-20 11:12:30 -0700 | [diff] [blame] | 19 | # Create an artifact to include a list of test config files in performance-tests. |
Julien Desprez | fdb6073 | 2024-05-23 11:55:47 -0700 | [diff] [blame] | 20 | performance_tests_list_zip := $(PRODUCT_OUT)/performance-tests_list.zip |
Julien Desprez | 100f641 | 2024-05-20 11:12:30 -0700 | [diff] [blame] | 21 | # Create an artifact to include all test config files in performance-tests. |
Julien Desprez | fdb6073 | 2024-05-23 11:55:47 -0700 | [diff] [blame] | 22 | performance_tests_configs_zip := $(PRODUCT_OUT)/performance-tests_configs.zip |
Julien Desprez | 100f641 | 2024-05-20 11:12:30 -0700 | [diff] [blame] | 23 | |
Julien Desprez | fdb6073 | 2024-05-23 11:55:47 -0700 | [diff] [blame] | 24 | $(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 Desprez | 100f641 | 2024-05-20 11:12:30 -0700 | [diff] [blame] | 29 | 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 Desprez | fdb6073 | 2024-05-23 11:55:47 -0700 | [diff] [blame] | 35 | $(hide) $(SOONG_ZIP) -d -o $(PRIVATE_performance_tests_configs_zip) \ |
Julien Desprez | 100f641 | 2024-05-20 11:12:30 -0700 | [diff] [blame] | 36 | -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 Desprez | fdb6073 | 2024-05-23 11:55:47 -0700 | [diff] [blame] | 41 | $(hide) $(SOONG_ZIP) -d -o $(PRIVATE_performance_tests_list_zip) -C $(dir $@) -f $(PRIVATE_performance_tests_list) |
Julien Desprez | 100f641 | 2024-05-20 11:12:30 -0700 | [diff] [blame] | 42 | rm -f $@.list $@-host.list $@-target.list $@-host-test-configs.list $@-target-test-configs.list \ |
| 43 | $(PRIVATE_performance_tests_list) |
| 44 | |
Julien Desprez | fdb6073 | 2024-05-23 11:55:47 -0700 | [diff] [blame] | 45 | performance-tests: $(performance_tests_zip) |
| 46 | $(call dist-for-goals, performance-tests, $(performance_tests_zip) $(performance_tests_list_zip) $(performance_tests_configs_zip)) |
Julien Desprez | 100f641 | 2024-05-20 11:12:30 -0700 | [diff] [blame] | 47 | |
Julien Desprez | fdb6073 | 2024-05-23 11:55:47 -0700 | [diff] [blame] | 48 | $(call declare-1p-container,$(performance_tests_zip),) |
| 49 | $(call declare-container-license-deps,$(performance_tests_zip),$(COMPATIBILITY.performance-tests.FILES),$(PRODUCT_OUT)/:/) |
Julien Desprez | 100f641 | 2024-05-20 11:12:30 -0700 | [diff] [blame] | 50 | |
| 51 | tests: performance-tests |
| 52 | |
| 53 | # Reset temp vars |
Julien Desprez | fdb6073 | 2024-05-23 11:55:47 -0700 | [diff] [blame] | 54 | performance_tests_zip := |
| 55 | performance_tests_list_zip := |
| 56 | performance_tests_configs_zip := |