blob: bfa5cd47f6e079c28a1bfcf2efeff8e14d28b746 [file] [log] [blame]
# Copyright 2016 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/config/clang/clang.gni")
import("//build/config/sysroot.gni")
import("//build/fidl/fidl.gni")
import("//build/go/go_build.gni")
import("//build/go/go_test.gni")
import("//build/host.gni")
import("//build/package.gni")
import("//build/test/test_package.gni")
if (current_toolchain == target_toolchain) {
_go_root = "$host_tools_dir/goroot"
compiled_action("makeroot") {
visibility = [ ":makefuchsia" ]
depfile = "$target_gen_dir/$target_name.d"
outputs = [
"$target_gen_dir/$target_name.stamp",
]
tool = "makeroot"
args = [
"-source-goroot",
rebase_path(".", root_build_dir),
"-target-goroot",
rebase_path(_go_root, root_build_dir),
"-depfile",
rebase_path(depfile, root_build_dir),
"-depfile-root",
rebase_path(root_build_dir),
"-stamp-file",
rebase_path(outputs[0], root_build_dir),
]
}
compiled_action("makefuchsia") {
visibility = [ ":go_runtime" ]
deps = [
":makeroot",
]
depfile = "$target_gen_dir/$target_name.d"
outputs = [
"$target_gen_dir/$target_name.stamp",
]
tool = "makefuchsia"
args = [
"-bootstrap-goroot",
rebase_path("//prebuilt/third_party/go/${host_platform}"),
"-gocache",
gocache_dir,
"-goroot",
rebase_path(_go_root, root_build_dir),
"-depfile",
rebase_path(depfile, root_build_dir),
"-depfile-root",
rebase_path(root_build_dir),
"-stamp-file",
rebase_path(outputs[0], root_build_dir),
]
}
}
group("go_runtime") {
public_deps = [
":makefuchsia(${target_toolchain})",
]
}
go_test("go_dispatch_test") {
gopackages = ["syscall/zx/dispatch"]
}
go_test("go_fidl_test") {
gopackages = ["syscall/zx/fidl"]
}
go_test("go_extended_fidl_test") {
# N.B. these tests are not in the fidl package to avoid having to rebuild the
# go toolchain while iterating on them.
gopackages = ["syscall/zx/fidl/fidl_test"]
# TODO(pascallouis): Currently, while we take a dependency, the output of
# this FIDL rule is not directly used, rather the generated bindings were
# copied and checked in.
#
# Not being able to depend on automated generation is due to where code is
# placed, and how this relates to the tree structure of the toolchain.
# Disabling while fidlgen table generation is pending.
#deps = [
# "src/syscall/zx/fidl/bindingstest($go_toolchain)",
#]
}
go_test("go_zxwait_test") {
gopackages = ["syscall/zx/zxwait"]
}
go_test("go_os_test") {
gopackages = ["os"]
}
go_test("go_net_test") {
gopackages = ["net"]
}
go_test("go_pprof_test") {
gopackages = ["runtime/pprof"]
skip_vet = true
}
test_package("go_stdlib_tests") {
deps = [
":go_dispatch_test",
":go_net_test",
":go_os_test",
":go_pprof_test",
":go_zxwait_test",
]
tests = [
{
name = "go_dispatch_test"
},
{
name = "go_net_test"
},
{
name = "go_os_test"
},
{
name = "go_pprof_test"
},
{
name = "go_zxwait_test"
},
]
}
unittest_package("go_fidl_tests") {
deps = [
":go_extended_fidl_test",
":go_fidl_test",
]
tests = [
{
name = "go_fidl_test"
args = [
"--test.timeout",
# TODO(FLK-422): Should be 2m, and should not fail.
"10m",
]
},
{
name = "go_extended_fidl_test"
args = [
"--test.timeout",
# TODO(FLK-422): Should be 2m, and should not fail.
"10m",
]
},
]
}