|  | # Copyright 2020 The Fuchsia Authors. All rights reserved. | 
|  | # Use of this source code is governed by a BSD-style license that can be | 
|  | # found in the LICENSE file. | 
|  |  | 
|  | import("//build/dart/test.gni") | 
|  | import("//build/rust/rustc_binary.gni") | 
|  | import("//build/testing/host_test_data.gni") | 
|  |  | 
|  | if (is_host) { | 
|  | rustc_binary("bin") { | 
|  | name = "zedmon" | 
|  | edition = "2018" | 
|  | with_unit_tests = true | 
|  |  | 
|  | deps = [ | 
|  | "//src/lib/fuchsia-async", | 
|  | "//src/lib/usb_bulk/rust:lib", | 
|  | "//third_party/rust_crates:anyhow", | 
|  | "//third_party/rust_crates:byteorder", | 
|  | "//third_party/rust_crates:clap", | 
|  | "//third_party/rust_crates:csv", | 
|  | "//third_party/rust_crates:futures", | 
|  | "//third_party/rust_crates:lazy_static", | 
|  | "//third_party/rust_crates:matches", | 
|  | "//third_party/rust_crates:num", | 
|  | "//third_party/rust_crates:num-derive", | 
|  | "//third_party/rust_crates:num-traits", | 
|  | "//third_party/rust_crates:regex", | 
|  | "//third_party/rust_crates:serde", | 
|  | "//third_party/rust_crates:serde_json", | 
|  | "//third_party/rust_crates:thiserror", | 
|  | ] | 
|  |  | 
|  | test_deps = [ "//src/lib/test_util" ] | 
|  |  | 
|  | sources = [ | 
|  | "src/lib.rs", | 
|  | "src/main.rs", | 
|  | "src/protocol.rs", | 
|  | ] | 
|  | } | 
|  | } | 
|  |  | 
|  | dart_test("zedmon_client_manual_test") { | 
|  | sources = [ "zedmon_client_manual_test.dart" ] | 
|  | deps = [ "//third_party/dart-pkg/pub/test" ] | 
|  | non_dart_deps = [ ":runtime_deps($host_toolchain)" ] | 
|  |  | 
|  | # This test should only be run manually for now. | 
|  | environments = [] | 
|  | } | 
|  |  | 
|  | if (is_host) { | 
|  | host_test_data("runtime_deps") { | 
|  | sources = [ "$root_out_dir/zedmon" ] | 
|  | outputs = [ "$target_gen_dir/runtime_deps/{{source_file_part}}" ] | 
|  |  | 
|  | deps = [ ":bin" ] | 
|  | } | 
|  | } | 
|  |  | 
|  | group("zedmon_client") { | 
|  | public_deps = [ ":bin($host_toolchain)" ] | 
|  | } | 
|  |  | 
|  | group("tests") { | 
|  | public_deps = [ | 
|  | ":bin_test($host_toolchain)", | 
|  | ":zedmon_client_manual_test($host_toolchain)", | 
|  | ] | 
|  | testonly = true | 
|  | } |