| # 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/test/test_package.gni") |
| import("//build/testing/environments.gni") |
| |
| rustc_binary("bin") { |
| name = "iquery" |
| with_unit_tests = true |
| edition = "2018" |
| |
| deps = [ |
| "//garnet/lib/rust/files_async", |
| "//garnet/lib/rust/io_util", |
| "//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics-rustc", |
| "//sdk/fidl/fuchsia.inspect:fuchsia.inspect-rustc", |
| "//sdk/fidl/fuchsia.inspect.deprecated:fuchsia.inspect.deprecated-rustc", |
| "//sdk/fidl/fuchsia.io:fuchsia.io-rustc", |
| "//sdk/fidl/fuchsia.sys:fuchsia.sys-rustc", |
| "//src/diagnostics/lib/inspect-fidl-load", |
| "//src/diagnostics/lib/selectors", |
| "//src/lib/diagnostics/data/rust", |
| "//src/lib/diagnostics/inspect/node-hierarchy/rust", |
| "//src/lib/diagnostics/inspect/rust", |
| "//src/lib/diagnostics/reader/rust", |
| "//src/lib/fdio/rust:fdio", |
| "//src/lib/fidl/rust/fidl", |
| "//src/lib/fuchsia-async", |
| "//src/lib/fuchsia-component", |
| "//src/lib/syslog/rust:syslog", |
| "//src/lib/zircon/rust:fuchsia-zircon", |
| "//third_party/rust_crates:anyhow", |
| "//third_party/rust_crates:argh", |
| "//third_party/rust_crates:async-trait", |
| "//third_party/rust_crates:derivative", |
| "//third_party/rust_crates:difference", |
| "//third_party/rust_crates:futures", |
| "//third_party/rust_crates:glob", |
| "//third_party/rust_crates:lazy_static", |
| "//third_party/rust_crates:matches", |
| "//third_party/rust_crates:nom", |
| "//third_party/rust_crates:num-traits", |
| "//third_party/rust_crates:pretty_assertions", |
| "//third_party/rust_crates:regex", |
| "//third_party/rust_crates:serde", |
| "//third_party/rust_crates:serde_json", |
| "//third_party/rust_crates:tempfile", |
| "//third_party/rust_crates:thiserror", |
| ] |
| |
| sources = [ |
| "src/command_line.rs", |
| "src/commands/list.rs", |
| "src/commands/list_files.rs", |
| "src/commands/mod.rs", |
| "src/commands/selectors.rs", |
| "src/commands/show.rs", |
| "src/commands/show_file.rs", |
| "src/commands/types.rs", |
| "src/commands/utils.rs", |
| "src/constants.rs", |
| "src/location.rs", |
| "src/main.rs", |
| "src/tests/commands.rs", |
| "src/tests/macros.rs", |
| "src/tests/mod.rs", |
| "src/tests/utils.rs", |
| "src/text_formatter.rs", |
| "src/types.rs", |
| ] |
| |
| inputs = [ |
| "test_data/list_test.json", |
| "test_data/list_no_dups.text", |
| "test_data/list_filter_manifest.text", |
| "test_data/show_all_test.json", |
| "test_data/list_test.text", |
| "test_data/list_with_url.text", |
| "test_data/show_file_vmo.text", |
| "test_data/list_files_cwd.json", |
| "test_data/list_files_cwd.text", |
| "test_data/list_with_url.json", |
| "test_data/selectors_test.json", |
| "test_data/show_all_test.text", |
| "test_data/show_filter_test.text", |
| "test_data/selectors_filter_test.text", |
| "test_data/show_file_test.text", |
| "test_data/show_file_test.json", |
| "test_data/show_test.json", |
| "test_data/selectors_test.text", |
| "test_data/show_file_vmo.json", |
| "test_data/list_files_test.json", |
| "test_data/list_no_dups.json", |
| "test_data/list_filter_manifest.json", |
| "test_data/show_test.text", |
| "test_data/show_filter_test.json", |
| "test_data/list_files_test.text", |
| "test_data/selectors_filter_test.json", |
| ] |
| } |
| |
| package("iquery") { |
| deps = [ ":bin" ] |
| |
| binaries = [ |
| { |
| name = "iquery" |
| shell = true |
| }, |
| ] |
| } |
| |
| test_package("iquery_tests") { |
| deps = [ |
| ":bin_test", |
| "test/basic_component:iquery_basic_component", |
| "test/test_component:bin", |
| ] |
| |
| binaries = [ |
| { |
| name = "iquery_basic_component" |
| }, |
| { |
| name = "iquery_test_component" |
| }, |
| ] |
| |
| tests = [ |
| { |
| name = "iquery_bin_test" |
| }, |
| ] |
| |
| meta = [ |
| { |
| path = rebase_path("meta/iquery_basic_component.cmx") |
| dest = "basic_component.cmx" |
| }, |
| { |
| path = rebase_path("meta/iquery_test_component.cmx") |
| dest = "test_component.cmx" |
| }, |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ ":iquery_tests" ] |
| } |