Remi NGUYEN VAN | 057bf20 | 2018-12-04 12:13:09 +0900 | [diff] [blame] | 1 | // |
| 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 VAN | 5f48efe | 2019-09-06 15:16:29 +0900 | [diff] [blame] | 17 | java_defaults { |
| 18 | name: "NetworkStackTestsDefaults", |
markchien | 71666eb | 2020-05-25 14:12:13 +0800 | [diff] [blame] | 19 | platform_apis: true, |
Chalard Jean | 3674b55 | 2019-06-03 13:37:08 +0900 | [diff] [blame] | 20 | srcs: ["src/**/*.java", "src/**/*.kt"], |
Remi NGUYEN VAN | 4a2eb87 | 2019-01-10 19:12:46 +0900 | [diff] [blame] | 21 | resource_dirs: ["res"], |
Remi NGUYEN VAN | 057bf20 | 2018-12-04 12:13:09 +0900 | [diff] [blame] | 22 | static_libs: [ |
Remi NGUYEN VAN | 4052547 | 2020-01-07 09:55:38 +0900 | [diff] [blame] | 23 | "androidx.test.ext.junit", |
Brett Chabot | 189c598 | 2019-02-26 14:52:33 -0800 | [diff] [blame] | 24 | "androidx.test.rules", |
Chalard Jean | 3c9f687 | 2019-07-03 12:31:05 +0900 | [diff] [blame] | 25 | "kotlin-reflect", |
Remi NGUYEN VAN | 057bf20 | 2018-12-04 12:13:09 +0900 | [diff] [blame] | 26 | "mockito-target-extended-minus-junit4", |
Chalard Jean | 0d0cc8c | 2019-05-28 16:48:32 +0900 | [diff] [blame] | 27 | "net-tests-utils", |
Remi NGUYEN VAN | 057bf20 | 2018-12-04 12:13:09 +0900 | [diff] [blame] | 28 | "testables", |
| 29 | ], |
| 30 | libs: [ |
| 31 | "android.test.runner", |
| 32 | "android.test.base", |
Remi NGUYEN VAN | 4a2eb87 | 2019-01-10 19:12:46 +0900 | [diff] [blame] | 33 | "android.test.mock", |
Remi NGUYEN VAN | 057bf20 | 2018-12-04 12:13:09 +0900 | [diff] [blame] | 34 | ], |
Xiao Ma | 53ed1ac | 2019-06-03 15:48:39 +0900 | [diff] [blame] | 35 | defaults: ["libnetworkstackutilsjni_deps"], |
Remi NGUYEN VAN | 057bf20 | 2018-12-04 12:13:09 +0900 | [diff] [blame] | 36 | jni_libs: [ |
| 37 | // For mockito extended |
| 38 | "libdexmakerjvmtiagent", |
| 39 | "libstaticjvmtiagent", |
Xiao Ma | 53ed1ac | 2019-06-03 15:48:39 +0900 | [diff] [blame] | 40 | "libnetworkstackutilsjni", |
| 41 | ], |
Colin Cross | 28b0b36 | 2020-05-06 17:53:18 -0700 | [diff] [blame] | 42 | jni_uses_sdk_apis: true, |
Lorenzo Colitti | b891b5e | 2020-02-05 16:48:09 +0900 | [diff] [blame] | 43 | jarjar_rules: ":NetworkStackJarJarRules", |
Xiao Ma | 53ed1ac | 2019-06-03 15:48:39 +0900 | [diff] [blame] | 44 | } |
| 45 | |
Lorenzo Colitti | b891b5e | 2020-02-05 16:48:09 +0900 | [diff] [blame] | 46 | // Tests for NetworkStackNext. |
Remi NGUYEN VAN | 5f48efe | 2019-09-06 15:16:29 +0900 | [diff] [blame] | 47 | android_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 Colitti | b891b5e | 2020-02-05 16:48:09 +0900 | [diff] [blame] | 55 | // 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. |
| 58 | android_library { |
| 59 | name: "NetworkStackTestsLib", |
| 60 | min_sdk_version: "29", |
| 61 | defaults: ["NetworkStackTestsDefaults"], |
| 62 | static_libs: ["NetworkStackApiStableLib"], |
paulhu | a994988 | 2020-04-06 23:33:00 +0800 | [diff] [blame] | 63 | visibility: [ |
| 64 | "//packages/modules/NetworkStack/tests/integration", |
| 65 | "//frameworks/base/packages/Tethering/tests/integration", |
| 66 | ] |
Lorenzo Colitti | b891b5e | 2020-02-05 16:48:09 +0900 | [diff] [blame] | 67 | } |
| 68 | |
Remi NGUYEN VAN | 5f48efe | 2019-09-06 15:16:29 +0900 | [diff] [blame] | 69 | android_test { |
| 70 | name: "NetworkStackTests", |
Remi NGUYEN VAN | a42c948 | 2019-11-26 17:11:50 +0900 | [diff] [blame] | 71 | min_sdk_version: "29", |
Remi NGUYEN VAN | f0a9761 | 2020-01-08 16:51:34 +0900 | [diff] [blame] | 72 | test_suites: ["device-tests", "mts"], |
Remi NGUYEN VAN | 5f48efe | 2019-09-06 15:16:29 +0900 | [diff] [blame] | 73 | defaults: ["NetworkStackTestsDefaults"], |
| 74 | static_libs: ["NetworkStackApiStableLib"], |
Kun Niu | 97ccc33 | 2020-01-14 17:07:44 -0800 | [diff] [blame] | 75 | compile_multilib: "both", |
Remi NGUYEN VAN | 5f48efe | 2019-09-06 15:16:29 +0900 | [diff] [blame] | 76 | } |
| 77 | |
Xiao Ma | 53ed1ac | 2019-06-03 15:48:39 +0900 | [diff] [blame] | 78 | // 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. |
| 81 | java_defaults { |
| 82 | name: "libnetworkstackutilsjni_deps", |
| 83 | jni_libs: [ |
Lorenzo Colitti | 88ddd882 | 2019-05-01 11:54:33 +0900 | [diff] [blame] | 84 | "libnativehelper_compat_libc++", |
Remi NGUYEN VAN | 4a2eb87 | 2019-01-10 19:12:46 +0900 | [diff] [blame] | 85 | "libnetworkstacktestsjni", |
Remi NGUYEN VAN | 4a2eb87 | 2019-01-10 19:12:46 +0900 | [diff] [blame] | 86 | ], |
| 87 | } |