| # 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 = "testparser", | |
| srcs = [ | |
| "googletest.go", | |
| "testparser.go", | |
| "trftest.go", | |
| "vulkanctstest.go", | |
| "zircon_utest.go", | |
| ], | |
| importpath = "go.fuchsia.dev/fuchsia/tools/testing/testparser", | |
| target_compatible_with = HOST_OS_CONSTRAINTS, | |
| visibility = ["//:__subpackages__"], | |
| deps = [ | |
| "//src/connectivity/network/testing/conformance/parseoutput", | |
| "//tools/build", | |
| "//tools/testing/runtests", | |
| ], | |
| ) | |
| # The testparser binary is only built in Bazel. | |
| # @bazel2gn:skip | |
| go_library( | |
| name = "main", | |
| srcs = [ | |
| "cmd/main.go", | |
| ], | |
| importpath = "go.fuchsia.dev/fuchsia/tools/testing/testparser/main", | |
| target_compatible_with = HOST_OS_CONSTRAINTS, | |
| visibility = ["//:__subpackages__"], | |
| deps = [ | |
| ":testparser", | |
| ], | |
| ) | |
| # @bazel2gn:skip | |
| go_binary_host_tool( | |
| name = "testparser_cmd", | |
| embed = [":main"], | |
| target_compatible_with = HOST_OS_CONSTRAINTS, | |
| ) | |
| host_go_test( | |
| name = "testparser_tests", | |
| srcs = ["testparser_test.go"], | |
| embed = [":testparser"], | |
| 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", | |
| ], | |
| ) | |
| # The testparser binary is only built in Bazel. | |
| # @bazel2gn:skip | |
| host_go_test( | |
| name = "testparser_cmd_test", | |
| srcs = ["cmd/main_test.go"], | |
| embed = [":main"], | |
| target_compatible_with = HOST_OS_CONSTRAINTS, | |
| visibility = ["//tools:__pkg__"], | |
| deps = ["//third_party/golibs:github.com/google/go-cmp/cmp"], | |
| ) |