summaryrefslogtreecommitdiff
path: root/libs/binder/ndk/tests/Android.bp
blob: ede4873dd6c2e863f9b6e2758bdb9dae42211db3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
/*
 * Copyright (C) 2018 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "frameworks_native_libs_binder_ndk_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["frameworks_native_libs_binder_ndk_license"],
}

cc_defaults {
    name: "test_libbinder_ndk_defaults",
    shared_libs: [
        "libbase",
    ],
    strip: {
        none: true,
    },
    cflags: [
        "-O0",
        "-g",
    ],
}

cc_library_static {
    name: "test_libbinder_ndk_library",
    defaults: ["test_libbinder_ndk_defaults"],
    export_include_dirs: ["include"],
    shared_libs: ["libbinder_ndk"],
    export_shared_lib_headers: ["libbinder_ndk"],
    srcs: ["iface.cpp"],
}

cc_defaults {
    name: "test_libbinder_ndk_test_defaults",
    defaults: ["test_libbinder_ndk_defaults"],
    // critical that libbinder/libbinder_ndk are shared for VTS
    shared_libs: [
        "libandroid_runtime_lazy",
        "libbase",
        "libbinder",
        "libbinder_ndk",
        "libutils",
    ],
    static_libs: [
        "test_libbinder_ndk_library",
    ],
}

// This test is a unit test of the low-level API that is presented here,
// specifically the parts which are outside of the NDK. Actual users should
// also instead use AIDL to generate these stubs. See android.binder.cts.
cc_test {
    name: "libbinder_ndk_unit_test",
    defaults: ["test_libbinder_ndk_test_defaults"],
    srcs: ["libbinder_ndk_unit_test.cpp"],
    static_libs: [
        "IBinderNdkUnitTest-cpp",
        "IBinderNdkUnitTest-ndk_platform",
    ],
    test_suites: ["general-tests", "vts"],
    require_root: true,
}

cc_test {
    name: "binderVendorDoubleLoadTest",
    vendor: true,
    srcs: [
        "binderVendorDoubleLoadTest.cpp",
    ],
    static_libs: [
        "IBinderVendorDoubleLoadTest-cpp",
        "IBinderVendorDoubleLoadTest-ndk_platform",
        "libbinder_aidl_test_stub-ndk_platform",
    ],
    // critical that libbinder/libbinder_ndk are shared for VTS
    shared_libs: [
        "libbase",
        "libbinder",
        "libbinder_ndk",
        "libutils",
    ],
    test_suites: ["general-tests"],
    require_root: true,
}

aidl_interface {
    name: "IBinderVendorDoubleLoadTest",
    unstable: true,
    vendor: true,
    srcs: [
        "IBinderVendorDoubleLoadTest.aidl",
    ],
}

aidl_interface {
    name: "IBinderNdkUnitTest",
    unstable: true,
    srcs: [
        "IBinderNdkUnitTest.aidl",
        "IEmpty.aidl",
    ],
}