blob: 7f739fb842e557fcf6ebbaa793e81d6b9f30a1b4 [file] [log] [blame]
Ang Libfc05da2016-06-22 17:44:25 -07001#
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
17LOCAL_PATH := $(call my-dir)
18
19include $(call all-subdir-makefiles)
20
21ifeq ($(HOST_OS),linux)
22
Xianyuan Jia314f9aa2020-04-22 16:26:40 -070023# ACTS framework
Ang Libfc05da2016-06-22 17:44:25 -070024ACTS_DISTRO := $(HOST_OUT)/acts-dist/acts.zip
25
markdr0ccb83e2017-11-16 15:15:21 -080026$(ACTS_DISTRO): $(sort $(shell find $(LOCAL_PATH)/acts))
Ang Libfc05da2016-06-22 17:44:25 -070027 @echo "Packaging ACTS into $(ACTS_DISTRO)"
28 @mkdir -p $(HOST_OUT)/acts-dist/
29 @rm -f $(HOST_OUT)/acts-dist/acts.zip
markdr0ccb83e2017-11-16 15:15:21 -080030 $(hide) zip $(HOST_OUT)/acts-dist/acts.zip $(shell find tools/test/connectivity/acts/* ! -wholename "*__pycache__*")
Ang Libfc05da2016-06-22 17:44:25 -070031acts: $(ACTS_DISTRO)
Dan Willemsen972c6ba2018-07-24 14:28:12 -070032.PHONY: acts
Ang Libfc05da2016-06-22 17:44:25 -070033
Dan Willemsenc59a9c62019-05-06 13:54:47 -070034$(call dist-for-goals,acts tests,$(ACTS_DISTRO))
Ang Libfc05da2016-06-22 17:44:25 -070035
Xianyuan Jia314f9aa2020-04-22 16:26:40 -070036
37# core ACTS test suite
38ACTS_TESTS_DISTRO_DIR := $(HOST_OUT)/acts_tests-dist
39ACTS_TESTS_DISTRO := $(ACTS_TESTS_DISTRO_DIR)/acts_tests.zip
40LOCAL_ACTS_TESTS_DIR := tools/test/connectivity/acts_tests
41LOCAL_ACTS_FRAMEWORK_DIR := tools/test/connectivity/acts/framework
42
Xianyuan Jia95ad1cf2020-05-29 18:33:47 -070043$(ACTS_TESTS_DISTRO): $(sort $(shell find $(LOCAL_PATH)/acts*))
Xianyuan Jia314f9aa2020-04-22 16:26:40 -070044 @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
52acts_tests: $(ACTS_TESTS_DISTRO)
53.PHONY: acts_tests
54
Xianyuan Jiab29aaee2020-04-29 13:51:28 -070055$(call dist-for-goals,acts_tests tests,$(ACTS_TESTS_DISTRO))
56
Xianyuan Jia314f9aa2020-04-22 16:26:40 -070057
Todd Lee1eb57282017-06-08 14:07:17 -070058# Wear specific Android Connectivity Test Suite
59WTS_ACTS_DISTRO_DIR := $(HOST_OUT)/wts-acts-dist
60WTS_ACTS_DISTRO := $(WTS_ACTS_DISTRO_DIR)/wts-acts
61WTS_ACTS_DISTRO_ARCHIVE := $(WTS_ACTS_DISTRO_DIR)/wts-acts.zip
62WTS_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 Lee725f6902017-06-09 16:02:14 -070071 $(hide) $(SOONG_ZIP) -d -P acts -o $(WTS_ACTS_DISTRO_ARCHIVE) -C tools/test/connectivity/acts/framework/acts/ -l $@.list
Todd Lee1eb57282017-06-08 14:07:17 -070072 # 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
78wts-acts: $(WTS_ACTS_DISTRO)
Dan Willemsen972c6ba2018-07-24 14:28:12 -070079.PHONY: wts-acts
Todd Lee1eb57282017-06-08 14:07:17 -070080
Dan Willemsenc59a9c62019-05-06 13:54:47 -070081$(call dist-for-goals,wts-acts tests,$(WTS_ACTS_DISTRO))
Todd Lee1eb57282017-06-08 14:07:17 -070082
83
84
Ang Libfc05da2016-06-22 17:44:25 -070085endif