1//
2// Copyright (C) 2019 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// Tests in this folder are included both in unit tests and CTS.
18package {
19    default_applicable_licenses: ["Android-Apache-2.0"],
20}
21
22java_library {
23    name: "TetheringCommonTests",
24    srcs: [
25        "common/**/*.java",
26        "common/**/*.kt"
27    ],
28    static_libs: [
29        "androidx.test.rules",
30        "net-tests-utils",
31    ],
32    // TODO(b/147200698) change sdk_version to module-current and remove framework-minus-apex
33    sdk_version: "core_platform",
34    libs: [
35        "framework-minus-apex",
36        "framework-connectivity.impl",
37        "framework-tethering.impl",
38    ],
39    visibility: [
40        "//packages/modules/Connectivity/tests/cts/tethering",
41    ],
42}
43
44java_defaults {
45    name: "TetheringTestsDefaults",
46    min_sdk_version: "30",
47    srcs: [
48        "src/**/*.java",
49        "src/**/*.kt",
50    ],
51    static_libs: [
52        "TetheringApiCurrentLib",
53        "TetheringCommonTests",
54        "androidx.test.rules",
55        "frameworks-base-testutils",
56        "mockito-target-extended-minus-junit4",
57        "net-tests-utils",
58        "testables",
59    ],
60    // TODO(b/147200698) change sdk_version to module-current and
61    // remove framework-minus-apex, ext, and framework-res
62    sdk_version: "core_platform",
63    libs: [
64        "android.test.runner",
65        "android.test.base",
66        "android.test.mock",
67        "ext",
68        "framework-minus-apex",
69        "framework-res",
70        "framework-connectivity.impl",
71        "framework-tethering.impl",
72        "framework-wifi.stubs.module_lib",
73    ],
74    jni_libs: [
75        // For mockito extended
76        "libdexmakerjvmtiagent",
77        "libstaticjvmtiagent",
78        "libtetherutilsjni",
79    ],
80}
81
82// Library containing the unit tests. This is used by the coverage test target to pull in the
83// unit test code. It is not currently used by the tests themselves because all the build
84// configuration needed by the tests is in the TetheringTestsDefaults rule.
85android_library {
86    name: "TetheringTestsLatestSdkLib",
87    defaults: ["TetheringTestsDefaults"],
88    target_sdk_version: "30",
89    visibility: [
90        "//packages/modules/Connectivity/tests:__subpackages__",
91        "//packages/modules/Connectivity/Tethering/tests:__subpackages__",
92    ]
93}
94
95android_test {
96    name: "TetheringTests",
97    platform_apis: true,
98    test_suites: [
99        "device-tests",
100        "mts",
101    ],
102    defaults: ["TetheringTestsDefaults"],
103    compile_multilib: "both",
104    jarjar_rules: ":TetheringTestsJarJarRules",
105}
106