blob: 118545bcec9c76d77860108941dd7cbe2567d758 [file] [log] [blame]
# Copyright 2021 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_binary("cts") {
gopackage = "go.fuchsia.dev/fuchsia/sdk/cts/tools/testdriver/cmd"
deps = [ ":main" ]
}
go_library("main") {
source_dir = "cmd"
sources = [ "main.go" ]
deps = [ ":lib" ]
}
go_library("main_test") {
source_dir = "cmd"
sources = [ "main_test.go" ]
deps = [ ":lib" ]
}
go_library("lib") {
sources = [
"driver.go",
"manifest.go",
"sdk.go",
]
deps = [
":cipd",
"//third_party/golibs:golang.org/x/sync",
]
}
go_library("lib_test") {
sources = [
"common_test.go",
"driver_test.go",
"manifest_test.go",
"sdk_test.go",
]
deps = [ ":lib" ]
}
go_library("cipd") {
sources = [
"cipd/cipd.go",
"cipd/cli.go",
"cipd/luci.go",
"cipd/stub.go",
]
}
install_host_tools("host") {
deps = [ ":cts" ]
outputs = [ "cts" ]
}
group("tests") {
testonly = true
deps = []
deps += [
":cts_lib_tests($host_toolchain)",
":cts_main_tests($host_toolchain)",
]
}
if (is_host) {
go_test("cts_main_tests") {
gopackages = [ "go.fuchsia.dev/fuchsia/sdk/cts/tools/testdriver/cmd" ]
deps = [ ":main_test" ]
non_go_deps = [ "testdata" ]
}
go_test("cts_lib_tests") {
gopackages = [ "go.fuchsia.dev/fuchsia/sdk/cts/tools/testdriver" ]
args = [
"--test_data_dir",
rebase_path("$target_gen_dir/testdata", root_build_dir),
]
deps = [ ":lib_test" ]
non_go_deps = [ "testdata" ]
environments = []
if (is_host && target_cpu == "x64") {
environments = [ emu_env ]
}
}
}