|  | # 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/test/test_package.gni") | 
|  | import("//build/testing/environments.gni") | 
|  |  | 
|  | rustc_library("fdio") { | 
|  | with_unit_tests = true | 
|  | version = "0.2.0" | 
|  | edition = "2018" | 
|  | deps = [ | 
|  | "//sdk/fidl/fuchsia.device:fuchsia.device-rustc", | 
|  | "//src/lib/fuchsia-runtime", | 
|  | "//src/lib/zircon/rust:fuchsia-zircon", | 
|  | "//src/lib/zircon/rust:fuchsia-zircon-sys", | 
|  | "//third_party/rust_crates:bitflags", | 
|  | ] | 
|  |  | 
|  | test_deps = [ "//sdk/fidl/fuchsia.io:fuchsia.io-rustc" ] | 
|  |  | 
|  | sources = [ | 
|  | "src/fdio_sys.rs", | 
|  | "src/lib.rs", | 
|  | ] | 
|  | } | 
|  |  | 
|  | rustc_binary("spawn_test_target_bin") { | 
|  | name = "spawn_test_target" | 
|  | version = "0.2.0" | 
|  | edition = "2018" | 
|  |  | 
|  | source_root = "spawn_test_target_bin/main.rs" | 
|  |  | 
|  | sources = [ "spawn_test_target_bin/main.rs" ] | 
|  | } | 
|  |  | 
|  | test_package("tests") { | 
|  | package_name = "fdio_rust_tests" | 
|  |  | 
|  | deps = [ | 
|  | ":fdio_test", | 
|  | ":spawn_test_target_bin", | 
|  | ] | 
|  |  | 
|  | binaries = [ | 
|  | { | 
|  | name = "spawn_test_target" | 
|  | shell = true | 
|  | }, | 
|  | ] | 
|  |  | 
|  | tests = [ | 
|  | { | 
|  | name = "fdio_lib_test" | 
|  | dest = "fdio_rust_tests" | 
|  | environments = [ emu_env ] | 
|  | }, | 
|  | ] | 
|  | } |