| # Copyright 2023 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/python/python_binary.gni") |
| import("//build/python/python_library.gni") |
| |
| python_library("power_test_utils") { |
| testonly = true |
| library_name = "power_test_utils" |
| sources = [ |
| "__init__.py", |
| "power_test_utils.py", |
| ] |
| enable_mypy = true |
| library_deps = [ "//src/performance/lib/trace_processing" ] |
| } |
| |
| # A small wrapper executable around the library call to merge power and trace data. |
| python_binary("merge_power_trace_bin") { |
| testonly = true |
| main_source = "merge_power_trace.py" |
| enable_mypy = true |
| deps = [ |
| "//src/performance/lib/trace_processing", |
| "//src/performance/trace2json", |
| "//src/tests/end_to_end/power:power_test_utils", |
| ] |
| output_name = "merge_power_trace.pyz" |
| } |
| |
| # Rename the resulting .pyz for the host tool |
| copy("copy") { |
| testonly = true |
| deps = [ ":merge_power_trace_bin" ] |
| sources = [ "${target_out_dir}/merge_power_trace.pyz" ] |
| outputs = [ "${root_out_dir}/merge_power_trace" ] |
| } |
| |
| install_host_tools("merge_power_trace") { |
| testonly = true |
| deps = [ ":copy" ] |
| outputs = [ "merge_power_trace" ] |
| } |
| |
| source_set("power_utils") { |
| testonly = true |
| sources = [ |
| "power_utils.cc", |
| "power_utils.h", |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ "tests" ] |
| } |