blob: b4ce7f9977a632ae8d77ae79c296d4317e7354d1 [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/package.gni")
import("//build/rust/rustc_library.gni")
import("//build/test/test_package.gni")
import("//build/testing/environments.gni")
rustc_library("library_loader") {
version = "0.1.0"
edition = "2018"
with_unit_tests = true
deps = [
"//garnet/lib/rust/files_async",
"//garnet/lib/rust/io_util",
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//sdk/fidl/fuchsia.ldsvc:fuchsia.ldsvc-rustc",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:log",
"//third_party/rust_crates:thiserror",
]
sources = [ "src/lib.rs" ]
}
# These are some extra files that are included in the test package under lib/config_test, for use in
# the config_test unit test. This is necessary because the library loader must be able to load the
# files using OPEN_RIGHT_EXECUTABLE/VMO_FLAG_EXEC, and the easiest way to provide a test directory
# that supports that is a real pkgfs directory.
# TODO(fxbug.dev/37534): Remove this once Rust vfs supports OPEN_RIGHT_EXECUTABLE
generate_manifest("config_test_files") {
args = [
"--entry=lib/config_test/foo=" +
rebase_path("config_test_files/foo", root_build_dir),
"--entry=lib/config_test/bar/baz=" +
rebase_path("config_test_files/bar/baz", root_build_dir),
]
}
test_package("library_loader_tests") {
deps = [
":config_test_files",
":library_loader_test",
]
extra = get_target_outputs(":config_test_files")
tests = [
{
name = "library_loader_lib_test"
dest = "library_loader_tests"
environments = basic_envs
},
]
}
group("tests") {
testonly = true
deps = [ ":library_loader_tests" ]
}