| # 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. | |
| load("@io_bazel_rules_go//go:def.bzl", "go_library") | |
| load("//build/bazel/platforms:constraints.bzl", "HOST_OS_CONSTRAINTS") | |
| load("//build/bazel/rules/host:defs.bzl", "go_binary_host_tool") | |
| load("//build/bazel/rules/host_tests:host_go_test.bzl", "host_go_test") | |
| package(default_applicable_licenses = ["//:license"]) | |
| go_library( | |
| name = "rust_test_parser_lib", | |
| srcs = [ | |
| "rusttest.go", | |
| ], | |
| importpath = "go.fuchsia.dev/fuchsia/tools/rust_test_parser", | |
| target_compatible_with = HOST_OS_CONSTRAINTS, | |
| visibility = ["//visibility:public"], | |
| deps = [ | |
| "//tools/testing/runtests", | |
| ], | |
| ) | |
| go_library( | |
| name = "main", | |
| srcs = [ | |
| "cmd/main.go", | |
| ], | |
| importpath = "go.fuchsia.dev/fuchsia/tools/rust_test_parser/cmd", | |
| target_compatible_with = HOST_OS_CONSTRAINTS, | |
| visibility = ["//visibility:private"], | |
| deps = [ | |
| ":rust_test_parser_lib", | |
| "//tools/lib/jsonutil", | |
| "//tools/lib/subprocess", | |
| "//tools/testing/runtests", | |
| "//tools/testing/testrunner:constants", | |
| ], | |
| ) | |
| go_binary_host_tool( | |
| name = "rust_test_parser", | |
| embed = [":main"], | |
| target_compatible_with = HOST_OS_CONSTRAINTS, | |
| visibility = ["//visibility:public"], | |
| ) | |
| host_go_test( | |
| name = "rust_test_parser_lib_tests", | |
| srcs = ["rusttest_test.go"], | |
| embed = [":rust_test_parser_lib"], | |
| target_compatible_with = HOST_OS_CONSTRAINTS, | |
| visibility = ["//tools:__pkg__"], | |
| deps = [ | |
| "//third_party/golibs:github.com/google/go-cmp/cmp", | |
| "//third_party/golibs:github.com/google/go-cmp/cmp/cmpopts", | |
| "//tools/testing/runtests", | |
| ], | |
| ) |