blob: db7372d3df1ab3acd05671320ad895a4fde59a88 [file] [log] [blame]
# Copyright 2024 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_test.gni")
common_sources = [ "src/lib.rs" ]
common_deps = [
":cpp_syslog_wrapper",
"//third_party/rust_crates:log",
]
rustc_library("rust_cpp_bridge") {
name = "logging_rust_cpp_bridge"
edition = "2021"
sources = common_sources
deps = common_deps
}
source_set("cpp_syslog_wrapper") {
sources = [ "wrapper.cc" ]
deps = [ "//sdk/lib/syslog/cpp" ]
}
rustc_test("logging_rust_cpp_bridge_test") {
edition = "2021"
sources = common_sources
deps = common_deps + [
":cpp_syslog_test_wrapper",
"//src/lib/diagnostics/reader/rust",
"//src/lib/fuchsia",
"//third_party/rust_crates:futures",
]
configs += [
"//build/config/fuchsia:static_cpp_standard_library",
"//build/config/zircon:static-libc++",
]
}
source_set("cpp_syslog_test_wrapper") {
sources = [ "test_wrapper.cc" ]
deps = [ "//sdk/lib/syslog/cpp" ]
}
fuchsia_unittest_package("logging_rust_cpp_bridge_tests") {
manifest = "meta/tests.cml"
deps = [ ":logging_rust_cpp_bridge_test" ]
# These tests use a single instance of archivist, and since they set
# up conflicting test cases, they can not run in parallel.
test_specs = {
parallel = 1
log_settings = {
# These tests intentionally generate error messages.
max_severity = "ERROR"
}
}
}
group("tests") {
testonly = true
deps = [ ":logging_rust_cpp_bridge_tests($default_toolchain)" ]
}