| # Copyright 2020 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/test.gni") |
| |
| config("include") { |
| visibility = [ ":*" ] |
| include_dirs = [ "include" ] |
| } |
| |
| test("logging_cpp_unittests") { |
| sources = [ |
| "host/encoder.h", |
| "log_settings_unittest.cc", |
| "logging_unittest.cc", |
| ] |
| deps = [ |
| ":cpp", |
| "//src/lib/fxl", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/lib/uuid", |
| "//third_party/googletest:gmock", |
| "//third_party/googletest:gtest", |
| ] |
| if (is_fuchsia) { |
| deps += [ |
| "//sdk/fidl/fuchsia.diagnostics.types:fuchsia.diagnostics.types_cpp", |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_cpp", |
| "//sdk/lib/async", |
| "//sdk/lib/async:async-cpp", |
| "//sdk/lib/async-loop:async-loop-cpp", |
| "//src/lib/diagnostics/fake-log-sink/cpp", |
| "//src/lib/fsl", |
| "//third_party/rapidjson", |
| ] |
| } |
| } |
| |
| test("logging_cpp_unittests_structured") { |
| sources = [ "log_structure_unittest.cc" ] |
| |
| deps = [ |
| ":cpp", |
| "//src/lib/diagnostics/fake-log-sink/cpp", |
| "//src/lib/files", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| fuchsia_unittest_component("logging-cpp-unittests") { |
| manifest = "meta/logging_cpp_unittests.cml" |
| deps = [ ":logging_cpp_unittests" ] |
| } |
| |
| fuchsia_unittest_component("logging-cpp-unittests-structured") { |
| manifest = "meta/logging_cpp_unittests_structured.cml" |
| deps = [ ":logging_cpp_unittests_structured" ] |
| } |
| |
| test("logging-cpp-from-void") { |
| sources = [ "log_from_void.cc" ] |
| |
| deps = [ |
| ":cpp", |
| "//src/lib/files", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gtest", |
| ] |
| } |
| |
| fuchsia_component("from_void_test_root") { |
| testonly = true |
| deps = [ ":logging-cpp-from-void" ] |
| manifest = "meta/from_void_test_root.cml" |
| } |
| |
| fuchsia_unittest_component("logging-cpp-from-void-test") { |
| manifest = "meta/logging_cpp_from_void_test.cml" |
| deps = [ |
| ":from_void_test_root", |
| ":logging-cpp-from-void", |
| ] |
| } |
| |
| fuchsia_test_package("logging-cpp-tests") { |
| test_components = [ |
| ":logging-cpp-unittests", |
| ":logging-cpp-unittests-structured", |
| ":logging-cpp-from-void-test", |
| ] |
| test_specs = { |
| log_settings = { |
| max_severity = "FATAL" |
| } |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ |
| ":logging-cpp-tests", |
| ":logging_cpp_unittests($host_toolchain)", |
| ] |
| } |
| |
| ## BAZEL2GN SENTINEL - DO NOT EDIT BELOW THIS LINE ## |
| # |
| # ________ _________ ________ ________ |
| # |\ ____\|\___ ___\\ __ \|\ __ \ |
| # \ \ \___|\|___ \ \_\ \ \|\ \ \ \|\ \ |
| # \ \_____ \ \ \ \ \ \ \\\ \ \ ____\ |
| # \|____|\ \ \ \ \ \ \ \\\ \ \ \___| |
| # ____\_\ \ \ \__\ \ \_______\ \__\ |
| # |\_________\ \|__| \|_______|\|__| |
| # \|_________| |
| # |
| # |
| # AUTO-GENERATED - DO NOT EDIT |
| # |
| # The targets below are auto-generated based on the targets defined in the |
| # BUILD.bazel file from the same directory. If you made changes to targets in |
| # Bazel, instead of editing this file manually, run: |
| # |
| # > fx bazel2gn |
| # |
| # Please do NOT edit this file directly. Instead, edit the BUILD.bazel file and |
| # rerun bazel2gn. |
| |
| import("//build/tools/bazel2gn/bazel_migration.gni") |
| |
| # A self-verification target for generated content in this file. |
| if (is_host) { |
| verify_bazel2gn("verify_bazel2gn") { |
| } |
| } |
| |
| sdk_source_set("cpp") { |
| sources = [] |
| sources += [ "log_message_impl.cc" ] |
| if (is_fuchsia) { |
| sources += [ |
| "log_settings_internal.h", |
| "logging_backend_fuchsia.cc", |
| ] |
| } else { |
| sources += [ |
| "host/log_buffer.cc", |
| "host/logging_backend.cc", |
| ] |
| } |
| public = [] |
| public += [ |
| "log_level.h", |
| "log_message_impl.h", |
| "log_settings.h", |
| "macros.h", |
| ] |
| if (is_fuchsia) { |
| public += [] |
| } else { |
| public += [ |
| "host/encoder.h", |
| "host/log_buffer.h", |
| ] |
| } |
| sdk_area = "Diagnostics" |
| category = "partner" |
| public_deps = [ |
| "//sdk/lib/fit-promise", |
| "//zircon/system/ulib/zx", |
| ] |
| if (is_fuchsia) { |
| public_deps += [ |
| ":backend_fuchsia_globals", |
| "//sdk/lib/async-loop:async-loop-cpp", |
| "//sdk/lib/syslog/structured_backend", |
| ] |
| } |
| if (!is_fuchsia) { |
| public_deps += [ "//sdk/lib/syslog/structured_backend:host_cpp" ] |
| } |
| deps = [] |
| if (is_fuchsia) { |
| deps += [ |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_cpp", |
| "//sdk/lib/async:async-cpp", |
| "//sdk/lib/async-default", |
| "//sdk/lib/async-loop:async-loop-default", |
| "//sdk/lib/component/incoming/cpp", |
| ] |
| } |
| sdk_name = "syslog_cpp" |
| include_base = "//sdk" |
| public_configs = [ "//sdk/config" ] |
| stable = true |
| visibility = [ "*" ] |
| } |
| if (is_fuchsia) { |
| sdk_shared_library("backend_fuchsia_globals") { |
| sources = [ "logging_backend_fuchsia_globals.cc" ] |
| public = [ "include/lib/syslog/cpp/logging_backend_fuchsia_globals.h" ] |
| sdk_area = "Diagnostics" |
| category = "partner" |
| sdk_name = "backend_fuchsia_globals" |
| deps = [ |
| "//sdk/fidl/fuchsia.logger:fuchsia.logger_cpp", |
| "//sdk/lib/syslog/structured_backend", |
| ] |
| libcxx_linkage = "static" |
| public_configs = [ ":include" ] |
| visibility = [ "*" ] |
| runtime_deps = [ |
| "//sdk/lib/async-default", |
| "//sdk/lib/fdio", |
| ] |
| public_deps = [ "//src/zircon/lib/zircon" ] |
| } |
| } |