blob: b5cdda65a405684dc173248f93788d41c4adcba2 [file] [log] [blame] [edit]
# Copyright 2019 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/config.gni")
import("//build/package.gni")
import("//build/rust/rustc_binary.gni")
import("//build/test/test_package.gni")
import("//build/testing/environments.gni")
group("tests") {
testonly = true
deps = [
":optee_smoke_test",
":optee_test",
":tee-manager-tests",
]
}
package("tee_manager") {
meta = [
{
path = rebase_path("meta/tee_manager.cmx")
dest = "tee_manager.cmx"
},
]
deps = [ ":bin" ]
binaries = [
{
name = "tee_manager"
dest = "tee_manager"
},
]
}
rustc_binary("bin") {
name = "tee_manager"
edition = "2018"
with_unit_tests = true
deps = [
"//garnet/lib/rust/io_util",
"//sdk/fidl/fuchsia.hardware.tee:fuchsia.hardware.tee-rustc",
"//sdk/fidl/fuchsia.tee:fuchsia.tee-rustc",
"//sdk/fidl/fuchsia.tee.manager:fuchsia.tee.manager-rustc",
"//src/lib/fdio/rust:fdio",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia-async",
"//src/lib/fuchsia-component",
"//src/lib/storage/fuchsia-vfs-watcher",
"//src/lib/syslog/rust:syslog",
"//src/lib/zircon/rust:fuchsia-zircon",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:futures",
"//third_party/rust_crates:serde",
"//third_party/rust_crates:serde_derive",
"//third_party/rust_crates:serde_json",
"//third_party/rust_crates:thiserror",
"//third_party/rust_crates:uuid",
]
test_deps = [
"//sdk/fidl/fuchsia.io:fuchsia.io-rustc",
"//src/lib/zircon/rust:fuchsia-zircon-status",
]
sources = [
"src/config.rs",
"src/device_server.rs",
"src/main.rs",
"src/provider_server.rs",
]
}
test_package("tee-manager-tests") {
deps = [ ":bin_test" ]
tests = [
{
name = "tee_manager_bin_test"
},
]
}
# TODO(fxbug.dev/44664): Remove this config when transition to board-specific configs is complete.
config_data("config") {
for_pkg = "sysmgr"
sources = [ "tee_manager_deprecated.config" ]
}
source_set("test_common") {
testonly = true
visibility = [ ":*" ]
sources = [ "test/common.cc" ]
public_deps = [
"//sdk/fidl/fuchsia.tee",
"//sdk/lib/sys/cpp/testing:integration",
"//src/lib/fxl",
"//src/lib/fxl/test:gtest_main",
"//zircon/system/ulib/tee-client-api",
]
}
test_package("optee_test") {
deps = [ ":optee_test_bin" ]
binaries = [
{
name = "optee_test"
},
]
tests = [
{
name = "optee_test"
environments = [ astro_env ]
},
]
}
executable("optee_test_bin") {
testonly = true
output_name = "optee_test"
sources = [ "test/optee_test.cc" ]
deps = [ ":test_common" ]
}
test_package("optee_smoke_test") {
deps = [ ":optee_smoke_test_bin" ]
binaries = [
{
name = "optee_smoke_test"
},
]
tests = [
{
name = "optee_smoke_test"
environments = [ astro_env ]
},
]
}
executable("optee_smoke_test_bin") {
testonly = true
output_name = "optee_smoke_test"
sources = [ "test/optee_smoke_test.cc" ]
deps = [
":test_common",
"//zircon/public/lib/fit",
]
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}