blob: 16df96bf45a607b7543ca154744a1c80f890191d [file] [log] [blame]
# 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/components.gni")
import("//build/config.gni")
import("//build/rust/rustc_binary.gni")
import("//build/testing/environments.gni")
import("//src/sys/core/build/core_shard.gni")
group("tests") {
testonly = true
deps = [
":optee_smoke_test",
":optee_test",
":tee-manager-tests",
]
}
rustc_binary("bin") {
name = "tee_manager"
edition = "2021"
with_unit_tests = true
deps = [
"//sdk/fidl/fuchsia.hardware.tee:fuchsia.hardware.tee_rust",
"//sdk/fidl/fuchsia.tee:fuchsia.tee_rust",
"//sdk/fidl/fuchsia.tee.manager:fuchsia.tee.manager_rust",
"//src/lib/fidl/rust/fidl",
"//src/lib/fuchsia",
"//src/lib/fuchsia-component",
"//src/lib/fuchsia-fs",
"//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:tracing",
"//third_party/rust_crates:uuid",
]
test_deps = [
"//sdk/fidl/fuchsia.io:fuchsia.io_rust",
"//src/lib/fuchsia-async",
"//src/lib/zircon/rust:fuchsia-zircon-status",
]
sources = [
"src/config.rs",
"src/device_server.rs",
"src/main.rs",
"src/provider_server.rs",
]
}
fuchsia_unittest_package("tee-manager-tests") {
manifest = "meta/tee_manager_bin_test.cml"
deps = [ ":bin_test" ]
}
source_set("test_common") {
testonly = true
visibility = [ ":*" ]
sources = [ "test/common.cc" ]
public_deps = [
"//sdk/fidl/fuchsia.tee:fuchsia.tee_hlcpp",
"//src/lib/fxl",
"//src/lib/fxl/test:gtest_main",
"//src/security/lib/tee/tee-client-api",
]
}
fuchsia_test_component("optee_test_cmp") {
component_name = "optee_test"
manifest = "meta/optee_test.cml"
deps = [ ":optee_test_bin" ]
# Depends on config_data which is a system capability.
test_type = "system"
}
fuchsia_component("tee_manager_optee_test_cmp") {
manifest = "meta/tee_manager.optee_test.cml"
component_name = "tee_manager"
deps = [ ":bin" ]
}
fuchsia_test_package("optee_test") {
test_components = [ ":optee_test_cmp" ]
deps = [ ":tee_manager_optee_test_cmp" ]
test_specs = {
# TODO(https://fxbug.dev/42175122) add astro_env, sherlock_env and nelson_env once
# the bug will be fixed
environments = []
}
}
executable("optee_test_bin") {
testonly = true
output_name = "optee_test"
sources = [ "test/optee_test.cc" ]
deps = [ ":test_common" ]
}
fuchsia_test_component("optee_smoke_test_cmp") {
component_name = "optee_smoke_test"
manifest = "meta/optee_smoke_test.cml"
deps = [ ":optee_smoke_test_bin" ]
# Depends on config_data which is a system capability.
test_type = "system"
}
fuchsia_component("tee_manager_optee_smoke_test_cmp") {
manifest = "meta/tee_manager.optee_smoke_test.cml"
component_name = "tee_manager"
deps = [ ":bin" ]
}
fuchsia_test_package("optee_smoke_test") {
test_components = [ ":optee_smoke_test_cmp" ]
deps = [ ":tee_manager_optee_smoke_test_cmp" ]
test_specs = {
environments = [ astro_env ]
}
}
executable("optee_smoke_test_bin") {
testonly = true
output_name = "optee_smoke_test"
sources = [ "test/optee_smoke_test.cc" ]
deps = [
":test_common",
"//sdk/lib/fit",
]
# TODO(https://fxbug.dev/42136089): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
core_shard("core_shard") {
shard_file = "meta/tee_manager.core_shard.cml"
}