blob: 502e2e661c2348d703493e92b8ac5a24e10443e9 [file] [log] [blame]
# Copyright 2018 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/components.gni")
import("//build/rust/rustc_library.gni")
import("//build/rust/rustc_staticlib.gni")
import("//build/testing/environments.gni")
rustc_library("fuchsia") {
name = "fuchsia"
edition = "2021"
deps = [
"macro",
"//sdk/fidl/fuchsia.diagnostics:fuchsia.diagnostics_rust",
"//src/lib/fuchsia-async",
"//third_party/rust_crates:argh",
]
sources = [ "src/lib.rs" ]
if (is_fuchsia) {
deps += [
"//src/lib/diagnostics/log/rust",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:tracing",
]
} else {
sources += [
"src/host/logger.rs",
"src/host/mod.rs",
]
deps += [
"//third_party/rust_crates:tracing",
"//third_party/rust_crates:tracing-log",
"//third_party/rust_crates:tracing-subscriber",
]
}
}
rustc_test("fuchsia_test") {
name = "fuchsia_test"
edition = "2021"
deps = [
":fuchsia",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:argh",
]
source_root = "src/test.rs"
sources = [ "src/test.rs" ]
}
fuchsia_unittest_package("fuchsia-tests") {
deps = [ ":fuchsia_test" ]
test_specs = {
environments = [ emu_env ]
}
}
group("tests") {
testonly = true
deps = [
":fuchsia-tests",
":fuchsia_test($host_toolchain)",
"tests",
]
}