1//
2// Copyright (C) 2014 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    // See: http://go/android-license-faq
19    // A large-scale-change added 'default_applicable_licenses' to import
20    // all of the 'license_kinds' from "frameworks_native_license"
21    // to get the below license kinds:
22    //   SPDX-license-identifier-Apache-2.0
23    default_applicable_licenses: ["frameworks_native_license"],
24}
25
26cc_defaults {
27    name: "binder_test_defaults",
28    cflags: [
29        "-Wall",
30        "-Werror",
31    ],
32}
33
34cc_test {
35    name: "binderDriverInterfaceTest_IPC_32",
36    defaults: ["binder_test_defaults"],
37    srcs: ["binderDriverInterfaceTest.cpp"],
38    header_libs: ["libbinder_headers"],
39    compile_multilib: "32",
40    multilib: { lib32: { suffix: "" } },
41    cflags: ["-DBINDER_IPC_32BIT=1"],
42    test_suites: ["vts"],
43}
44
45cc_test {
46    name: "binderDriverInterfaceTest",
47    defaults: ["binder_test_defaults"],
48    product_variables: {
49        binder32bit: {
50            cflags: ["-DBINDER_IPC_32BIT=1"],
51        },
52    },
53    header_libs: ["libbinder_headers"],
54    srcs: ["binderDriverInterfaceTest.cpp"],
55    test_suites: ["device-tests", "vts"],
56}
57
58cc_test {
59    name: "binderLibTest_IPC_32",
60    defaults: ["binder_test_defaults"],
61    srcs: ["binderLibTest.cpp"],
62    shared_libs: [
63        "libbinder",
64        "libutils",
65    ],
66    static_libs: [
67        "libgmock",
68    ],
69    compile_multilib: "32",
70    multilib: { lib32: { suffix: "" } },
71    cflags: ["-DBINDER_IPC_32BIT=1"],
72    test_suites: ["vts"],
73    require_root: true,
74}
75
76// unit test only, which can run on host and doesn't use /dev/binder
77cc_test {
78    name: "binderParcelTest",
79    host_supported: true,
80    target: {
81        darwin: {
82            enabled: false,
83        },
84    },
85    srcs: ["binderParcelTest.cpp"],
86    shared_libs: [
87        "libbinder",
88        "libutils",
89    ],
90    test_suites: ["general-tests"],
91}
92
93cc_test {
94    name: "binderLibTest",
95    defaults: ["binder_test_defaults"],
96    product_variables: {
97        binder32bit: {
98            cflags: ["-DBINDER_IPC_32BIT=1"],
99        },
100    },
101
102    srcs: ["binderLibTest.cpp"],
103    shared_libs: [
104        "libbinder",
105        "libutils",
106    ],
107    static_libs: [
108        "libgmock",
109    ],
110    test_suites: ["device-tests", "vts"],
111    require_root: true,
112}
113
114aidl_interface {
115    name: "binderRpcTestIface",
116    host_supported: true,
117    unstable: true,
118    srcs: [
119        "IBinderRpcSession.aidl",
120        "IBinderRpcTest.aidl",
121    ],
122    backend: {
123        java: {
124            enabled: false,
125        },
126    },
127}
128
129cc_test {
130    name: "binderRpcTest",
131    host_supported: true,
132    target: {
133        darwin: {
134            enabled: false,
135        },
136    },
137    defaults: [
138        "binder_test_defaults",
139        "libbinder_ndk_host_user",
140    ],
141
142    srcs: [
143        "binderRpcTest.cpp",
144    ],
145    shared_libs: [
146        "libbinder",
147        "libbinder_ndk",
148        "libbase",
149        "libutils",
150        "libcutils",
151        "liblog",
152    ],
153    static_libs: [
154        "binderRpcTestIface-cpp",
155        "binderRpcTestIface-ndk_platform",
156    ],
157    require_root: true,
158    // Prevent the unit test target from running on sc-dev as it's not ready.
159    test_options: {
160        unit_test: false,
161    },
162}
163
164cc_benchmark {
165    name: "binderRpcBenchmark",
166    defaults: ["binder_test_defaults"],
167    host_supported: true,
168    target: {
169        darwin: {
170            enabled: false,
171        },
172    },
173    srcs: [
174        "binderRpcBenchmark.cpp",
175        "IBinderRpcBenchmark.aidl",
176    ],
177    shared_libs: [
178        "libbase",
179        "libbinder",
180        "liblog",
181        "libutils",
182    ],
183}
184
185cc_test {
186    name: "binderThroughputTest",
187    defaults: ["binder_test_defaults"],
188    srcs: ["binderThroughputTest.cpp"],
189    shared_libs: [
190        "libbinder",
191        "libutils",
192    ],
193    clang: true,
194    cflags: [
195        "-g",
196        "-Wno-missing-field-initializers",
197        "-Wno-sign-compare",
198        "-O3",
199    ],
200}
201
202cc_test {
203    name: "binderTextOutputTest",
204    defaults: ["binder_test_defaults"],
205    srcs: ["binderTextOutputTest.cpp"],
206    shared_libs: [
207        "libbinder",
208        "libutils",
209        "libbase",
210    ],
211    test_suites: ["device-tests"],
212}
213
214cc_test {
215    name: "schd-dbg",
216    defaults: ["binder_test_defaults"],
217    srcs: ["schd-dbg.cpp"],
218    shared_libs: [
219        "libbinder",
220        "libutils",
221        "libbase",
222    ],
223}
224
225cc_test {
226    name: "binderSafeInterfaceTest",
227    defaults: ["binder_test_defaults"],
228    srcs: ["binderSafeInterfaceTest.cpp"],
229
230    cppflags: [
231        "-Wextra",
232    ],
233
234    cpp_std: "experimental",
235    gnu_extensions: false,
236
237    shared_libs: [
238        "libbinder",
239        "libcutils",
240        "liblog",
241        "libutils",
242    ],
243    test_suites: ["device-tests", "vts"],
244    require_root: true,
245}
246
247cc_test {
248    name: "binderClearBufTest",
249    defaults: ["binder_test_defaults"],
250    srcs: [
251        "binderClearBufTest.cpp",
252    ],
253
254    shared_libs: [
255        "libbase",
256        "libbinder",
257        "liblog",
258        "libutils",
259    ],
260
261    test_suites: ["general-tests"],
262    require_root: true,
263}
264
265aidl_interface {
266    name: "binderStabilityTestIface",
267    unstable: true,
268    srcs: [
269        "IBinderStabilityTest.aidl",
270    ],
271    backend: {
272        java: {
273            enabled: false,
274        },
275    },
276}
277
278cc_test {
279    name: "binderStabilityTest",
280    defaults: ["binder_test_defaults"],
281    srcs: [
282        "binderStabilityTest.cpp",
283    ],
284
285    // critical that libbinder/libbinder_ndk are shared for VTS
286    shared_libs: [
287        "libbinder_ndk",
288        "libbinder",
289        "liblog",
290        "libutils",
291    ],
292    static_libs: [
293        "binderStabilityTestIface-cpp",
294        "binderStabilityTestIface-ndk_platform",
295    ],
296
297    test_suites: ["device-tests", "vts"],
298    require_root: true,
299}
300
301cc_test {
302    name: "binderAllocationLimits",
303    defaults: ["binder_test_defaults"],
304    srcs: ["binderAllocationLimits.cpp"],
305    shared_libs: [
306        "libbinder",
307        "liblog",
308        "libutils",
309        "libutilscallstack",
310        "libbase",
311    ],
312    test_suites: ["device-tests"],
313    require_root: true,
314}
315
316cc_benchmark {
317    name: "binderParcelBenchmark",
318    defaults: ["binder_test_defaults"],
319    srcs: ["binderParcelBenchmark.cpp"],
320    shared_libs: [
321        "libbase",
322        "libbinder",
323        "liblog",
324        "libutils",
325    ],
326}
327