xref: /aosp_15_r20/external/cronet/android/tests/common/Android.bp (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
1// Copyright (C) 2023 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15
16// Tests in this folder are included both in unit tests and CTS.
17// They must be fast and stable, and exercise public or test APIs.
18
19package {
20    default_team: "trendy_team_fwk_core_networking",
21    // See: http://go/android-license-faq
22    default_applicable_licenses: ["Android-Apache-2.0"],
23}
24
25android_test {
26    name: "NetHttpCoverageTests",
27    enforce_default_target_sdk_version: true,
28    min_sdk_version: "30",
29    test_suites: [
30        "general-tests",
31        "mts-tethering",
32    ],
33    static_libs: [
34        "modules-utils-native-coverage-listener",
35        "CtsNetHttpTestsLib",
36        "NetHttpTestsLibPreJarJar",
37    ],
38    jarjar_rules: ":net-http-test-jarjar-rules",
39    compile_multilib: "both", // Include both the 32 and 64 bit versions
40    jni_libs: [
41        "cronet_aml_components_cronet_android_cronet_tests__testing",
42        "cronet_aml_third_party_netty_tcnative_netty_tcnative_so__testing",
43        "libnativecoverage",
44    ],
45    data: [":cronet_javatests_resources"],
46}
47
48// MTS-only specific targets.
49java_genrule {
50    name: "net-http-test-jarjar-rules",
51    tool_files: [
52        ":NetHttpTestsLibPreJarJar{.jar}",
53        "jarjar_excludes.txt",
54    ],
55    tools: [
56        "jarjar-rules-generator",
57    ],
58    out: ["net_http_test_jarjar_rules.txt"],
59    cmd: "$(location jarjar-rules-generator) " +
60        "$(location :NetHttpTestsLibPreJarJar{.jar}) " +
61        "--prefix android.net.connectivity " +
62        "--excludes $(location jarjar_excludes.txt) " +
63        "--output $(out)",
64}
65
66android_library {
67    name: "NetHttpTestsLibPreJarJar",
68    static_libs: [
69        "cronet_aml_api_java",
70        "cronet_aml_java__testing",
71        "cronet_java_tests",
72    ],
73    sdk_version: "module_current",
74    min_sdk_version: "30",
75}
76