| # 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. |
| |
| # NOTE: the contents of this file have been copied into documentation located at |
| # //docs/development/languages/rust/testing.md. Please update the snippets |
| # in that file if the contents below are changed. |
| |
| import("//build/package.gni") |
| import("//build/rust/rustc_binary.gni") |
| import("//build/test/test_package.gni") |
| |
| group("rust") { |
| deps = [ |
| ":hello_world_rust", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| |
| deps = [ |
| ":hello_world_rust_tests", |
| ] |
| } |
| |
| rustc_binary("bin") { |
| name = "hello_world_rust" |
| with_unit_tests = true |
| edition = "2018" |
| |
| deps = [] |
| test_deps = [ "//garnet/public/rust/fuchsia-async" ] |
| } |
| |
| package("hello_world_rust") { |
| deps = [ |
| ":bin", |
| ] |
| |
| binaries = [ |
| { |
| name = "hello_world_rust" |
| }, |
| ] |
| |
| meta = [ |
| { |
| path = rebase_path("meta/hello_world_rust.cmx") |
| dest = "hello_world_rust.cmx" |
| }, |
| ] |
| } |
| |
| test_package("hello_world_rust_tests") { |
| deps = [ |
| ":bin_test", |
| ] |
| tests = [ |
| { |
| name = "hello_world_rust_bin_test" |
| }, |
| ] |
| } |