blob: 748d0273ecad705844747fdca6cb336680afaf3b [file] [log] [blame]
# Copyright 2020 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_binary.gni")
import("//build/go/go_library.gni")
import("//build/go/go_test.gni")
import("//build/testing/host_test_data.gni")
go_library("main") {
sources = [
"main.go",
"main_test.go",
"summary.go",
"summary_test.go",
]
deps = [
"//third_party/golibs:github.com/golang/protobuf",
"//third_party/golibs:golang.org/x/sync",
"//third_party/luci-go/resultdb/proto/v1:resultdb_proto_go",
"//third_party/luci-go/resultdb/sink/proto/v1:resultsink_proto_go",
"//tools/lib/flagmisc",
"//tools/testing/runtests",
"//tools/testing/testparser",
]
}
go_binary("resultdb") {
gopackage = "go.fuchsia.dev/fuchsia/tools/testing/resultdb"
deps = [ ":main" ]
# Needed to support cross-compilation. The infra recipes always needs this
# built for Linux, even if build happens on Mac.
cgo = false
}
group("tests") {
testonly = true
deps = [ ":test($host_toolchain)" ]
}
if (is_host) {
_testdata_path = "$target_gen_dir/testdata"
go_test("test") {
output_name = "resultdb_tests"
gopackages = [ "go.fuchsia.dev/fuchsia/tools/testing/resultdb" ]
args = [
"--test_data_dir",
rebase_path(_testdata_path, root_build_dir),
]
deps = [ ":main" ]
non_go_deps = [ ":testdata" ]
}
host_test_data("testdata") {
sources = [ "testdata" ]
outputs = [ _testdata_path ]
}
}