| Bob Badour | 3c53823 | 2021-02-12 21:26:48 -0800 | [diff] [blame] | 1 | package { | 
|  | 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 Crane | 2a3c250 | 2020-06-16 17:48:35 -0700 | [diff] [blame] | 10 | rust_test { | 
|  | 11 | name: "rustBinderTest", | 
|  | 12 | srcs: ["integration.rs"], | 
|  | 13 | rustlibs: [ | 
|  | 14 | "libbinder_rs", | 
| Janis Danisevskis | 798a09a | 2020-08-18 08:35:38 -0700 | [diff] [blame] | 15 | "libselinux_bindgen", | 
| Alice Ryhl | 05f5a2c | 2021-09-15 12:56:10 +0000 | [diff] [blame] | 16 | "libbinder_tokio_rs", | 
|  | 17 | "libtokio", | 
| Janis Danisevskis | 798a09a | 2020-08-18 08:35:38 -0700 | [diff] [blame] | 18 | ], | 
|  | 19 | shared_libs: [ | 
|  | 20 | "libselinux", | 
| Stephen Crane | 2a3c250 | 2020-06-16 17:48:35 -0700 | [diff] [blame] | 21 | ], | 
|  | 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"], | 
|  | 26 | } | 
|  | 27 |  | 
|  | 28 | rust_test { | 
|  | 29 | name: "rustBinderTestService", | 
|  | 30 | srcs: ["integration.rs"], | 
|  | 31 | rustlibs: [ | 
|  | 32 | "libbinder_rs", | 
|  | 33 | "liblibc", | 
|  | 34 | ], | 
|  | 35 | // For the binaries to be pushed properly as specified in AndroidTest.xml, | 
|  | 36 | // this cannot be the same as the module name. | 
|  | 37 | stem: "rustBinderTestServiceBinary", | 
|  | 38 | test_harness: false, | 
| Dan Shi | f80ad1a | 2020-08-14 12:51:32 -0700 | [diff] [blame] | 39 | // TODO(b/164473602): Remove this setting and add the module to `data` | 
|  | 40 | // attribute of rustBinderTest. | 
|  | 41 | auto_gen_config: false, | 
|  | 42 | test_suites: ["general-tests"], | 
| Stephen Crane | 2a3c250 | 2020-06-16 17:48:35 -0700 | [diff] [blame] | 43 | } | 
| Stephen Crane | 669deb6 | 2020-09-10 17:31:39 -0700 | [diff] [blame] | 44 |  | 
|  | 45 | cc_test { | 
|  | 46 | name: "binderRustNdkInteropTest", | 
|  | 47 | srcs: [ | 
|  | 48 | "binderRustNdkInteropTest.cpp", | 
|  | 49 | ], | 
|  | 50 | shared_libs: [ | 
|  | 51 | "libbinder", | 
|  | 52 | "libbinder_ndk", | 
|  | 53 | ], | 
|  | 54 | static_libs: [ | 
| Jiyong Park | 9a9427c | 2021-08-09 09:01:15 +0900 | [diff] [blame] | 55 | "IBinderRustNdkInteropTest-ndk", | 
| Stephen Crane | 669deb6 | 2020-09-10 17:31:39 -0700 | [diff] [blame] | 56 | "libbinder_ndk_rust_interop", | 
|  | 57 | ], | 
|  | 58 | test_suites: ["general-tests"], | 
|  | 59 | require_root: true, | 
|  | 60 |  | 
|  | 61 | // rustBinderTestService uses a custom config | 
|  | 62 | auto_gen_config: true, | 
|  | 63 | } | 
|  | 64 |  | 
|  | 65 | aidl_interface { | 
|  | 66 | name: "IBinderRustNdkInteropTest", | 
|  | 67 | unstable: true, | 
|  | 68 | srcs: [ | 
|  | 69 | "IBinderRustNdkInteropTest.aidl", | 
|  | 70 | "IBinderRustNdkInteropTestOther.aidl", | 
|  | 71 | ], | 
|  | 72 | backend: { | 
|  | 73 | ndk: { | 
|  | 74 | enabled: true, | 
|  | 75 | }, | 
|  | 76 | rust: { | 
|  | 77 | enabled: true, | 
|  | 78 | }, | 
|  | 79 | }, | 
|  | 80 | } | 
|  | 81 |  | 
|  | 82 | rust_ffi_static { | 
|  | 83 | name: "libbinder_ndk_rust_interop", | 
|  | 84 | crate_name: "binder_ndk_rust_interop", | 
|  | 85 | srcs: [ | 
|  | 86 | "ndk_rust_interop.rs", | 
|  | 87 | ], | 
|  | 88 | rustlibs: [ | 
|  | 89 | "libbinder_rs", | 
|  | 90 | "IBinderRustNdkInteropTest-rust", | 
|  | 91 | ], | 
|  | 92 | } | 
| Stephen Crane | d58bce0 | 2020-07-07 12:26:02 -0700 | [diff] [blame] | 93 |  | 
|  | 94 | cc_test { | 
|  | 95 | name: "rustBinderSerializationTest", | 
|  | 96 | shared_libs: [ | 
|  | 97 | "libbinder", | 
|  | 98 | "libbinder_ndk", | 
|  | 99 | "libutils", | 
|  | 100 | "libbase", | 
|  | 101 | ], | 
|  | 102 | static_libs: [ | 
|  | 103 | "libbinder_rs_serialization_test" | 
|  | 104 | ], | 
|  | 105 | srcs: [ | 
|  | 106 | "serialization.cpp", | 
|  | 107 | ], | 
|  | 108 | auto_gen_config: true, | 
|  | 109 | test_suites: ["general-tests"], | 
|  | 110 | } | 
|  | 111 |  | 
|  | 112 | rust_bindgen { | 
|  | 113 | name: "libbinder_rs_serialization_bindgen", | 
|  | 114 | crate_name: "binder_rs_serialization_bindgen", | 
|  | 115 | wrapper_src: "serialization.hpp", | 
|  | 116 | source_stem: "bindings", | 
|  | 117 | cpp_std: "gnu++17", | 
|  | 118 | bindgen_flags: [ | 
| Joel Galenson | 6ad5324 | 2021-04-19 09:39:12 -0700 | [diff] [blame] | 119 | "--allowlist-type", "Transaction", | 
|  | 120 | "--allowlist-var", "TESTDATA_.*", | 
| Stephen Crane | d58bce0 | 2020-07-07 12:26:02 -0700 | [diff] [blame] | 121 | ], | 
|  | 122 |  | 
|  | 123 | shared_libs: [ | 
|  | 124 | "libbinder", | 
|  | 125 | "libc++", | 
|  | 126 | ], | 
|  | 127 | } | 
|  | 128 |  | 
|  | 129 | rust_ffi_static { | 
|  | 130 | name: "libbinder_rs_serialization_test", | 
|  | 131 | crate_name: "binder_rs_serialization_test", | 
|  | 132 | srcs: [ | 
|  | 133 | "serialization.rs", | 
|  | 134 | ":libbinder_rs_serialization_bindgen", | 
|  | 135 | ], | 
|  | 136 | rustlibs: [ | 
|  | 137 | "libbinder_rs", | 
|  | 138 | ], | 
|  | 139 | } |