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", |
| 16 | ], |
| 17 | shared_libs: [ |
| 18 | "libselinux", |
Stephen Crane | 2a3c250 | 2020-06-16 17:48:35 -0700 | [diff] [blame] | 19 | ], |
| 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 | |
| 26 | rust_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 Shi | f80ad1a | 2020-08-14 12:51:32 -0700 | [diff] [blame] | 37 | // 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 Crane | 2a3c250 | 2020-06-16 17:48:35 -0700 | [diff] [blame] | 41 | } |
Stephen Crane | 669deb6 | 2020-09-10 17:31:39 -0700 | [diff] [blame] | 42 | |
| 43 | cc_test { |
| 44 | name: "binderRustNdkInteropTest", |
| 45 | srcs: [ |
| 46 | "binderRustNdkInteropTest.cpp", |
| 47 | ], |
| 48 | shared_libs: [ |
| 49 | "libbinder", |
| 50 | "libbinder_ndk", |
| 51 | ], |
| 52 | static_libs: [ |
Jiyong Park | 9a9427c | 2021-08-09 09:01:15 +0900 | [diff] [blame^] | 53 | "IBinderRustNdkInteropTest-ndk", |
Stephen Crane | 669deb6 | 2020-09-10 17:31:39 -0700 | [diff] [blame] | 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 | |
| 63 | aidl_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 | |
| 80 | rust_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 Crane | d58bce0 | 2020-07-07 12:26:02 -0700 | [diff] [blame] | 91 | |
| 92 | cc_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 | |
| 110 | rust_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 Galenson | 6ad5324 | 2021-04-19 09:39:12 -0700 | [diff] [blame] | 117 | "--allowlist-type", "Transaction", |
| 118 | "--allowlist-var", "TESTDATA_.*", |
Stephen Crane | d58bce0 | 2020-07-07 12:26:02 -0700 | [diff] [blame] | 119 | ], |
| 120 | |
| 121 | shared_libs: [ |
| 122 | "libbinder", |
| 123 | "libc++", |
| 124 | ], |
| 125 | } |
| 126 | |
| 127 | rust_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 | } |