blob: ca871c6d65ff8283b4024b5e7c7c570c6329efe6 [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/config.gni")
import("//build/fidl/fidl.gni")
import("//build/package.gni")
import("//build/test/test_package.gni")
import("//build/testing/environments.gni")
fidl("interface") {
# TODO(fxb/35879): Remove lint exclusions by fixing known FIDL lint violations in this target
excluded_checks = [ "string-bounds-not-specified" ]
testonly = true
name = "test.sysmgr"
sources = [ "interface.test.fidl" ]
}
executable("test_sysmgr_service") {
testonly = true
sources = [ "test_sysmgr_service.cc" ]
deps = [
":interface",
"//sdk/lib/fidl/cpp",
"//sdk/lib/sys/cpp",
"//src/lib/syslog/cpp",
"//zircon/public/lib/async-default",
"//zircon/public/lib/async-loop-cpp",
"//zircon/public/lib/async-loop-default",
"//zircon/public/lib/zx",
]
}
executable("mock_resolver") {
testonly = true
sources = [ "mock_resolver.cc" ]
deps = [
"//sdk/fidl/fuchsia.pkg",
"//sdk/lib/fidl/cpp",
"//sdk/lib/sys/cpp",
"//src/lib/fxl",
"//zircon/public/lib/async-default",
"//zircon/public/lib/async-loop-cpp",
"//zircon/public/lib/async-loop-default",
"//zircon/public/lib/zx",
]
}
executable("service_startup_test") {
testonly = true
sources = [ "service_startup_test.cc" ]
deps = [
":interface",
"//garnet/examples/fidl/services:echo",
"//garnet/public/lib/gtest",
"//sdk/lib/sys/cpp",
"//src/lib/fxl",
"//src/lib/fxl/test:gtest_main",
"//src/sys/appmgr:appmgr_for_test",
"//third_party/googletest:gmock",
"//zircon/system/fidl/fuchsia-logger",
]
# TODO(46846): Fix the leaks and remove this.
deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ]
}
executable("package_updating_loader_test") {
testonly = true
sources = [ "package_updating_loader_test.cc" ]
deps = [
":interface",
"//garnet/examples/fidl/services:echo",
"//garnet/public/lib/gtest",
"//sdk/lib/sys/cpp/testing:integration",
"//src/lib/fxl",
"//src/lib/fxl/test:gtest_main",
"//src/sys/sysmgr:lib",
"//zircon/public/lib/fs",
"//zircon/public/lib/zx",
]
}
config_data("sysmgr_integration_test_observer_config") {
for_pkg = "sysmgr_integration_tests"
outputs = [ "service_startup_test.config" ]
sources = [ "config/service_startup_test.config" ]
}
test_package("integration_tests") {
package_name = "sysmgr_integration_tests"
deps = [
":mock_resolver",
":package_updating_loader_test",
":service_startup_test",
":sysmgr_integration_test_observer_config",
":test_sysmgr_service",
"//src/diagnostics/archivist:bin",
"//src/sys/sysmgr:bin",
]
binaries = [
{
name = "mock_resolver"
},
{
name = "test_sysmgr_service"
},
{
name = "archivist"
},
{
name = "sysmgr"
},
]
tests = [
{
name = "service_startup_test"
environments = basic_envs
},
{
name = "package_updating_loader_test"
environments = basic_envs
},
]
meta = [
{
path = rebase_path("meta/test_sysmgr_service.cmx")
dest = "test_sysmgr_service.cmx"
},
{
path = rebase_path("meta/mock_resolver.cmx")
dest = "mock_resolver.cmx"
},
{
path = rebase_path("meta/observer.cmx")
dest = "observer.cmx"
},
{
path = "//src/sys/sysmgr/meta/sysmgr.cmx"
dest = "sysmgr.cmx"
},
]
resources = [
{
path = "//src/diagnostics/archivist/configs/observer_config.json"
dest = "observer_config.json"
},
]
components =
[ "//garnet/examples/fidl/echo_server_rust:echo_server_rust_component" ]
}