blob: 1c875c03751ff23bacc97d3552a069de5493661d [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",
Alice Ryhl05f5a2c2021-09-15 12:56:10 +000016 "libbinder_tokio_rs",
17 "libtokio",
Janis Danisevskis798a09a2020-08-18 08:35:38 -070018 ],
19 shared_libs: [
20 "libselinux",
Stephen Crane2a3c2502020-06-16 17:48:35 -070021 ],
22 // For the binaries to be pushed properly as specified in AndroidTest.xml,
23 // this cannot be the same as the module name.
24 stem: "rustBinderTestClientBinary",
25 test_suites: ["general-tests"],
jahinimtiaz67455742023-04-06 22:14:33 +000026 data: [
27 ":rustBinderTestService",
28 ],
Stephen Crane2a3c2502020-06-16 17:48:35 -070029}
30
31rust_test {
32 name: "rustBinderTestService",
33 srcs: ["integration.rs"],
34 rustlibs: [
35 "libbinder_rs",
36 "liblibc",
37 ],
38 // For the binaries to be pushed properly as specified in AndroidTest.xml,
39 // this cannot be the same as the module name.
40 stem: "rustBinderTestServiceBinary",
41 test_harness: false,
Stephen Crane2a3c2502020-06-16 17:48:35 -070042}
Stephen Crane669deb62020-09-10 17:31:39 -070043
44cc_test {
45 name: "binderRustNdkInteropTest",
46 srcs: [
47 "binderRustNdkInteropTest.cpp",
48 ],
49 shared_libs: [
50 "libbinder",
51 "libbinder_ndk",
52 ],
53 static_libs: [
Jiyong Park9a9427c2021-08-09 09:01:15 +090054 "IBinderRustNdkInteropTest-ndk",
Stephen Crane669deb62020-09-10 17:31:39 -070055 "libbinder_ndk_rust_interop",
56 ],
57 test_suites: ["general-tests"],
58 require_root: true,
59
60 // rustBinderTestService uses a custom config
61 auto_gen_config: true,
62}
63
64aidl_interface {
65 name: "IBinderRustNdkInteropTest",
66 unstable: true,
67 srcs: [
68 "IBinderRustNdkInteropTest.aidl",
69 "IBinderRustNdkInteropTestOther.aidl",
70 ],
71 backend: {
72 ndk: {
73 enabled: true,
74 },
75 rust: {
76 enabled: true,
77 },
78 },
79}
80
81rust_ffi_static {
82 name: "libbinder_ndk_rust_interop",
83 crate_name: "binder_ndk_rust_interop",
84 srcs: [
85 "ndk_rust_interop.rs",
86 ],
87 rustlibs: [
88 "libbinder_rs",
89 "IBinderRustNdkInteropTest-rust",
90 ],
91}
Stephen Craned58bce02020-07-07 12:26:02 -070092
93cc_test {
94 name: "rustBinderSerializationTest",
95 shared_libs: [
96 "libbinder",
97 "libbinder_ndk",
98 "libutils",
99 "libbase",
100 ],
101 static_libs: [
jahinimtiaz67455742023-04-06 22:14:33 +0000102 "libbinder_rs_serialization_test",
Stephen Craned58bce02020-07-07 12:26:02 -0700103 ],
104 srcs: [
105 "serialization.cpp",
106 ],
107 auto_gen_config: true,
108 test_suites: ["general-tests"],
109}
110
111rust_bindgen {
112 name: "libbinder_rs_serialization_bindgen",
113 crate_name: "binder_rs_serialization_bindgen",
114 wrapper_src: "serialization.hpp",
115 source_stem: "bindings",
116 cpp_std: "gnu++17",
117 bindgen_flags: [
jahinimtiaz67455742023-04-06 22:14:33 +0000118 "--allowlist-type",
119 "Transaction",
120 "--allowlist-var",
121 "TESTDATA_.*",
Stephen Craned58bce02020-07-07 12:26:02 -0700122 ],
123
124 shared_libs: [
125 "libbinder",
126 "libc++",
127 ],
128}
129
130rust_ffi_static {
131 name: "libbinder_rs_serialization_test",
132 crate_name: "binder_rs_serialization_test",
133 srcs: [
134 "serialization.rs",
135 ":libbinder_rs_serialization_bindgen",
136 ],
137 rustlibs: [
138 "libbinder_rs",
139 ],
140}