• Home
  • History
  • Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2021 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
15package {
16    default_team: "trendy_team_fwk_core_networking",
17    default_applicable_licenses: ["Android-Apache-2.0"],
18}
19
20java_library {
21    name: "net-tests-utils",
22    srcs: [
23        "devicetests/**/*.java",
24        "devicetests/**/*.kt",
25    ],
26    defaults: [
27        "framework-connectivity-test-defaults",
28        "lib_mockito_extended",
29    ],
30    libs: [
31        "androidx.annotation_annotation",
32        "net-utils-device-common-bpf", // TestBpfMap extends IBpfMap.
33    ],
34    static_libs: [
35        "androidx.test.ext.junit",
36        "kotlin-reflect",
37        "libnanohttpd",
38        "net-tests-utils-host-device-common",
39        "net-utils-device-common",
40        "net-utils-device-common-async",
41        "net-utils-device-common-netlink",
42        "net-utils-device-common-struct",
43        "net-utils-device-common-struct-base",
44        "net-utils-device-common-wear",
45        "modules-utils-build_system",
46    ],
47    lint: {
48        strict_updatability_linting: true,
49    },
50}
51
52java_library {
53    // Consider using net-tests-utils instead if writing device code.
54    // That library has a lot more useful tools into it for users that
55    // work on Android and includes this lib.
56    name: "net-tests-utils-host-device-common",
57    srcs: [
58        "hostdevice/**/*.java",
59        "hostdevice/**/*.kt",
60    ],
61    host_supported: true,
62    visibility: [
63        "//packages/modules/Connectivity/staticlibs/tests:__subpackages__",
64        "//packages/modules/Connectivity/staticlibs/client-libs/tests:__subpackages__",
65        "//packages/modules/Connectivity/tests/cts/hostside",
66    ],
67    // There are downstream branches using an old version of Kotlin
68    // that used to reserve the right to make breaking changes to the
69    // Result type and disallowed returning an instance of it.
70    // Later versions allowed this and there was never a change,
71    // so no matter the version returning Result is always fine,
72    // but on sc-mainline-prod the compiler rejects it without
73    // the following flag.
74    kotlincflags: ["-Xallow-result-return-type"],
75    libs: [
76        "jsr305",
77    ],
78    static_libs: [
79        "kotlin-test",
80    ],
81    lint: {
82        strict_updatability_linting: true,
83    },
84}
85
86java_test_host {
87    name: "net-tests-utils-host-common",
88    srcs: [
89        "host/**/*.java",
90        "host/**/*.kt",
91    ],
92    libs: ["tradefed"],
93    test_suites: [
94        "ats",
95        "device-tests",
96        "general-tests",
97        "cts",
98        "mts-networking",
99        "mcts-networking",
100        "mts-tethering",
101        "mcts-tethering",
102        "mcts-wifi",
103        "mcts-dnsresolver",
104    ],
105    data: [":ConnectivityTestPreparer"],
106}
107