| # 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_binary("affectedtests") { |
| gopackage = "go.fuchsia.dev/fuchsia/tools/testing/affectedtests/main" |
| deps = [ |
| ":lib", |
| ":main", |
| ] |
| } |
| |
| go_library("lib") { |
| name = "go.fuchsia.dev/fuchsia/tools/testing/affectedtests/lib" |
| source_dir = "lib" |
| deps = [ "//tools/build" ] |
| } |
| |
| go_library("main") { |
| name = "go.fuchsia.dev/fuchsia/tools/testing/affectedtests/main" |
| deps = [ "//tools/build" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ ":test($host_toolchain)" ] |
| } |
| |
| if (is_host) { |
| _testdata_path = "$target_gen_dir/testdata" |
| |
| go_test("test") { |
| output_name = "affectedtests_tests" |
| gopackages = [ "go.fuchsia.dev/fuchsia/tools/testing/affectedtests/lib" ] |
| args = [ |
| "--test_data_dir", |
| rebase_path(_testdata_path, root_out_dir), |
| ] |
| deps = [ ":lib" ] |
| non_go_deps = [ ":testdata" ] |
| } |
| |
| host_test_data("testdata") { |
| sources = [ "testdata" ] |
| outputs = [ _testdata_path ] |
| } |
| } |