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 | |
| 18 | performance-tests-zip := $(PRODUCT_OUT)/performance-tests.zip |
| 19 | # Create an artifact to include a list of test config files in performance-tests. |
| 20 | performance-tests-list-zip := $(PRODUCT_OUT)/performance-tests_list.zip |
| 21 | # Create an artifact to include all test config files in performance-tests. |
| 22 | performance-tests-configs-zip := $(PRODUCT_OUT)/performance-tests_configs.zip |
| 23 | |
| 24 | $(performance-tests-zip) : .KATI_IMPLICIT_OUTPUTS := $(performance-tests-list-zip) $(performance-tests-configs-zip) |
| 25 | $(performance-tests-zip) : PRIVATE_performance_tests_list := $(PRODUCT_OUT)/performance-tests_list |
| 26 | $(performance-tests-zip) : $(COMPATIBILITY.performance-tests.FILES) $(SOONG_ZIP) |
| 27 | echo $(sort $(COMPATIBILITY.performance-tests.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 | grep $(TARGET_OUT_TESTCASES) $@.list > $@-target.list || true |
| 31 | grep -e .*\\.config$$ $@-target.list > $@-target-test-configs.list || true |
| 32 | $(hide) $(SOONG_ZIP) -d -o $@ -P host -C $(HOST_OUT) -l $@-host.list -P target -C $(PRODUCT_OUT) -l $@-target.list -sha256 |
| 33 | $(hide) $(SOONG_ZIP) -d -o $(performance-tests-configs-zip) \ |
| 34 | -P host -C $(HOST_OUT) -l $@-host-test-configs.list \ |
| 35 | -P target -C $(PRODUCT_OUT) -l $@-target-test-configs.list |
| 36 | rm -f $(PRIVATE_performance_tests_list) |
| 37 | $(hide) grep -e .*\\.config$$ $@-host.list | sed s%$(HOST_OUT)%host%g > $(PRIVATE_performance_tests_list) |
| 38 | $(hide) grep -e .*\\.config$$ $@-target.list | sed s%$(PRODUCT_OUT)%target%g >> $(PRIVATE_performance_tests_list) |
| 39 | $(hide) $(SOONG_ZIP) -d -o $(performance-tests-list-zip) -C $(dir $@) -f $(PRIVATE_performance_tests_list) |
| 40 | rm -f $@.list $@-host.list $@-target.list $@-host-test-configs.list $@-target-test-configs.list \ |
| 41 | $(PRIVATE_performance_tests_list) |
| 42 | |
| 43 | performance-tests: $(performance-tests-zip) |
| 44 | $(call dist-for-goals, performance-tests, $(performance-tests-zip) $(performance-tests-list-zip) $(performance-tests-configs-zip)) |
| 45 | |
| 46 | $(call declare-1p-container,$(performance-tests-zip),) |
| 47 | $(call declare-container-license-deps,$(performance-tests-zip),$(COMPATIBILITY.performance-tests.FILES),$(PRODUCT_OUT)/:/) |
| 48 | |
| 49 | tests: performance-tests |
| 50 | |
| 51 | # Reset temp vars |
| 52 | performance-tests-zip := |
| 53 | performance-tests-list-zip := |
| 54 | performance-tests-configs-zip := |