blob: 847b91e23cc05601a42ac6c328d9e6e50bbe19eb [file] [log] [blame]
# Copyright 2021 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/host.gni")
import("//build/rust/rustc_binary.gni")
if (is_host) {
rustc_binary("bin") {
name = "testgen"
edition = "2018"
with_unit_tests = true
test_environments = [ host_env ]
deps = [
"//sdk/fidl/fuchsia.sys2:fuchsia.sys2-rustc",
"//src/lib/fidl/rust/fidl",
"//src/sys/lib/cm_rust",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:argh",
"//third_party/rust_crates:chrono",
"//third_party/rust_crates:regex",
]
source_root = "src/main.rs"
sources = [
"src/args.rs",
"src/cm_parser.rs",
"src/generate_build.rs",
"src/generate_cpp_test.rs",
"src/generate_manifest.rs",
"src/generate_rust_test.rs",
"src/main.rs",
"src/test_code.rs",
]
inputs = [
"src/templates/template_rust_manifest",
"src/templates/template_rust_BUILD",
"src/templates/template_rust_mock_function",
"src/templates/template_rust_test_function",
"src/templates/template_cpp_mock_function",
"src/templates/template_cpp_test_function",
"src/templates/template_cpp_manifest",
"src/templates/template_cpp_BUILD",
]
}
install_host_tools("host") {
deps = [ ":bin" ]
outputs = [ "testgen" ]
}
}
group("tests") {
testonly = true
deps = [ ":bin_test($host_toolchain)" ]
# coverage builders injects extra capabilities to the components-under-test,
# see fxbug.dev/84878, this causes the generated code to be different.
if (!is_coverage) {
deps += [ "//tools/testgen/goldentest:tests" ]
}
}