blob: b81a76ed850db79a3795f1886fb86a69cd22b49c [file] [log] [blame]
# Copyright 2019 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/go/go_library.gni")
import("//build/go/go_test.gni")
import("//build/testing/host_test_data.gni")
group("tests") {
testonly = true
deps = []
if (host_os == "linux") {
deps += [ ":limited_netsvc_tests($host_toolchain)" ]
}
}
if (is_linux) {
go_library("lib") {
testonly = true
deps = [ "//tools/emulator" ]
sources = [ "limited_netsvc_test.go" ]
}
host_test_data("main_zbi") {
sources = [ "$root_build_dir/fuchsia.zbi" ]
}
net_tools = [
"netaddr",
"netcp",
"netls",
"netruncmd",
]
host_test_data("copy_netsvc_tools") {
visibility = [ ":*" ]
sources = []
outputs = [ "$root_out_dir/test_data/limited_netsvc/{{source_file_part}}" ]
deps = []
foreach(tool, net_tools) {
sources += [ "$root_out_dir/$tool" ]
deps += [ "//tools/netprotocol:$tool($host_toolchain)" ]
}
}
host_test_data("copy_loglistener") {
visibility = [ ":*" ]
sources = [ "$root_out_dir/loglistener" ]
outputs = [ "$root_out_dir/test_data/limited_netsvc/loglistener" ]
deps = [ "//tools/loglistener($host_toolchain)" ]
}
group("netsvc_user_tools") {
testonly = true
deps = [
":copy_loglistener",
":copy_netsvc_tools",
]
}
# TODO(scottmg): Colocate this test with netsvc when it moves out of //zircon.
go_test("limited_netsvc_tests") {
gopackages = [ "go.fuchsia.dev/fuchsia/src/tests/limited_netsvc" ]
deps = [
":lib",
"//tools/net/netutil",
"//tools/net/tftp",
"//tools/virtual_device:proto",
]
non_go_deps = [
":main_zbi",
":netsvc_user_tools",
]
}
}