blob: f6f4b8667ee24d1357b56da12a363bdb9060f8ab [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",
markchien71666eb2020-05-25 14:12:13 +080019 platform_apis: true,
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 ],
Colin Cross28b0b362020-05-06 17:53:18 -070042 jni_uses_sdk_apis: true,
Lorenzo Colittib891b5e2020-02-05 16:48:09 +090043 jarjar_rules: ":NetworkStackJarJarRules",
Xiao Ma53ed1ac2019-06-03 15:48:39 +090044}
45
Lorenzo Colittib891b5e2020-02-05 16:48:09 +090046// Tests for NetworkStackNext.
Remi NGUYEN VAN5f48efe2019-09-06 15:16:29 +090047android_test {
48 name: "NetworkStackNextTests",
49 srcs: [], // TODO: tests that only apply to the current, non-stable API can be added here
50 test_suites: ["device-tests"],
51 defaults: ["NetworkStackTestsDefaults"],
52 static_libs: ["NetworkStackApiCurrentLib"],
53}
54
Lorenzo Colittib891b5e2020-02-05 16:48:09 +090055// Library containing the unit tests. This is used by the coverage test target to pull in the
56// unit test code. It is not currently used by the tests themselves because all the build
57// configuration needed by the tests is in the NetworkStackTestsDefaults rule.
58android_library {
59 name: "NetworkStackTestsLib",
60 min_sdk_version: "29",
61 defaults: ["NetworkStackTestsDefaults"],
62 static_libs: ["NetworkStackApiStableLib"],
paulhua9949882020-04-06 23:33:00 +080063 visibility: [
64 "//packages/modules/NetworkStack/tests/integration",
65 "//frameworks/base/packages/Tethering/tests/integration",
66 ]
Lorenzo Colittib891b5e2020-02-05 16:48:09 +090067}
68
Remi NGUYEN VAN5f48efe2019-09-06 15:16:29 +090069android_test {
70 name: "NetworkStackTests",
Remi NGUYEN VANa42c9482019-11-26 17:11:50 +090071 min_sdk_version: "29",
Remi NGUYEN VANf0a97612020-01-08 16:51:34 +090072 test_suites: ["device-tests", "mts"],
Remi NGUYEN VAN5f48efe2019-09-06 15:16:29 +090073 defaults: ["NetworkStackTestsDefaults"],
74 static_libs: ["NetworkStackApiStableLib"],
Kun Niu97ccc332020-01-14 17:07:44 -080075 compile_multilib: "both",
Remi NGUYEN VAN5f48efe2019-09-06 15:16:29 +090076}
77
Xiao Ma53ed1ac2019-06-03 15:48:39 +090078// Additional dependencies of libnetworkstackutilsjni that are not provided by the system when
79// running as a test application.
80// Using java_defaults as jni_libs does not support filegroups.
81java_defaults {
82 name: "libnetworkstackutilsjni_deps",
83 jni_libs: [
Lorenzo Colitti88ddd8822019-05-01 11:54:33 +090084 "libnativehelper_compat_libc++",
Remi NGUYEN VAN4a2eb872019-01-10 19:12:46 +090085 "libnetworkstacktestsjni",
Remi NGUYEN VAN4a2eb872019-01-10 19:12:46 +090086 ],
87}