blob: 324226d0c7e0cd0bd4a2647f970c34647c9622a6 [file] [log] [blame]
Stuart Scott1926e9b2015-06-03 17:42:39 -07001# Copyright (C) 2015 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# Package up a compatibility test suite in a zip file.
16#
17# Input variables:
18# test_suite_name: the name of this test suite eg. cts
19# test_suite_tradefed: the name of this test suite's tradefed wrapper
Aaron Holdenaee6f602015-12-15 15:04:01 -080020# test_suite_dynamic_config: the path to this test suite's dynamic configuration file
Stuart Scott1926e9b2015-06-03 17:42:39 -070021# test_suite_readme: the path to a README file for this test suite
22# Output variables:
23# compatibility_zip: the path to the output zip file.
24
25out_dir := $(HOST_OUT)/$(test_suite_name)/android-$(test_suite_name)
26test_artifacts := $(COMPATIBILITY.$(test_suite_name).FILES)
Stuart Scott1dcff842015-06-08 15:04:31 -070027test_tools := $(HOST_OUT_JAVA_LIBRARIES)/hosttestlib.jar \
Julien Desprez63d377c2016-11-11 12:12:06 +000028 $(HOST_OUT_JAVA_LIBRARIES)/tradefed.jar \
Stuart Scott19324d12015-07-23 12:56:51 -070029 $(HOST_OUT_JAVA_LIBRARIES)/compatibility-host-util.jar \
Julien Desprez7b109502016-09-12 11:19:48 +010030 $(HOST_OUT_JAVA_LIBRARIES)/compatibility-host-util-tests.jar \
31 $(HOST_OUT_JAVA_LIBRARIES)/compatibility-common-util-tests.jar \
32 $(HOST_OUT_JAVA_LIBRARIES)/compatibility-tradefed-tests.jar \
Stuart Scott1dcff842015-06-08 15:04:31 -070033 $(HOST_OUT_JAVA_LIBRARIES)/$(test_suite_tradefed).jar \
Julien Desprez7b109502016-09-12 11:19:48 +010034 $(HOST_OUT_JAVA_LIBRARIES)/$(test_suite_tradefed)-tests.jar \
Stuart Scott1dcff842015-06-08 15:04:31 -070035 $(HOST_OUT_EXECUTABLES)/$(test_suite_tradefed) \
36 $(test_suite_readme)
Stuart Scott1926e9b2015-06-03 17:42:39 -070037
38compatibility_zip := $(out_dir).zip
39$(compatibility_zip): PRIVATE_NAME := android-$(test_suite_name)
40$(compatibility_zip): PRIVATE_OUT_DIR := $(out_dir)
Stuart Scott1dcff842015-06-08 15:04:31 -070041$(compatibility_zip): PRIVATE_TOOLS := $(test_tools)
Aaron Holdenaee6f602015-12-15 15:04:01 -080042$(compatibility_zip): PRIVATE_SUITE_NAME := $(test_suite_name)
43$(compatibility_zip): PRIVATE_DYNAMIC_CONFIG := $(test_suite_dynamic_config)
44$(compatibility_zip): $(test_artifacts) $(test_tools) $(test_suite_dynamic_config) | $(ADB) $(ACP)
Stuart Scott1926e9b2015-06-03 17:42:39 -070045# Make dir structure
Stuart Scott3a037452015-06-10 09:25:24 -070046 $(hide) mkdir -p $(PRIVATE_OUT_DIR)/tools $(PRIVATE_OUT_DIR)/testcases
Stuart Scott1926e9b2015-06-03 17:42:39 -070047# Copy tools
Stuart Scott1dcff842015-06-08 15:04:31 -070048 $(hide) $(ACP) -fp $(PRIVATE_TOOLS) $(PRIVATE_OUT_DIR)/tools
Aaron Holdenaee6f602015-12-15 15:04:01 -080049 $(if $(PRIVATE_DYNAMIC_CONFIG),$(hide) $(ACP) -fp $(PRIVATE_DYNAMIC_CONFIG) $(PRIVATE_OUT_DIR)/testcases/$(PRIVATE_SUITE_NAME).dynamic)
Stuart Scott1926e9b2015-06-03 17:42:39 -070050 $(hide) cd $(dir $@) && zip -rq $(notdir $@) $(PRIVATE_NAME)
Aaron Holdenaee6f602015-12-15 15:04:01 -080051
52# Reset all input variables
53test_suite_name :=
54test_suite_tradefed :=
55test_suite_dynamic_config :=
56test_suite_readme :=