1// 2// Copyright (C) 2019 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 17package { 18 default_team: "trendy_team_fwk_core_networking", 19 default_applicable_licenses: ["Android-Apache-2.0"], 20} 21 22java_defaults { 23 name: "NetworkStackIntegrationTestsJniDefaults", 24 defaults: ["libnetworkstackutilsjni_deps"], 25 jni_libs: [ 26 // For mockito extended 27 "libdexmakerjvmtiagent", 28 "libstaticjvmtiagent", 29 // For NetworkStackUtils included in NetworkStackBase 30 "libnetworkstackutilsjni", 31 ], 32 jni_uses_sdk_apis: true, 33 visibility: ["//visibility:private"], 34} 35 36java_defaults { 37 name: "NetworkStackIntegrationTestsDefaults", 38 defaults: [ 39 "framework-connectivity-test-defaults", 40 "NetworkStackReleaseTargetSdk", 41 ], 42 srcs: [ 43 "common/**/*.java", 44 "common/**/*.kt", 45 ], 46 static_libs: [ 47 "androidx.annotation_annotation", 48 "androidx.test.rules", 49 "mockito-target-extended-minus-junit4", 50 "net-tests-utils", 51 "testables", 52 ], 53 libs: [ 54 "android.test.runner.stubs", 55 "android.test.base.stubs", 56 "android.test.mock.stubs", 57 ], 58 visibility: ["//visibility:private"], 59} 60 61android_library { 62 name: "NetworkStackIntegrationTestsLib", 63 defaults: ["NetworkStackIntegrationTestsDefaults"], 64 srcs: [ 65 "signature/**/*.java", 66 "signature/**/*.kt", 67 ], 68 min_sdk_version: "30", 69 static_libs: [ 70 "NetworkStackApiStableLib", 71 ], 72} 73 74// Network stack integration tests. 75android_test { 76 name: "NetworkStackIntegrationTests", 77 defaults: [ 78 "NetworkStackReleaseTargetSdk", 79 "NetworkStackIntegrationTestsJniDefaults", 80 ], 81 static_libs: ["NetworkStackIntegrationTestsLib"], 82 certificate: "networkstack", 83 platform_apis: true, 84 test_suites: ["device-tests"], 85 jarjar_rules: ":NetworkStackJarJarRules", 86 host_required: ["net-tests-utils-host-common"], 87 test_config_template: "AndroidTestTemplate_Integration.xml", 88} 89 90// Network stack next integration tests. 91android_test { 92 name: "NetworkStackNextIntegrationTests", 93 defaults: [ 94 "NetworkStackIntegrationTestsDefaults", 95 "NetworkStackIntegrationTestsJniDefaults", 96 "ConnectivityNextEnableDefaults", 97 ], 98 srcs: [ 99 "signature/**/*.java", 100 "signature/**/*.kt", 101 ], 102 static_libs: [ 103 "NetworkStackApiStableLib", 104 ], 105 certificate: "networkstack", 106 platform_apis: true, 107 test_suites: ["device-tests"], 108 jarjar_rules: ":NetworkStackJarJarRules", 109 host_required: ["net-tests-utils-host-common"], 110 test_config_template: "AndroidTestTemplate_Integration.xml", 111} 112 113// Network stack integration root tests. 114android_test { 115 name: "NetworkStackRootTests", 116 defaults: [ 117 "NetworkStackIntegrationTestsDefaults", 118 "NetworkStackIntegrationTestsJniDefaults", 119 ], 120 srcs: [ 121 "root/**/*.java", 122 "root/**/*.kt", 123 ], 124 static_libs: [ 125 "NetworkStackApiStableLib", 126 ], 127 platform_apis: true, 128 test_suites: [ 129 "general-tests", 130 "mts-networking", 131 ], 132 compile_multilib: "both", 133 manifest: "AndroidManifest_root.xml", 134 jarjar_rules: ":NetworkStackJarJarRules", 135 host_required: ["net-tests-utils-host-common"], 136 test_config_template: "AndroidTestTemplate_Integration.xml", 137} 138 139// Special version of the network stack tests that includes all tests necessary for code coverage 140// purposes. This is currently the union of NetworkStackTests and NetworkStackIntegrationTests. 141android_test { 142 name: "NetworkStackCoverageTests", 143 certificate: "networkstack", 144 platform_apis: true, 145 test_suites: [ 146 "device-tests", 147 "mts-networking", 148 ], 149 test_config: "AndroidTest_Coverage.xml", 150 defaults: [ 151 "NetworkStackReleaseTargetSdk", 152 "NetworkStackIntegrationTestsJniDefaults", 153 ], 154 static_libs: [ 155 "modules-utils-native-coverage-listener", 156 "NetworkStackTestsLib", 157 "NetworkStackIntegrationTestsLib", 158 "NetworkStaticLibTestsLib", 159 "NetdStaticLibTestsLib", 160 ], 161 compile_multilib: "both", 162 manifest: "AndroidManifest_coverage.xml", 163 jarjar_rules: ":NetworkStackJarJarRules", 164} 165