1// 2// Copyright (C) 2016 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 default_applicable_licenses: ["Android-Apache-2.0"], 19} 20 21python_test_host { 22 name: "fmq_test", 23 main: "fmq_test.py", 24 srcs: ["fmq_test.py"], 25 test_config: "fmq_test.xml", 26 data_device_bins_both: [ 27 "android.hardware.tests.msgq@1.0-service-test", 28 "android.hardware.tests.msgq@1.0-rust-service-test", 29 "fmq_test_client", 30 "fmq_rust_test_client", 31 ], 32 test_suites: [ 33 "general-tests", 34 "vts", 35 ], 36 test_options: { 37 unit_test: false, 38 }, 39} 40 41rust_test { 42 name: "fmq_rust_test_client", 43 team: "trendy_team_android_kernel", 44 srcs: ["msgq_rust_test_client.rs"], 45 crate_name: "fmq_rust_test_client", 46 rustlibs: [ 47 "android.fmq.test-rust", 48 "android.hardware.common.fmq-V1-rust", 49 "libbinder_rs", 50 "libfmq_rust", 51 "liblibc", 52 ], 53 shared_libs: [ 54 "libutils", 55 "libcutils", 56 "libbase", 57 "libfmq", 58 ], 59 compile_multilib: "both", 60 multilib: { 61 lib32: { 62 suffix: "32", 63 }, 64 lib64: { 65 suffix: "64", 66 }, 67 }, 68 test_suites: [ 69 "general-tests", 70 "vts", 71 ], 72 auto_gen_config: false, 73} 74 75cc_test { 76 name: "fmq_test_client", 77 tidy_timeout_srcs: ["msgq_test_client.cpp"], 78 srcs: ["msgq_test_client.cpp"], 79 // This cc_test is used through the python test and won't support isolated 80 isolated: false, 81 cflags: [ 82 "-Wall", 83 "-Werror", 84 ], 85 sanitize: { 86 misc_undefined: ["integer"], 87 }, 88 89 shared_libs: [ 90 "libbase", 91 "libcutils", 92 "libfmq", 93 "libhidlbase", 94 "liblog", 95 "libutils", 96 "libbinder_ndk", 97 ], 98 99 // These are static libs only for testing purposes and portability. Shared 100 // libs should be used on device. 101 static_libs: [ 102 "android.hardware.common-V2-ndk", 103 "android.hardware.common.fmq-V1-ndk", 104 "android.hardware.tests.msgq@1.0", 105 "android.fmq.test-ndk", 106 ], 107 whole_static_libs: [ 108 "android.hardware.tests.msgq@1.0-impl", 109 "android.fmq.test-impl", 110 ], 111 112 compile_multilib: "both", 113 multilib: { 114 lib32: { 115 suffix: "32", 116 }, 117 lib64: { 118 suffix: "64", 119 }, 120 }, 121 test_suites: [ 122 "general-tests", 123 "vts", 124 ], 125 auto_gen_config: false, 126} 127 128// C++-usable FFI library so we can test the Rust wrapper against C++ clients 129rust_ffi_static { 130 name: "libfmq_rust_test", 131 host_supported: true, 132 crate_name: "fmq_rust_test", 133 srcs: ["fmq_test.rs"], 134 edition: "2021", 135 shared_libs: [ 136 "libbase", 137 "liblog", 138 "libcutils", 139 "libfmq", 140 "android.hardware.common.fmq-V1-ndk", 141 ], 142 rustlibs: [ 143 "libfmq_rust", 144 "android.hardware.common.fmq-V1-rust", 145 ], 146 proc_macros: [], 147} 148 149cc_test { 150 name: "fmq_unit_tests", 151 host_supported: true, 152 153 tidy_timeout_srcs: ["fmq_unit_tests.cpp"], 154 srcs: ["fmq_unit_tests.cpp"], 155 shared_libs: [ 156 "libbase", 157 "libcutils", 158 "libfmq", 159 "libhidlbase", 160 "liblog", 161 "libutils", 162 ], 163 static_libs: [ 164 "android.hardware.common.fmq-V1-ndk", 165 "libfmq_rust_test", 166 ], 167 168 cflags: [ 169 "-Wall", 170 "-Werror", 171 ], 172 sanitize: { 173 misc_undefined: ["integer"], 174 }, 175 test_suites: ["general-tests"], 176 auto_gen_config: true, 177} 178