| # Copyright 2021 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/assembly/config_data_for_assembly.gni") |
| import("//build/config.gni") |
| |
| # The list of Sampler configuration files in the current directory that |
| # are used to configure data to be sent to Cobalt. Files that are not listed |
| # in this variable will be ignored. |
| sampler_files = [ |
| "archivist.json", |
| "avrcp.json", |
| "driver_manager_all.json", |
| "fshost.json", |
| "netstack.json", |
| "power_metrics_recorder.json", |
| "setui.json", |
| "system-update-committer.json", |
| |
| # TODO(https://fxbug.dev/): remove driver_manager_all.json and bring back these |
| #"audio-drivers.json", |
| #"bthost.json", |
| #"connectivity-wlan.json", |
| #"display.json", |
| #"ftl.json", |
| #"fvm.json", |
| #"radar.json", |
| #"sdmmc.json", |
| #"sysmem.json", |
| ] |
| |
| # Install Sampler and FIRE config into the "sampler" package |
| |
| config_data_for_assembly("sampler_config_internal") { |
| for_pkg = "sampler" |
| sources = sampler_files |
| |
| # The component will see this as /config/metrics/fuchsia/foo.json |
| outputs = [ "metrics/fuchsia/{{source_file_part}}" ] |
| } |
| |
| # Validate Sampler config |
| |
| resource("sampler-validation-resources") { |
| sources = sampler_files |
| |
| # The component will see this as /pkg/config/fuchsia/metrics/foo.json |
| outputs = [ "config/metrics/fuchsia/{{source_file_part}}" ] |
| } |
| |
| # Test component for config validation. |
| fuchsia_unittest_component("config-validation-component") { |
| deps = [ |
| ":sampler-validation-resources", |
| "//src/diagnostics/sampler/tests:config-validation", |
| ] |
| } |
| |
| # This target name must be unique in the build tree |
| fuchsia_test_package("sampler-config-validation-package-src-diagnostics") { |
| test_components = [ ":config-validation-component" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":sampler-config-validation-package-src-diagnostics" ] |
| } |