blob: e1dfabaca694059d381c16099f32a2fbf3b3a798 [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/components.gni")
import("//build/dist/resource.gni")
import("//build/rust/rustc_library.gni")
rustc_library("library_loader") {
version = "0.1.0"
edition = "2021"
with_unit_tests = true
deps = [
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//sdk/fidl/fuchsia.ldsvc:fuchsia.ldsvc_rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-fs",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:tracing",
]
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(https://fxbug.dev/42061196): Replace this with a pseudo-directory backed by the Rust VFS.
resource("config_test_foo") {
sources = [ "config_test_files/foo" ]
outputs = [ "lib/config_test/foo" ]
}
resource("config_test_bar_baz") {
sources = [ "config_test_files/bar/baz" ]
outputs = [ "lib/config_test/bar/baz" ]
}
fuchsia_unittest_package("library_loader_tests") {
deps = [
":config_test_bar_baz",
":config_test_foo",
":library_loader_test",
]
test_specs = {
}
}
group("tests") {
testonly = true
deps = [ ":library_loader_tests" ]
}