blob: 98351cd0871364779d59ca97e5fe4d3bc5add41b [file] [log] [blame]
Remi NGUYEN VAN057bf202018-12-04 12:13:09 +09001//
2// Copyright (C) 2018 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
Remi NGUYEN VAN5f48efe2019-09-06 15:16:29 +090017java_defaults {
18 name: "NetworkStackTestsDefaults",
Remi NGUYEN VAN4a2eb872019-01-10 19:12:46 +090019 certificate: "platform",
Chalard Jean3674b552019-06-03 13:37:08 +090020 srcs: ["src/**/*.java", "src/**/*.kt"],
Remi NGUYEN VAN4a2eb872019-01-10 19:12:46 +090021 resource_dirs: ["res"],
Remi NGUYEN VAN057bf202018-12-04 12:13:09 +090022 static_libs: [
Remi NGUYEN VAN40525472020-01-07 09:55:38 +090023 "androidx.test.ext.junit",
Brett Chabot189c5982019-02-26 14:52:33 -080024 "androidx.test.rules",
Chalard Jean3c9f6872019-07-03 12:31:05 +090025 "kotlin-reflect",
Remi NGUYEN VAN057bf202018-12-04 12:13:09 +090026 "mockito-target-extended-minus-junit4",
Chalard Jean0d0cc8c2019-05-28 16:48:32 +090027 "net-tests-utils",
Remi NGUYEN VAN057bf202018-12-04 12:13:09 +090028 "testables",
29 ],
30 libs: [
31 "android.test.runner",
32 "android.test.base",
Remi NGUYEN VAN4a2eb872019-01-10 19:12:46 +090033 "android.test.mock",
Remi NGUYEN VAN057bf202018-12-04 12:13:09 +090034 ],
Xiao Ma53ed1ac2019-06-03 15:48:39 +090035 defaults: ["libnetworkstackutilsjni_deps"],
Remi NGUYEN VAN057bf202018-12-04 12:13:09 +090036 jni_libs: [
37 // For mockito extended
38 "libdexmakerjvmtiagent",
39 "libstaticjvmtiagent",
Xiao Ma53ed1ac2019-06-03 15:48:39 +090040 "libnetworkstackutilsjni",
41 ],
Lorenzo Colittib891b5e2020-02-05 16:48:09 +090042 jarjar_rules: ":NetworkStackJarJarRules",
Xiao Ma53ed1ac2019-06-03 15:48:39 +090043}
44
Lorenzo Colittib891b5e2020-02-05 16:48:09 +090045// Tests for NetworkStackNext.
Remi NGUYEN VAN5f48efe2019-09-06 15:16:29 +090046android_test {
47 name: "NetworkStackNextTests",
48 srcs: [], // TODO: tests that only apply to the current, non-stable API can be added here
49 test_suites: ["device-tests"],
50 defaults: ["NetworkStackTestsDefaults"],
51 static_libs: ["NetworkStackApiCurrentLib"],
52}
53
Lorenzo Colittib891b5e2020-02-05 16:48:09 +090054// Library containing the unit tests. This is used by the coverage test target to pull in the
55// unit test code. It is not currently used by the tests themselves because all the build
56// configuration needed by the tests is in the NetworkStackTestsDefaults rule.
57android_library {
58 name: "NetworkStackTestsLib",
59 min_sdk_version: "29",
60 defaults: ["NetworkStackTestsDefaults"],
61 static_libs: ["NetworkStackApiStableLib"],
paulhua9949882020-04-06 23:33:00 +080062 visibility: [
63 "//packages/modules/NetworkStack/tests/integration",
64 "//frameworks/base/packages/Tethering/tests/integration",
65 ]
Lorenzo Colittib891b5e2020-02-05 16:48:09 +090066}
67
Remi NGUYEN VAN5f48efe2019-09-06 15:16:29 +090068android_test {
69 name: "NetworkStackTests",
Remi NGUYEN VANa42c9482019-11-26 17:11:50 +090070 min_sdk_version: "29",
Remi NGUYEN VANf0a97612020-01-08 16:51:34 +090071 test_suites: ["device-tests", "mts"],
Remi NGUYEN VAN5f48efe2019-09-06 15:16:29 +090072 defaults: ["NetworkStackTestsDefaults"],
73 static_libs: ["NetworkStackApiStableLib"],
Kun Niu97ccc332020-01-14 17:07:44 -080074 compile_multilib: "both",
Remi NGUYEN VAN5f48efe2019-09-06 15:16:29 +090075}
76
Xiao Ma53ed1ac2019-06-03 15:48:39 +090077// Additional dependencies of libnetworkstackutilsjni that are not provided by the system when
78// running as a test application.
79// Using java_defaults as jni_libs does not support filegroups.
80java_defaults {
81 name: "libnetworkstackutilsjni_deps",
82 jni_libs: [
Remi NGUYEN VAN4a2eb872019-01-10 19:12:46 +090083 "libbacktrace",
84 "libbase",
85 "libbinder",
Remi NGUYEN VAN4a2eb872019-01-10 19:12:46 +090086 "libc++",
Yifan Hong4a55b452019-04-03 18:15:22 -070087 "libcgrouprc",
Remi NGUYEN VAN4a2eb872019-01-10 19:12:46 +090088 "libcrypto",
89 "libcutils",
Remi NGUYEN VAN1c88d602019-03-29 14:49:02 +090090 "ld-android",
91 "libdl_android",
Remi NGUYEN VAN4a2eb872019-01-10 19:12:46 +090092 "libhidl-gen-utils",
93 "libhidlbase",
junyulaicd924e52019-01-08 20:04:33 +080094 "libjsoncpp",
Remi NGUYEN VAN4a2eb872019-01-10 19:12:46 +090095 "liblog",
96 "liblzma",
97 "libnativehelper",
Lorenzo Colitti88ddd8822019-05-01 11:54:33 +090098 "libnativehelper_compat_libc++",
Remi NGUYEN VAN4a2eb872019-01-10 19:12:46 +090099 "libnetworkstacktestsjni",
100 "libpackagelistparser",
101 "libpcre2",
102 "libprocessgroup",
103 "libselinux",
104 "libui",
105 "libutils",
106 "libvintf",
107 "libvndksupport",
108 "libtinyxml2",
109 "libunwindstack",
110 "libutilscallstack",
111 "libziparchive",
112 "libz",
Jeongik Cha87036092019-10-25 02:02:00 +0900113 "netd_aidl_interface-cpp",
Remi NGUYEN VAN4a2eb872019-01-10 19:12:46 +0900114 ],
115}