Ang Li | bfc05da | 2016-06-22 17:44:25 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2016 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
| 17 | LOCAL_PATH := $(call my-dir) |
| 18 | |
| 19 | include $(call all-subdir-makefiles) |
| 20 | |
| 21 | ifeq ($(HOST_OS),linux) |
| 22 | |
Xianyuan Jia | 314f9aa | 2020-04-22 16:26:40 -0700 | [diff] [blame] | 23 | # ACTS framework |
Ang Li | bfc05da | 2016-06-22 17:44:25 -0700 | [diff] [blame] | 24 | ACTS_DISTRO := $(HOST_OUT)/acts-dist/acts.zip |
| 25 | |
markdr | 0ccb83e | 2017-11-16 15:15:21 -0800 | [diff] [blame] | 26 | $(ACTS_DISTRO): $(sort $(shell find $(LOCAL_PATH)/acts)) |
Ang Li | bfc05da | 2016-06-22 17:44:25 -0700 | [diff] [blame] | 27 | @echo "Packaging ACTS into $(ACTS_DISTRO)" |
| 28 | @mkdir -p $(HOST_OUT)/acts-dist/ |
| 29 | @rm -f $(HOST_OUT)/acts-dist/acts.zip |
markdr | 0ccb83e | 2017-11-16 15:15:21 -0800 | [diff] [blame] | 30 | $(hide) zip $(HOST_OUT)/acts-dist/acts.zip $(shell find tools/test/connectivity/acts/* ! -wholename "*__pycache__*") |
Ang Li | bfc05da | 2016-06-22 17:44:25 -0700 | [diff] [blame] | 31 | acts: $(ACTS_DISTRO) |
Dan Willemsen | 972c6ba | 2018-07-24 14:28:12 -0700 | [diff] [blame] | 32 | .PHONY: acts |
Ang Li | bfc05da | 2016-06-22 17:44:25 -0700 | [diff] [blame] | 33 | |
Dan Willemsen | c59a9c6 | 2019-05-06 13:54:47 -0700 | [diff] [blame] | 34 | $(call dist-for-goals,acts tests,$(ACTS_DISTRO)) |
Ang Li | bfc05da | 2016-06-22 17:44:25 -0700 | [diff] [blame] | 35 | |
Xianyuan Jia | 314f9aa | 2020-04-22 16:26:40 -0700 | [diff] [blame] | 36 | |
| 37 | # core ACTS test suite |
| 38 | ACTS_TESTS_DISTRO_DIR := $(HOST_OUT)/acts_tests-dist |
| 39 | ACTS_TESTS_DISTRO := $(ACTS_TESTS_DISTRO_DIR)/acts_tests.zip |
| 40 | LOCAL_ACTS_TESTS_DIR := tools/test/connectivity/acts_tests |
| 41 | LOCAL_ACTS_FRAMEWORK_DIR := tools/test/connectivity/acts/framework |
| 42 | |
Xianyuan Jia | 95ad1cf | 2020-05-29 18:33:47 -0700 | [diff] [blame] | 43 | $(ACTS_TESTS_DISTRO): $(sort $(shell find $(LOCAL_PATH)/acts*)) |
Xianyuan Jia | 314f9aa | 2020-04-22 16:26:40 -0700 | [diff] [blame] | 44 | @echo "Packaging ACTS core test suite into $(ACTS_TESTS_DISTRO)" |
| 45 | @rm -rf $(ACTS_TESTS_DISTRO_DIR) |
| 46 | # Copy over the contents of acts_tests, resolving symlinks |
| 47 | @rsync -auv --copy-links $(LOCAL_ACTS_TESTS_DIR)/ $(ACTS_TESTS_DISTRO_DIR) |
| 48 | # Copy over the ACTS framework |
| 49 | @rsync -auv $(LOCAL_ACTS_FRAMEWORK_DIR)/ $(ACTS_TESTS_DISTRO_DIR)/acts_framework |
| 50 | # Make a zip archive |
| 51 | @cd $(ACTS_TESTS_DISTRO_DIR) && find . ! -wholename "*__pycache__*" -printf "%P\n" | xargs zip acts_tests.zip |
| 52 | acts_tests: $(ACTS_TESTS_DISTRO) |
| 53 | .PHONY: acts_tests |
| 54 | |
Xianyuan Jia | b29aaee | 2020-04-29 13:51:28 -0700 | [diff] [blame] | 55 | $(call dist-for-goals,acts_tests tests,$(ACTS_TESTS_DISTRO)) |
| 56 | |
Xianyuan Jia | 314f9aa | 2020-04-22 16:26:40 -0700 | [diff] [blame] | 57 | |
Todd Lee | 1eb5728 | 2017-06-08 14:07:17 -0700 | [diff] [blame] | 58 | # Wear specific Android Connectivity Test Suite |
| 59 | WTS_ACTS_DISTRO_DIR := $(HOST_OUT)/wts-acts-dist |
| 60 | WTS_ACTS_DISTRO := $(WTS_ACTS_DISTRO_DIR)/wts-acts |
| 61 | WTS_ACTS_DISTRO_ARCHIVE := $(WTS_ACTS_DISTRO_DIR)/wts-acts.zip |
| 62 | WTS_LOCAL_ACTS_DIR := tools/test/connectivity/acts/framework/acts/ |
| 63 | |
| 64 | $(WTS_ACTS_DISTRO): $(SOONG_ZIP) |
| 65 | @echo "Packaging WTS-ACTS into $(WTS_ACTS_DISTRO)" |
| 66 | # clean-up and mkdir for dist |
| 67 | @rm -Rf $(WTS_ACTS_DISTRO_DIR) |
| 68 | @mkdir -p $(WTS_ACTS_DISTRO_DIR) |
| 69 | # grab the files from local acts framework and zip them up |
| 70 | $(hide) find $(WTS_LOCAL_ACTS_DIR) | sort >$@.list |
Todd Lee | 725f690 | 2017-06-09 16:02:14 -0700 | [diff] [blame] | 71 | $(hide) $(SOONG_ZIP) -d -P acts -o $(WTS_ACTS_DISTRO_ARCHIVE) -C tools/test/connectivity/acts/framework/acts/ -l $@.list |
Todd Lee | 1eb5728 | 2017-06-08 14:07:17 -0700 | [diff] [blame] | 72 | # add in the local wts py files for use with the prebuilt |
| 73 | $(hide) zip -r $(WTS_ACTS_DISTRO_ARCHIVE) -j tools/test/connectivity/wts-acts/*.py |
| 74 | # create executable tool from the archive |
| 75 | $(hide) echo '#!/usr/bin/env python' | cat - $(WTS_ACTS_DISTRO_DIR)/wts-acts.zip > $(WTS_ACTS_DISTRO_DIR)/wts-acts |
| 76 | $(hide) chmod 755 $(WTS_ACTS_DISTRO) |
| 77 | |
| 78 | wts-acts: $(WTS_ACTS_DISTRO) |
Dan Willemsen | 972c6ba | 2018-07-24 14:28:12 -0700 | [diff] [blame] | 79 | .PHONY: wts-acts |
Todd Lee | 1eb5728 | 2017-06-08 14:07:17 -0700 | [diff] [blame] | 80 | |
Dan Willemsen | c59a9c6 | 2019-05-06 13:54:47 -0700 | [diff] [blame] | 81 | $(call dist-for-goals,wts-acts tests,$(WTS_ACTS_DISTRO)) |
Todd Lee | 1eb5728 | 2017-06-08 14:07:17 -0700 | [diff] [blame] | 82 | |
| 83 | |
| 84 | |
Ang Li | bfc05da | 2016-06-22 17:44:25 -0700 | [diff] [blame] | 85 | endif |