| # 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_tests:host_go_test.bzl", "host_go_test") | |
| package(default_applicable_licenses = ["//:license"]) | |
| go_library( | |
| name = "virtual_device", | |
| srcs = [ | |
| "aemu.go", | |
| "common.go", | |
| "doc.go", | |
| "qemu.go", | |
| ], | |
| importpath = "go.fuchsia.dev/fuchsia/tools/virtual_device", | |
| target_compatible_with = HOST_OS_CONSTRAINTS, | |
| visibility = [ | |
| "//src/devices/block/drivers/ufs/test/e2e:__pkg__", | |
| "//src/tests/kernel_crashlog:__pkg__", | |
| "//tools/emulator:__pkg__", | |
| ], | |
| deps = [ | |
| ":proto", | |
| "//third_party/golibs:github.com/google/go-cmp/cmp", | |
| "//tools/lib/productbundle", | |
| "//tools/qemu", | |
| ], | |
| ) | |
| host_go_test( | |
| name = "virtual_device_test", | |
| srcs = [ | |
| "common_test.go", | |
| "qemu_test.go", | |
| ], | |
| embed = [":virtual_device"], | |
| visibility = ["//tools:__pkg__"], | |
| ) | |
| # @bazel2gn:raw_attribute:non_go_deps = [ "proto:lib" ] | |
| go_library( | |
| name = "proto", | |
| srcs = ["proto/virtual_device.pb.go"], | |
| importpath = "go.fuchsia.dev/fuchsia/tools/virtual_device/proto", | |
| target_compatible_with = HOST_OS_CONSTRAINTS, | |
| visibility = [ | |
| "//src/connectivity/network/testing/conformance/emulator:__pkg__", | |
| "//src/devices/block/drivers/ufs/test/e2e:__pkg__", | |
| "//src/tests:__subpackages__", | |
| "//third_party/network-conformance/orchestrator:__pkg__", | |
| "//tools/emulator:__subpackages__", | |
| ], | |
| deps = [ | |
| "//third_party/golibs:google.golang.org/protobuf/reflect/protoreflect", | |
| "//third_party/golibs:google.golang.org/protobuf/runtime/protoimpl", | |
| ], | |
| ) |