| # Copyright 2017 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/host.gni") |
| import("//build/test.gni") |
| import("//third_party/protobuf/proto_library.gni") |
| |
| declare_args() { |
| extra_package_labels = [] |
| } |
| |
| install_host_tools("host") { |
| deps = [ "$cobalt_root/src/bin/error_calculator/src:bin" ] |
| outputs = [ "error_calculator" ] |
| } |
| |
| config("cobalt_config") { |
| include_dirs = [ |
| "$cobalt_root", |
| "$root_gen_dir/third_party/cobalt", |
| ] |
| |
| defines = [ "TQ_COBALT_USE_TINK" ] |
| |
| if (is_fuchsia_tree) { |
| include_dirs += [ |
| "//sdk/lib/syslog/cpp", |
| "//zircon/system/ulib/syslog/include", |
| ] |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| "keys:tests", |
| "src:tests", |
| ] |
| } |
| |
| test("cobalt_core_unittests") { |
| testonly = true |
| |
| output_name = "cobalt_core_tests" |
| |
| deps = [ |
| ":tests", |
| "//third_party/boringssl:crypto", |
| ] |
| |
| if (is_fuchsia_tree) { |
| deps += [ "//src/lib/fxl/test:gtest_main" ] |
| } else { |
| deps += [ "//third_party/googletest:gtest_main" ] |
| } |
| |
| configs -= [ "//build/config:no_exceptions" ] |
| } |
| |
| if (is_fuchsia_tree) { |
| import("//build/components.gni") |
| |
| fuchsia_unittest_package("cobalt_core_tests") { |
| deps = [ ":cobalt_core_unittests" ] |
| manifest = "meta/cobalt_core_tests.cml" |
| |
| test_specs = { |
| log_settings = { |
| max_severity = "FATAL" |
| } |
| } |
| } |
| } |
| |
| testonly = true |
| group("default") { |
| deps = [ |
| ":cobalt_core_unittests", |
| "$cobalt_root/src/bin/config_change_validator/src:bin", |
| "$cobalt_root/src/bin/error_calculator/src:bin", |
| ] |
| |
| if (!is_fuchsia_tree) { |
| deps += [ ":force_build_for_lint_gn_rules_present" ] |
| } |
| |
| deps += extra_package_labels |
| } |
| |
| # These targets are not needed to run Cobalt, but are present in the standalone |
| # repo's build to ensure that all source files are built by some target. |
| group("force_build_for_lint_gn_rules_present") { |
| deps = [ "$cobalt_root/src/public/testing:fake_cobalt_service" ] |
| } |