blob: 7f85f947feb7d4361f7e0ff12b3c6e9b11900afc [file] [log] [blame]
# Copyright 2017 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/rust/rustc_binary.gni")
import("//build/rust/rustc_library.gni")
import("//build/rust/rustc_test.gni")
import("//build/test/test_package.gni")
import("//build/testing/environments.gni")
rustc_library("fuchsia-zircon") {
assert(is_fuchsia)
version = "0.3.3"
edition = "2018"
deps = [
"fuchsia-zircon-sys",
"//third_party/rust_crates:bitflags",
"//third_party/rust_crates:failure",
]
}
# Certain unit tests for fuchsia-zircon need dependencies which can't be added
# to the main library's without causing circular dependencies. Only the test
# artifact is used, not the main artifact.
# TODO: If we add test-only deps to rustc_artifact, this can merge back in.
rustc_test("fuchsia-zircon-unittest") {
edition = "2018"
deps = [
"fuchsia-zircon-sys",
"//third_party/rust_crates:bitflags",
"//third_party/rust_crates:failure",
# Test-only deps
":fuchsia-zircon",
"//garnet/public/rust/fdio",
"//garnet/public/rust/fuchsia-runtime",
]
}
rustc_binary("exit_with_code_util") {
edition = "2018"
source_root = "test_util/exit_with_code_util.rs"
deps = [
":fuchsia-zircon",
]
}
rustc_binary("sleep_forever_util") {
edition = "2018"
source_root = "test_util/sleep_forever_util.rs"
deps = [
":fuchsia-zircon",
]
}
test_package("fuchsia-zircon-tests") {
deps = [
":exit_with_code_util",
":fuchsia-zircon-unittest",
":sleep_forever_util",
]
tests = [
{
name = "fuchsia_zircon_unittest"
dest = "fuchsia_zircon_tests"
environments = basic_envs
},
]
binaries = [
{
name = "exit_with_code_util"
},
{
name = "sleep_forever_util"
},
]
}