Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 50b5acda authored by David Duarte's avatar David Duarte Committed by Martin Geisler
Browse files

Revert "Add tests to verify clap command."

This reverts commit f64fd0879978209a555f81d8df69652e5b9acf2e.

Change-Id: I5c81c071e4abf03ec0a9b8219e00f1b3bd97daf6
Merged-In: I23fa9220208afa9e0832f94b1a25d3f13dd40d00
Test: m
Tag: #refactor
Bug: 228306436
parent 482fad05
Loading
Loading
Loading
Loading
+0 −19
Original line number Diff line number Diff line
@@ -42,25 +42,6 @@ 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"],
+3 −16
Original line number Diff line number Diff line
@@ -19,8 +19,8 @@ fn main() {
    rt.block_on(async_main(Arc::clone(&rt), sigint));
}

fn clap_command() -> Command {
    Command::new("bluetooth_with_facades")
async fn async_main(rt: Arc<Runtime>, mut sigint: mpsc::UnboundedReceiver<()>) {
    let matches = Command::new("bluetooth_with_facades")
        .about("The bluetooth stack, with testing facades enabled and exposed via gRPC.")
        .arg(
            Arg::new("root-server-port")
@@ -44,10 +44,7 @@ fn clap_command() -> Command {
        .arg(Arg::new("btsnoop").long("btsnoop"))
        .arg(Arg::new("btsnooz").long("btsnooz"))
        .arg(Arg::new("btconfig").long("btconfig"))
}

async fn async_main(rt: Arc<Runtime>, mut sigint: mpsc::UnboundedReceiver<()>) {
    let matches = clap_command().get_matches();
        .get_matches();

    let root_server_port = *matches.get_one::<u16>("root-server-port").unwrap();
    let grpc_port = *matches.get_one::<u16>("grpc-port").unwrap();
@@ -98,13 +95,3 @@ extern "C" fn handle_sigint(_: i32) {
    }
    *sigint_tx = None;
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn verify_comand() {
        clap_command().debug_assert();
    }
}
+2 −13
Original line number Diff line number Diff line
@@ -7,8 +7,8 @@ package {
    default_applicable_licenses: ["system_bt_license"],
}

rust_defaults {
    name: "bt_topshim_facade.defaults",
rust_binary_host {
    name: "bt_topshim_facade",
    defaults: [
        "gd_rust_defaults",
        "libchrome_support_defaults"
@@ -78,14 +78,3 @@ rust_defaults {
        "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"],
}
+3 −16
Original line number Diff line number Diff line
@@ -35,8 +35,8 @@ fn main() {
    rt.block_on(async_main(Arc::clone(&rt), sigint));
}

fn clap_command() -> Command {
    Command::new("bluetooth_topshim_facade")
async fn async_main(rt: Arc<Runtime>, mut sigint: mpsc::UnboundedReceiver<()>) {
    let matches = Command::new("bluetooth_topshim_facade")
        .about("The bluetooth topshim stack, with testing facades enabled and exposed via gRPC.")
        .arg(
            Arg::new("grpc-port")
@@ -66,10 +66,7 @@ fn clap_command() -> Command {
                .value_parser(value_parser!(bool))
                .default_value("true"),
        )
}

async fn async_main(rt: Arc<Runtime>, mut sigint: mpsc::UnboundedReceiver<()>) {
    let matches = clap_command().get_matches();
        .get_matches();

    let grpc_port = *matches.get_one::<u16>("grpc-port").unwrap();
    let _rootcanal_port = matches.get_one::<u16>("rootcanal-port").cloned();
@@ -130,13 +127,3 @@ extern "C" fn handle_sigint(_: i32) {
    }
    *sigint_tx = None;
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn verify_comand() {
        clap_command().debug_assert();
    }
}
+0 −11
Original line number Diff line number Diff line
@@ -104,14 +104,3 @@ fn main() -> Result<(), String> {
        }
    }
}

#[cfg(test)]
mod tests {
    use super::*;
    use clap::CommandFactory;

    #[test]
    fn verify_opt() {
        Opt::command().debug_assert();
    }
}