blob: cf3d02542fb49f275ace9a6008475605048fdcc5 [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/components/fuchsia_unittest_component.gni")
visibility = [ ":*" ]
###############################################################################
# EXECUTABLES
###############################################################################
executable("archive_unittest_exe") {
testonly = true
sources = [ "archive_unittest.cc" ]
deps = [
"//sdk/fidl/fuchsia.feedback",
"//sdk/fidl/fuchsia.mem",
"//sdk/lib/syslog/cpp",
"//src/developer/forensics/testing:gmatchers",
"//src/developer/forensics/testing:gpretty_printers",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/utils:archive",
"//src/lib/fsl",
"//src/lib/fxl",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("bridge_unittest_exe") {
testonly = true
sources = [ "bridge_unittest.cc" ]
deps = [
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/utils:errors",
"//src/developer/forensics/utils/fit",
"//src/lib/testing/loop_fixture",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("caching_ptr_unittest_exe") {
testonly = true
sources = [ "caching_ptr_unittest.cc" ]
deps = [
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/testing:unit_test_fixture",
"//src/developer/forensics/testing/stubs:channel_control",
"//src/developer/forensics/utils:errors",
"//src/developer/forensics/utils/fidl:caching_ptr",
"//src/lib/fxl",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
"//zircon/system/ulib/async:async-cpp",
]
}
executable("channel_provider_ptr_unittest_exe") {
testonly = true
sources = [ "channel_provider_ptr_unittest.cc" ]
deps = [
"//sdk/lib/fit-promise",
"//sdk/lib/syslog/cpp",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/testing:unit_test_fixture",
"//src/developer/forensics/testing/stubs:channel_control",
"//src/developer/forensics/utils/fidl:channel_provider_ptr",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
"//zircon/system/ulib/async:async-cpp",
"//zircon/system/ulib/zx",
]
}
executable("cobalt_unittest_exe") {
testonly = true
sources = [ "cobalt_unittest.cc" ]
deps = [
"//src/developer/forensics/testing:gpretty_printers",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/testing:unit_test_fixture",
"//src/developer/forensics/testing/stubs:cobalt",
"//src/developer/forensics/utils/cobalt",
"//src/lib/timekeeper:testing",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
"//zircon/system/ulib/zx",
]
}
executable("component_unittest_exe") {
testonly = true
sources = [ "component_unittest.cc" ]
deps = [
"//sdk/fidl/fuchsia.process.lifecycle",
"//sdk/lib/sys/cpp",
"//sdk/lib/sys/cpp/testing:unit",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/utils/component",
"//src/lib/testing/loop_fixture",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("hanging_get_ptr_unittest_exe") {
testonly = true
sources = [ "hanging_get_ptr_unittest.cc" ]
deps = [
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/testing:unit_test_fixture",
"//src/developer/forensics/testing/stubs:device_id_provider",
"//src/developer/forensics/utils:errors",
"//src/developer/forensics/utils/fidl:hanging_get_ptr",
"//src/lib/fxl",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
"//zircon/system/ulib/async:async-cpp",
]
}
executable("inspect_node_manager_unittest_exe") {
testonly = true
sources = [ "inspect_node_manager_unittest.cc" ]
deps = [
"//sdk/lib/syslog/cpp",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/testing:unit_test_fixture",
"//src/developer/forensics/utils:inspect_node_manager",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("inspect_protocol_stats_unittest_exe") {
testonly = true
sources = [ "inspect_protocol_stats_unittest.cc" ]
deps = [
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/testing:unit_test_fixture",
"//src/developer/forensics/utils:inspect_node_manager",
"//src/developer/forensics/utils:inspect_protocol_stats",
]
}
executable("log_format_unittest_exe") {
testonly = true
sources = [ "log_format_unittest.cc" ]
deps = [
"//sdk/lib/syslog/cpp",
"//src/developer/forensics/utils:logs",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gtest",
]
}
executable("oneshot_ptr_unittest_exe") {
testonly = true
sources = [ "oneshot_ptr_unittest.cc" ]
deps = [
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/testing:unit_test_fixture",
"//src/developer/forensics/testing/stubs:channel_control",
"//src/developer/forensics/utils:errors",
"//src/developer/forensics/utils/fidl:oneshot_ptr",
"//src/lib/fxl",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
"//zircon/system/ulib/async:async-cpp",
"//zircon/system/ulib/zx",
]
}
executable("previous_boot_file_unittest_exe") {
testonly = true
sources = [ "previous_boot_file_unittest.cc" ]
deps = [
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/utils:previous_boot_file",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
executable("promise_unittest_exe") {
testonly = true
sources = [ "promise_unittest.cc" ]
deps = [
"//sdk/lib/fit-promise",
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/utils/fit",
"//src/lib/fxl",
"//src/lib/testing/loop_fixture",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
"//zircon/system/ulib/async:async-cpp",
]
}
executable("time_unittest_exe") {
testonly = true
sources = [ "time_unittest.cc" ]
deps = [
"//src/developer/forensics/utils:time",
"//src/lib/fxl/test:gtest_main",
"//src/lib/timekeeper:testing",
"//third_party/googletest:gtest",
]
}
executable("utc_time_provider_unittest_exe") {
testonly = true
sources = [ "utc_time_provider_unittest.cc" ]
deps = [
"//src/developer/forensics/testing:gtest_with_syslog_main",
"//src/developer/forensics/testing:unit_test_fixture",
"//src/developer/forensics/utils:utc_time_provider",
"//src/lib/files",
"//src/lib/timekeeper:testing",
"//third_party/googletest:gmock",
"//third_party/googletest:gtest",
]
}
###############################################################################
# RESOURCES
###############################################################################
resource("test_data_zip") {
sources = [ "resources/test_data.zip" ]
outputs = [ "data/test_data.zip" ]
}
###############################################################################
# COMPONENTS
###############################################################################
fuchsia_unittest_component("archive_unittest") {
deps = [
":archive_unittest_exe",
":test_data_zip",
"//src/sys/test_runners:tmp_storage",
]
}
fuchsia_unittest_component("bridge_unittest") {
deps = [ ":bridge_unittest_exe" ]
}
fuchsia_unittest_component("caching_ptr_unittest") {
deps = [ ":caching_ptr_unittest_exe" ]
}
fuchsia_unittest_component("channel_provider_ptr_unittest") {
deps = [ ":channel_provider_ptr_unittest_exe" ]
}
fuchsia_unittest_component("cobalt_unittest") {
deps = [ ":cobalt_unittest_exe" ]
}
fuchsia_unittest_component("component_unittest") {
deps = [
":component_unittest_exe",
"//src/sys/test_runners:tmp_storage",
]
}
fuchsia_unittest_component("hanging_get_ptr_unittest") {
deps = [ ":hanging_get_ptr_unittest_exe" ]
}
fuchsia_component("inspect_node_manager_unittest") {
testonly = true
manifest = "meta/inspect_node_manager_unittest.cml"
deps = [ ":inspect_node_manager_unittest_exe" ]
}
fuchsia_unittest_component("inspect_protocol_stats_unittest") {
deps = [ ":inspect_protocol_stats_unittest_exe" ]
}
fuchsia_unittest_component("log_format_unittest") {
deps = [ ":log_format_unittest_exe" ]
}
fuchsia_component("oneshot_ptr_unittest") {
testonly = true
manifest = "meta/oneshot_ptr_unittest.cml"
deps = [ ":oneshot_ptr_unittest_exe" ]
}
fuchsia_component("previous_boot_file_unittest") {
testonly = true
manifest = "meta/previous_boot_file_unittest.cml"
deps = [ ":previous_boot_file_unittest_exe" ]
}
fuchsia_component("promise_unittest") {
testonly = true
manifest = "meta/promise_unittest.cml"
deps = [ ":promise_unittest_exe" ]
}
fuchsia_unittest_component("time_unittest") {
deps = [ ":time_unittest_exe" ]
}
fuchsia_component("utc_time_provider_unittest") {
testonly = true
manifest = "meta/utc_time_provider_unittest.cml"
deps = [ ":utc_time_provider_unittest_exe" ]
}
###############################################################################
# PACKAGES
###############################################################################
fuchsia_test_package("feedback-utils-tests") {
test_components = [
":archive_unittest",
":bridge_unittest",
":caching_ptr_unittest",
":channel_provider_ptr_unittest",
":cobalt_unittest",
":component_unittest",
":hanging_get_ptr_unittest",
":inspect_node_manager_unittest",
":inspect_protocol_stats_unittest",
":log_format_unittest",
":oneshot_ptr_unittest",
":previous_boot_file_unittest",
":promise_unittest",
":time_unittest",
":utc_time_provider_unittest",
]
test_specs = {
log_settings = {
max_severity = "FATAL"
}
}
}
###############################################################################
# GROUPS
###############################################################################
group("tests") {
testonly = true
public_deps = [ ":feedback-utils-tests" ]
visibility += [ "//src/developer/forensics:tests" ]
}