blob: c2826186e3cba6d3de01a200824e81a5156bc7a4 [file] [log] [blame]
markchien43e97e02019-09-03 15:58:06 +08001//
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
Paul Hu1cae88f2020-04-22 14:01:56 +000017// Tests in this folder are included both in unit tests and CTS.
Bob Badour97e6be22021-02-12 14:45:04 -080018package {
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000019 default_team: "trendy_team_fwk_core_networking",
Bob Badour97e6be22021-02-12 14:45:04 -080020 default_applicable_licenses: ["Android-Apache-2.0"],
21}
22
Paul Hu1cae88f2020-04-22 14:01:56 +000023java_library {
24 name: "TetheringCommonTests",
25 srcs: [
26 "common/**/*.java",
Aditya Choudhary01b5ede2024-01-31 11:08:57 +000027 "common/**/*.kt",
Paul Hu1cae88f2020-04-22 14:01:56 +000028 ],
29 static_libs: [
30 "androidx.test.rules",
31 "net-tests-utils",
32 ],
33 // TODO(b/147200698) change sdk_version to module-current and remove framework-minus-apex
34 sdk_version: "core_platform",
35 libs: [
36 "framework-minus-apex",
Remi NGUYEN VANeeeed132021-03-30 08:12:27 +000037 "framework-connectivity.impl",
paulhu699477a2022-02-08 21:25:28 +080038 "framework-connectivity-t.impl",
Paul Duffincbac8e02020-05-13 12:28:49 +010039 "framework-tethering.impl",
Paul Hu1cae88f2020-04-22 14:01:56 +000040 ],
Baligh Uddin661ae392020-11-04 05:34:06 +000041 visibility: [
Baligh Uddin661ae392020-11-04 05:34:06 +000042 "//packages/modules/Connectivity/tests/cts/tethering",
43 ],
Paul Hu1cae88f2020-04-22 14:01:56 +000044}
45
paulhud1ebb1e2020-04-06 14:58:12 +080046java_defaults {
47 name: "TetheringTestsDefaults",
markchien7193a1b2021-04-27 01:50:31 +080048 min_sdk_version: "30",
markchiendd6177b2019-09-23 20:29:54 +080049 srcs: [
markchiendd6177b2019-09-23 20:29:54 +080050 "src/**/*.java",
Remi NGUYEN VAN5c146662020-01-24 22:57:09 +090051 "src/**/*.kt",
markchiendd6177b2019-09-23 20:29:54 +080052 ],
markchien43e97e02019-09-03 15:58:06 +080053 static_libs: [
Remi NGUYEN VAN05c376a2025-03-07 10:09:53 +090054 // Include mockito extended first so it takes precedence, as other libraries like
55 // TetheringCommonTests bundle non-extended mockito.
56 // TODO: use non-extended mockito in tethering tests instead
57 "mockito-target-extended-minus-junit4",
Paul Hu1cae88f2020-04-22 14:01:56 +000058 "TetheringCommonTests",
markchien43e97e02019-09-03 15:58:06 +080059 "androidx.test.rules",
60 "frameworks-base-testutils",
markchien43e97e02019-09-03 15:58:06 +080061 "testables",
Quang Anh Luong1a27e1f2025-02-14 15:03:01 +090062 "truth",
markchien43e97e02019-09-03 15:58:06 +080063 ],
markchien44fc26d2020-02-06 19:23:26 +080064 // TODO(b/147200698) change sdk_version to module-current and
65 // remove framework-minus-apex, ext, and framework-res
66 sdk_version: "core_platform",
markchien43e97e02019-09-03 15:58:06 +080067 libs: [
Jihoon Kang8401b6a2024-08-30 00:29:58 +000068 "android.test.runner.stubs",
69 "android.test.base.stubs",
70 "android.test.mock.stubs",
paulhud1ebb1e2020-04-06 14:58:12 +080071 "ext",
72 "framework-minus-apex",
73 "framework-res",
Roopa Sattirajub09e60c2022-02-09 14:33:04 -080074 "framework-bluetooth.stubs.module_lib",
Hassan Alibc4e5142022-12-08 12:56:05 +000075 "framework-configinfrastructure.stubs.module_lib",
Remi NGUYEN VAN34d197b2021-03-19 13:11:06 +000076 "framework-connectivity.impl",
paulhu699477a2022-02-08 21:25:28 +080077 "framework-connectivity-t.impl",
Paul Duffincbac8e02020-05-13 12:28:49 +010078 "framework-tethering.impl",
Paul Duffin6812c1b2020-05-31 11:35:50 +010079 "framework-wifi.stubs.module_lib",
markchien43e97e02019-09-03 15:58:06 +080080 ],
81 jni_libs: [
82 // For mockito extended
83 "libdexmakerjvmtiagent",
84 "libstaticjvmtiagent",
markchienf967b112021-11-09 16:56:23 +080085 "libcom_android_networkstack_tethering_util_jni",
markchien43e97e02019-09-03 15:58:06 +080086 ],
87}
paulhud1ebb1e2020-04-06 14:58:12 +080088
89// Library containing the unit tests. This is used by the coverage test target to pull in the
90// unit test code. It is not currently used by the tests themselves because all the build
91// configuration needed by the tests is in the TetheringTestsDefaults rule.
92android_library {
markchien7193a1b2021-04-27 01:50:31 +080093 name: "TetheringTestsLatestSdkLib",
paulhud1ebb1e2020-04-06 14:58:12 +080094 defaults: ["TetheringTestsDefaults"],
markchien598a75b2021-11-22 10:36:32 +080095 static_libs: [
96 "TetheringApiStableLib",
97 ],
Mark Chiend25a1e02022-05-19 01:01:26 +080098 target_sdk_version: "33",
paulhud1ebb1e2020-04-06 14:58:12 +080099 visibility: [
Remi NGUYEN VANfe20e132021-06-07 13:10:49 +0900100 "//packages/modules/Connectivity/tests:__subpackages__",
101 "//packages/modules/Connectivity/Tethering/tests:__subpackages__",
Aditya Choudhary01b5ede2024-01-31 11:08:57 +0000102 ],
paulhud1ebb1e2020-04-06 14:58:12 +0800103}
104
105android_test {
106 name: "TetheringTests",
Treehugger Robot369fd252020-05-27 04:17:44 +0000107 platform_apis: true,
paulhud1ebb1e2020-04-06 14:58:12 +0800108 test_suites: [
109 "device-tests",
Kimberly Kreiderc5b3f342021-10-20 18:16:59 +0000110 "mts-tethering",
paulhud1ebb1e2020-04-06 14:58:12 +0800111 ],
markchien598a75b2021-11-22 10:36:32 +0800112 defaults: [
113 "TetheringTestsDefaults",
114 "ConnectivityNextEnableDefaults",
115 ],
116 static_libs: [
117 "TetheringApiCurrentLib",
118 ],
paulhud1ebb1e2020-04-06 14:58:12 +0800119 compile_multilib: "both",
Remi NGUYEN VAN8ea5ee62021-06-28 18:48:43 +0900120 jarjar_rules: ":TetheringTestsJarJarRules",
paulhud1ebb1e2020-04-06 14:58:12 +0800121}