Lorenzo Colitti | 4896e32 | 2020-03-17 01:07:47 +0900 | [diff] [blame] | 1 | // |
| 2 | // Copyright (C) 2020 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 | // |
Bob Badour | 97e6be2 | 2021-02-12 14:45:04 -0800 | [diff] [blame] | 16 | package { |
| 17 | default_applicable_licenses: ["Android-Apache-2.0"], |
| 18 | } |
| 19 | |
paulhu | 6463265 | 2020-04-06 14:58:12 +0800 | [diff] [blame] | 20 | java_defaults { |
| 21 | name: "TetheringIntegrationTestsDefaults", |
markchien | 2fbd3e7 | 2021-08-17 23:59:09 +0800 | [diff] [blame] | 22 | defaults: ["framework-connectivity-test-defaults"], |
Lorenzo Colitti | 4896e32 | 2020-03-17 01:07:47 +0900 | [diff] [blame] | 23 | srcs: [ |
| 24 | "src/**/*.java", |
| 25 | "src/**/*.kt", |
| 26 | ], |
markchien | 7193a1b | 2021-04-27 01:50:31 +0800 | [diff] [blame] | 27 | min_sdk_version: "30", |
Lorenzo Colitti | 4896e32 | 2020-03-17 01:07:47 +0900 | [diff] [blame] | 28 | static_libs: [ |
| 29 | "NetworkStackApiStableLib", |
| 30 | "androidx.test.rules", |
Lorenzo Colitti | 4896e32 | 2020-03-17 01:07:47 +0900 | [diff] [blame] | 31 | "mockito-target-extended-minus-junit4", |
| 32 | "net-tests-utils", |
Hungming Chen | a525e24 | 2021-10-21 17:58:44 +0800 | [diff] [blame] | 33 | "net-utils-device-common-bpf", |
Lorenzo Colitti | 4896e32 | 2020-03-17 01:07:47 +0900 | [diff] [blame] | 34 | "testables", |
| 35 | ], |
| 36 | libs: [ |
| 37 | "android.test.runner", |
| 38 | "android.test.base", |
| 39 | "android.test.mock", |
| 40 | ], |
paulhu | d584d2f | 2020-04-08 09:57:57 +0800 | [diff] [blame] | 41 | jni_libs: [ |
| 42 | // For mockito extended |
| 43 | "libdexmakerjvmtiagent", |
| 44 | "libstaticjvmtiagent", |
| 45 | ], |
Lorenzo Colitti | 4896e32 | 2020-03-17 01:07:47 +0900 | [diff] [blame] | 46 | } |
paulhu | 6463265 | 2020-04-06 14:58:12 +0800 | [diff] [blame] | 47 | |
Remi NGUYEN VAN | 0015f04 | 2021-07-27 14:30:14 +0900 | [diff] [blame] | 48 | // Library including tethering integration tests targeting the latest stable SDK. |
| 49 | // Use with NetworkStackJarJarRules. |
paulhu | 6463265 | 2020-04-06 14:58:12 +0800 | [diff] [blame] | 50 | android_library { |
markchien | 7193a1b | 2021-04-27 01:50:31 +0800 | [diff] [blame] | 51 | name: "TetheringIntegrationTestsLatestSdkLib", |
markchien | bf62258 | 2021-11-04 01:09:26 +0800 | [diff] [blame] | 52 | target_sdk_version: "31", |
paulhu | 6463265 | 2020-04-06 14:58:12 +0800 | [diff] [blame] | 53 | platform_apis: true, |
| 54 | defaults: ["TetheringIntegrationTestsDefaults"], |
Baligh Uddin | 661ae39 | 2020-11-04 05:34:06 +0000 | [diff] [blame] | 55 | visibility: [ |
Baligh Uddin | 661ae39 | 2020-11-04 05:34:06 +0000 | [diff] [blame] | 56 | "//packages/modules/Connectivity/tests/cts/tethering", |
Remi NGUYEN VAN | fe20e13 | 2021-06-07 13:10:49 +0900 | [diff] [blame] | 57 | "//packages/modules/Connectivity/tests:__subpackages__", |
| 58 | "//packages/modules/Connectivity/Tethering/tests:__subpackages__", |
markchien | 7193a1b | 2021-04-27 01:50:31 +0800 | [diff] [blame] | 59 | ] |
| 60 | } |
| 61 | |
Remi NGUYEN VAN | 0015f04 | 2021-07-27 14:30:14 +0900 | [diff] [blame] | 62 | // Library including tethering integration tests targeting current development SDK. |
| 63 | // Use with NetworkStackJarJarRules. |
markchien | 7193a1b | 2021-04-27 01:50:31 +0800 | [diff] [blame] | 64 | android_library { |
| 65 | name: "TetheringIntegrationTestsLib", |
| 66 | target_sdk_version: "current", |
| 67 | platform_apis: true, |
| 68 | defaults: ["TetheringIntegrationTestsDefaults"], |
| 69 | visibility: [ |
| 70 | "//packages/modules/Connectivity/tests/cts/tethering", |
| 71 | "//packages/modules/Connectivity/Tethering/tests/mts", |
Baligh Uddin | 661ae39 | 2020-11-04 05:34:06 +0000 | [diff] [blame] | 72 | ] |
paulhu | 6463265 | 2020-04-06 14:58:12 +0800 | [diff] [blame] | 73 | } |
| 74 | |
| 75 | android_test { |
| 76 | name: "TetheringIntegrationTests", |
| 77 | platform_apis: true, |
| 78 | defaults: ["TetheringIntegrationTestsDefaults"], |
| 79 | test_suites: [ |
| 80 | "device-tests", |
Kimberly Kreider | c5b3f34 | 2021-10-20 18:16:59 +0000 | [diff] [blame] | 81 | "mts-tethering", |
paulhu | 6463265 | 2020-04-06 14:58:12 +0800 | [diff] [blame] | 82 | ], |
| 83 | compile_multilib: "both", |
Remi NGUYEN VAN | 0015f04 | 2021-07-27 14:30:14 +0900 | [diff] [blame] | 84 | jarjar_rules: ":NetworkStackJarJarRules", |
paulhu | 6463265 | 2020-04-06 14:58:12 +0800 | [diff] [blame] | 85 | } |
| 86 | |
Remi NGUYEN VAN | 8ea5ee6 | 2021-06-28 18:48:43 +0900 | [diff] [blame] | 87 | android_library { |
| 88 | name: "TetheringCoverageTestsLib", |
| 89 | min_sdk_version: "30", |
| 90 | static_libs: [ |
| 91 | "NetdStaticLibTestsLib", |
| 92 | "NetworkStaticLibTestsLib", |
| 93 | "NetworkStackTestsLib", |
| 94 | "TetheringTestsLatestSdkLib", |
| 95 | "TetheringIntegrationTestsLatestSdkLib", |
| 96 | ], |
Remi NGUYEN VAN | 0015f04 | 2021-07-27 14:30:14 +0900 | [diff] [blame] | 97 | // Jarjar rules should normally be applied on final artifacts and not intermediate libraries as |
| 98 | // applying different rules on intermediate libraries can cause conflicts when combining them |
| 99 | // (the resulting artifact can end up with multiple incompatible implementations of the same |
| 100 | // classes). But this library is used to combine tethering coverage tests with connectivity |
| 101 | // coverage tests into a single coverage target. The tests need to use the same jarjar rules as |
| 102 | // covered production code for coverage to be calculated properly, so jarjar is applied |
| 103 | // separately on each set of tests. |
| 104 | jarjar_rules: ":TetheringCoverageJarJarRules", |
Remi NGUYEN VAN | 8ea5ee6 | 2021-06-28 18:48:43 +0900 | [diff] [blame] | 105 | manifest: "AndroidManifest_coverage.xml", |
| 106 | visibility: [ |
| 107 | "//packages/modules/Connectivity/tests:__subpackages__" |
| 108 | ], |
| 109 | } |
| 110 | |
Remi NGUYEN VAN | 0015f04 | 2021-07-27 14:30:14 +0900 | [diff] [blame] | 111 | // Combine NetworkStack and Tethering jarjar rules for coverage target. The jarjar files are |
| 112 | // simply concatenated in the order specified in srcs. |
| 113 | genrule { |
| 114 | name: "TetheringCoverageJarJarRules", |
| 115 | srcs: [ |
| 116 | ":TetheringTestsJarJarRules", |
| 117 | ":NetworkStackJarJarRules", |
| 118 | ], |
| 119 | out: ["jarjar-rules-tethering-coverage.txt"], |
| 120 | cmd: "cat $(in) > $(out)", |
| 121 | visibility: ["//visibility:private"], |
| 122 | } |
| 123 | |
paulhu | 6463265 | 2020-04-06 14:58:12 +0800 | [diff] [blame] | 124 | // Special version of the tethering tests that includes all tests necessary for code coverage |
| 125 | // purposes. This is currently the union of TetheringTests, TetheringIntegrationTests and |
| 126 | // NetworkStackTests. |
Remi NGUYEN VAN | 8ea5ee6 | 2021-06-28 18:48:43 +0900 | [diff] [blame] | 127 | // TODO: remove in favor of ConnectivityCoverageTests, which includes below tests and more |
paulhu | 6463265 | 2020-04-06 14:58:12 +0800 | [diff] [blame] | 128 | android_test { |
| 129 | name: "TetheringCoverageTests", |
paulhu | 6463265 | 2020-04-06 14:58:12 +0800 | [diff] [blame] | 130 | platform_apis: true, |
markchien | 7193a1b | 2021-04-27 01:50:31 +0800 | [diff] [blame] | 131 | min_sdk_version: "30", |
markchien | bf62258 | 2021-11-04 01:09:26 +0800 | [diff] [blame] | 132 | target_sdk_version: "31", |
Kimberly Kreider | c5b3f34 | 2021-10-20 18:16:59 +0000 | [diff] [blame] | 133 | test_suites: ["device-tests", "mts-tethering"], |
paulhu | 6463265 | 2020-04-06 14:58:12 +0800 | [diff] [blame] | 134 | test_config: "AndroidTest_Coverage.xml", |
| 135 | defaults: ["libnetworkstackutilsjni_deps"], |
| 136 | static_libs: [ |
markchien | b23e912 | 2021-04-27 17:23:44 +0800 | [diff] [blame] | 137 | "modules-utils-native-coverage-listener", |
Remi NGUYEN VAN | 8ea5ee6 | 2021-06-28 18:48:43 +0900 | [diff] [blame] | 138 | "TetheringCoverageTestsLib", |
paulhu | 6463265 | 2020-04-06 14:58:12 +0800 | [diff] [blame] | 139 | ], |
| 140 | jni_libs: [ |
| 141 | // For mockito extended |
| 142 | "libdexmakerjvmtiagent", |
| 143 | "libstaticjvmtiagent", |
| 144 | // For NetworkStackUtils included in NetworkStackBase |
| 145 | "libnetworkstackutilsjni", |
markchien | f967b11 | 2021-11-09 16:56:23 +0800 | [diff] [blame] | 146 | "libcom_android_networkstack_tethering_util_jni", |
paulhu | 6463265 | 2020-04-06 14:58:12 +0800 | [diff] [blame] | 147 | ], |
| 148 | compile_multilib: "both", |
| 149 | manifest: "AndroidManifest_coverage.xml", |
markchien | e312648 | 2020-10-26 13:53:05 +0800 | [diff] [blame] | 150 | } |