| # Copyright 2019 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/package.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/rust/rustc_test.gni") |
| import("//build/test/test_package.gni") |
| import("//build/testing/environments.gni") |
| |
| rustc_binary("dhcpd-cli-bin") { |
| edition = "2018" |
| |
| deps = [ |
| "//sdk/fidl/fuchsia.net:fuchsia.net-rustc", |
| "//sdk/fidl/fuchsia.net.dhcp:fuchsia.net.dhcp-rustc", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/network/fidl_fuchsia_hardware_ethernet_ext", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| sources = [ |
| "src/args.rs", |
| "src/main.rs", |
| ] |
| } |
| |
| rustc_test("dhcpd-cli-test") { |
| edition = "2018" |
| deps = [ |
| "//sdk/fidl/fuchsia.net.dhcp:fuchsia.net.dhcp-rustc", |
| "//sdk/fidl/fuchsia.posix.socket:fuchsia.posix.socket-rustc", |
| "//sdk/fidl/fuchsia.stash:fuchsia.stash-rustc", |
| "//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//third_party/rust_crates:futures", |
| ] |
| |
| sources = [ "src/lib.rs" ] |
| } |
| |
| package("dhcpd-cli") { |
| deps = [ ":dhcpd-cli-bin" ] |
| binaries = [ |
| { |
| name = "dhcpd_cli_bin" |
| dest = "dhcpd-cli" |
| shell = true |
| }, |
| ] |
| meta = [ |
| { |
| path = rebase_path("meta/dhcpd-cli.cmx") |
| dest = "dhcpd-cli.cmx" |
| }, |
| ] |
| } |
| |
| test_package("dhcpd-cli-tests") { |
| deps = [ ":dhcpd-cli-test" ] |
| |
| tests = [ |
| { |
| name = "dhcpd_cli_test" |
| environments = [ emu_env ] |
| }, |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":dhcpd-cli", |
| ":dhcpd-cli-tests", |
| "//src/connectivity/network/dhcp:dhcpd-testing", |
| ] |
| } |