| # 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") |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":optee_smoke_test", |
| ":optee_test", |
| ":tee-manager-tests", |
| ] |
| } |
| |
| fuchsia_component("tee_manager_cmp_legacy") { |
| manifest = "meta/tee_manager.cmx" |
| component_name = "tee_manager" |
| deps = [ ":bin" ] |
| } |
| |
| fuchsia_package("tee_manager") { |
| deps = [ ":tee_manager_cmp_legacy" ] |
| } |
| |
| rustc_binary("bin") { |
| name = "tee_manager" |
| edition = "2021" |
| with_unit_tests = true |
| |
| deps = [ |
| "//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/fuchsia-fs", |
| "//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", |
| ] |
| } |
| |
| 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", |
| "//src/lib/fxl", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/security/tee/tee-client-api", |
| ] |
| } |
| |
| fuchsia_component("optee_test_cmp") { |
| testonly = true |
| component_name = "optee_test" |
| manifest = "meta/optee_test.cml" |
| deps = [ ":optee_test_bin" ] |
| } |
| |
| 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 (fxbug.dev/93347) 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_component("optee_smoke_test_cmp") { |
| testonly = true |
| component_name = "optee_smoke_test" |
| manifest = "meta/optee_smoke_test.cml" |
| deps = [ ":optee_smoke_test_bin" ] |
| } |
| |
| 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(fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| } |