| # Copyright 2026 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/python/host.gni") |
| import("//build/python/python_binary.gni") |
| import("//build/python/python_host_test.gni") |
| import("//build/python/python_library.gni") |
| import("//build/testing/host_test_data.gni") |
| |
| common_deps = [ |
| "//build/python/modules/serialization", |
| "//scripts/lib/fx_cmd", |
| "//scripts/lib/statusinfo", |
| ] |
| |
| python_binary("test-category") { |
| main_source = "main.py" |
| deps = common_deps |
| } |
| |
| if (is_host) { |
| host_test_data("metadata_json") { |
| sources = [ "${root_build_dir}/testing_metadata.json" ] |
| outputs = [ "$target_out_dir/testing_metadata.json" ] |
| deps = [ "//tools/testing_metadata:testing_metadata_json_action($default_toolchain)" ] |
| } |
| |
| python_host_test("test_category_test") { |
| main_source = "tests/test_test_category.py" |
| sources = [ |
| "main.py", |
| "tests/test_test_category.py", |
| ] |
| main_callable = "test_main" |
| deps = common_deps + [ ":metadata_json" ] |
| extra_args = [ |
| "--metadata-path", |
| rebase_path("$target_out_dir/testing_metadata.json", root_build_dir), |
| ] |
| } |
| } |
| |
| install_python_tool("install") { |
| name = "test-category" |
| binary = ":test-category" |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":test_category_test($host_toolchain)" ] |
| } |