blob: 607860f4626af3309972c4ef85f978ba28afec77 [file] [log] [blame]
Bob Badour3c538232021-02-12 21:26:48 -08001package {
2 // See: http://go/android-license-faq
3 // A large-scale-change added 'default_applicable_licenses' to import
4 // all of the 'license_kinds' from "frameworks_native_license"
5 // to get the below license kinds:
6 // SPDX-license-identifier-Apache-2.0
7 default_applicable_licenses: ["frameworks_native_license"],
8}
9
Stephen Crane2a3c2502020-06-16 17:48:35 -070010rust_test {
11 name: "rustBinderTest",
12 srcs: ["integration.rs"],
13 rustlibs: [
14 "libbinder_rs",
Janis Danisevskis798a09a2020-08-18 08:35:38 -070015 "libselinux_bindgen",
16 ],
17 shared_libs: [
18 "libselinux",
Stephen Crane2a3c2502020-06-16 17:48:35 -070019 ],
20 // For the binaries to be pushed properly as specified in AndroidTest.xml,
21 // this cannot be the same as the module name.
22 stem: "rustBinderTestClientBinary",
23 test_suites: ["general-tests"],
24}
25
26rust_test {
27 name: "rustBinderTestService",
28 srcs: ["integration.rs"],
29 rustlibs: [
30 "libbinder_rs",
31 "liblibc",
32 ],
33 // For the binaries to be pushed properly as specified in AndroidTest.xml,
34 // this cannot be the same as the module name.
35 stem: "rustBinderTestServiceBinary",
36 test_harness: false,
Dan Shif80ad1a2020-08-14 12:51:32 -070037 // TODO(b/164473602): Remove this setting and add the module to `data`
38 // attribute of rustBinderTest.
39 auto_gen_config: false,
40 test_suites: ["general-tests"],
Stephen Crane2a3c2502020-06-16 17:48:35 -070041}
Stephen Crane669deb62020-09-10 17:31:39 -070042
43cc_test {
44 name: "binderRustNdkInteropTest",
45 srcs: [
46 "binderRustNdkInteropTest.cpp",
47 ],
48 shared_libs: [
49 "libbinder",
50 "libbinder_ndk",
51 ],
52 static_libs: [
53 "IBinderRustNdkInteropTest-ndk_platform",
54 "libbinder_ndk_rust_interop",
55 ],
56 test_suites: ["general-tests"],
57 require_root: true,
58
59 // rustBinderTestService uses a custom config
60 auto_gen_config: true,
61}
62
63aidl_interface {
64 name: "IBinderRustNdkInteropTest",
65 unstable: true,
66 srcs: [
67 "IBinderRustNdkInteropTest.aidl",
68 "IBinderRustNdkInteropTestOther.aidl",
69 ],
70 backend: {
71 ndk: {
72 enabled: true,
73 },
74 rust: {
75 enabled: true,
76 },
77 },
78}
79
80rust_ffi_static {
81 name: "libbinder_ndk_rust_interop",
82 crate_name: "binder_ndk_rust_interop",
83 srcs: [
84 "ndk_rust_interop.rs",
85 ],
86 rustlibs: [
87 "libbinder_rs",
88 "IBinderRustNdkInteropTest-rust",
89 ],
90}
Stephen Craned58bce02020-07-07 12:26:02 -070091
92cc_test {
93 name: "rustBinderSerializationTest",
94 shared_libs: [
95 "libbinder",
96 "libbinder_ndk",
97 "libutils",
98 "libbase",
99 ],
100 static_libs: [
101 "libbinder_rs_serialization_test"
102 ],
103 srcs: [
104 "serialization.cpp",
105 ],
106 auto_gen_config: true,
107 test_suites: ["general-tests"],
108}
109
110rust_bindgen {
111 name: "libbinder_rs_serialization_bindgen",
112 crate_name: "binder_rs_serialization_bindgen",
113 wrapper_src: "serialization.hpp",
114 source_stem: "bindings",
115 cpp_std: "gnu++17",
116 bindgen_flags: [
Joel Galenson6ad53242021-04-19 09:39:12 -0700117 "--allowlist-type", "Transaction",
118 "--allowlist-var", "TESTDATA_.*",
Stephen Craned58bce02020-07-07 12:26:02 -0700119 ],
120
121 shared_libs: [
122 "libbinder",
123 "libc++",
124 ],
125}
126
127rust_ffi_static {
128 name: "libbinder_rs_serialization_test",
129 crate_name: "binder_rs_serialization_test",
130 srcs: [
131 "serialization.rs",
132 ":libbinder_rs_serialization_bindgen",
133 ],
134 rustlibs: [
135 "libbinder_rs",
136 ],
137}