Loading system/gd/rust/facade/Android.bp +19 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,25 @@ rust_binary { ], } rust_test { name: "bluetooth_with_facades.test", defaults: ["gd_rust_defaults"], srcs: ["src/main.rs"], edition: "2018", rustlibs: [ "libclap", "libbluetooth_with_facades", "libfutures", "libgrpcio", "liblazy_static", "libtokio", "libnix", "libbt_common", "liblog_rust", ], test_suites: ["general-tests"], } rust_library { name: "libbt_facade_helpers", defaults: ["gd_rust_defaults"], Loading system/gd/rust/facade/src/main.rs +16 −3 Original line number Diff line number Diff line Loading @@ -19,8 +19,8 @@ fn main() { rt.block_on(async_main(Arc::clone(&rt), sigint)); } async fn async_main(rt: Arc<Runtime>, mut sigint: mpsc::UnboundedReceiver<()>) { let matches = Command::new("bluetooth_with_facades") fn clap_command() -> Command { Command::new("bluetooth_with_facades") .about("The bluetooth stack, with testing facades enabled and exposed via gRPC.") .arg( Arg::new("root-server-port") Loading @@ -44,7 +44,10 @@ async fn async_main(rt: Arc<Runtime>, mut sigint: mpsc::UnboundedReceiver<()>) { .arg(Arg::new("btsnoop").long("btsnoop")) .arg(Arg::new("btsnooz").long("btsnooz")) .arg(Arg::new("btconfig").long("btconfig")) .get_matches(); } async fn async_main(rt: Arc<Runtime>, mut sigint: mpsc::UnboundedReceiver<()>) { let matches = clap_command().get_matches(); let root_server_port = *matches.get_one::<u16>("root-server-port").unwrap(); let grpc_port = *matches.get_one::<u16>("grpc-port").unwrap(); Loading Loading @@ -95,3 +98,13 @@ extern "C" fn handle_sigint(_: i32) { } *sigint_tx = None; } #[cfg(test)] mod tests { use super::*; #[test] fn verify_comand() { clap_command().debug_assert(); } } system/gd/rust/topshim/facade/Android.bp +13 −2 Original line number Diff line number Diff line Loading @@ -7,8 +7,8 @@ package { default_applicable_licenses: ["system_bt_license"], } rust_binary_host { name: "bt_topshim_facade", rust_defaults { name: "bt_topshim_facade.defaults", defaults: [ "gd_rust_defaults", "libchrome_support_defaults" Loading Loading @@ -84,3 +84,14 @@ rust_binary_host { "libpaste", ], } rust_binary_host { name: "bt_topshim_facade", defaults: ["bt_topshim_facade.defaults"], } rust_test_host { name: "bt_topshim_facade.test", defaults: ["bt_topshim_facade.defaults"], test_suites: ["general-tests"], } system/gd/rust/topshim/facade/src/main.rs +16 −3 Original line number Diff line number Diff line Loading @@ -40,8 +40,8 @@ fn main() { rt.block_on(async_main(Arc::clone(&rt), sigint)); } async fn async_main(rt: Arc<Runtime>, mut sigint: mpsc::UnboundedReceiver<()>) { let matches = Command::new("bluetooth_topshim_facade") fn clap_command() -> Command { Command::new("bluetooth_topshim_facade") .about("The bluetooth topshim stack, with testing facades enabled and exposed via gRPC.") .arg( Arg::new("grpc-port") Loading Loading @@ -71,7 +71,10 @@ async fn async_main(rt: Arc<Runtime>, mut sigint: mpsc::UnboundedReceiver<()>) { .value_parser(value_parser!(bool)) .default_value("true"), ) .get_matches(); } async fn async_main(rt: Arc<Runtime>, mut sigint: mpsc::UnboundedReceiver<()>) { let matches = clap_command().get_matches(); let grpc_port = *matches.get_one::<u16>("grpc-port").unwrap(); let _rootcanal_port = matches.get_one::<u16>("rootcanal-port").cloned(); Loading Loading @@ -146,3 +149,13 @@ extern "C" fn handle_sigint(_: i32) { } *sigint_tx = None; } #[cfg(test)] mod tests { use super::*; #[test] fn verify_comand() { clap_command().debug_assert(); } } tools/pdl/src/main.rs +11 −0 Original line number Diff line number Diff line Loading @@ -83,3 +83,14 @@ fn main() -> std::process::ExitCode { } } } #[cfg(test)] mod tests { use super::*; use clap::CommandFactory; #[test] fn verify_opt() { Opt::command().debug_assert(); } } Loading
system/gd/rust/facade/Android.bp +19 −0 Original line number Diff line number Diff line Loading @@ -43,6 +43,25 @@ rust_binary { ], } rust_test { name: "bluetooth_with_facades.test", defaults: ["gd_rust_defaults"], srcs: ["src/main.rs"], edition: "2018", rustlibs: [ "libclap", "libbluetooth_with_facades", "libfutures", "libgrpcio", "liblazy_static", "libtokio", "libnix", "libbt_common", "liblog_rust", ], test_suites: ["general-tests"], } rust_library { name: "libbt_facade_helpers", defaults: ["gd_rust_defaults"], Loading
system/gd/rust/facade/src/main.rs +16 −3 Original line number Diff line number Diff line Loading @@ -19,8 +19,8 @@ fn main() { rt.block_on(async_main(Arc::clone(&rt), sigint)); } async fn async_main(rt: Arc<Runtime>, mut sigint: mpsc::UnboundedReceiver<()>) { let matches = Command::new("bluetooth_with_facades") fn clap_command() -> Command { Command::new("bluetooth_with_facades") .about("The bluetooth stack, with testing facades enabled and exposed via gRPC.") .arg( Arg::new("root-server-port") Loading @@ -44,7 +44,10 @@ async fn async_main(rt: Arc<Runtime>, mut sigint: mpsc::UnboundedReceiver<()>) { .arg(Arg::new("btsnoop").long("btsnoop")) .arg(Arg::new("btsnooz").long("btsnooz")) .arg(Arg::new("btconfig").long("btconfig")) .get_matches(); } async fn async_main(rt: Arc<Runtime>, mut sigint: mpsc::UnboundedReceiver<()>) { let matches = clap_command().get_matches(); let root_server_port = *matches.get_one::<u16>("root-server-port").unwrap(); let grpc_port = *matches.get_one::<u16>("grpc-port").unwrap(); Loading Loading @@ -95,3 +98,13 @@ extern "C" fn handle_sigint(_: i32) { } *sigint_tx = None; } #[cfg(test)] mod tests { use super::*; #[test] fn verify_comand() { clap_command().debug_assert(); } }
system/gd/rust/topshim/facade/Android.bp +13 −2 Original line number Diff line number Diff line Loading @@ -7,8 +7,8 @@ package { default_applicable_licenses: ["system_bt_license"], } rust_binary_host { name: "bt_topshim_facade", rust_defaults { name: "bt_topshim_facade.defaults", defaults: [ "gd_rust_defaults", "libchrome_support_defaults" Loading Loading @@ -84,3 +84,14 @@ rust_binary_host { "libpaste", ], } rust_binary_host { name: "bt_topshim_facade", defaults: ["bt_topshim_facade.defaults"], } rust_test_host { name: "bt_topshim_facade.test", defaults: ["bt_topshim_facade.defaults"], test_suites: ["general-tests"], }
system/gd/rust/topshim/facade/src/main.rs +16 −3 Original line number Diff line number Diff line Loading @@ -40,8 +40,8 @@ fn main() { rt.block_on(async_main(Arc::clone(&rt), sigint)); } async fn async_main(rt: Arc<Runtime>, mut sigint: mpsc::UnboundedReceiver<()>) { let matches = Command::new("bluetooth_topshim_facade") fn clap_command() -> Command { Command::new("bluetooth_topshim_facade") .about("The bluetooth topshim stack, with testing facades enabled and exposed via gRPC.") .arg( Arg::new("grpc-port") Loading Loading @@ -71,7 +71,10 @@ async fn async_main(rt: Arc<Runtime>, mut sigint: mpsc::UnboundedReceiver<()>) { .value_parser(value_parser!(bool)) .default_value("true"), ) .get_matches(); } async fn async_main(rt: Arc<Runtime>, mut sigint: mpsc::UnboundedReceiver<()>) { let matches = clap_command().get_matches(); let grpc_port = *matches.get_one::<u16>("grpc-port").unwrap(); let _rootcanal_port = matches.get_one::<u16>("rootcanal-port").cloned(); Loading Loading @@ -146,3 +149,13 @@ extern "C" fn handle_sigint(_: i32) { } *sigint_tx = None; } #[cfg(test)] mod tests { use super::*; #[test] fn verify_comand() { clap_command().debug_assert(); } }
tools/pdl/src/main.rs +11 −0 Original line number Diff line number Diff line Loading @@ -83,3 +83,14 @@ fn main() -> std::process::ExitCode { } } } #[cfg(test)] mod tests { use super::*; use clap::CommandFactory; #[test] fn verify_opt() { Opt::command().debug_assert(); } }