| # 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_library.gni") |
| import("//build/go/go_test.gni") |
| import("//build/testing/host_test_data.gni") |
| |
| go_library("ninjagraph") { |
| sources = [ |
| "criticalpath.go", |
| "criticalpath_test.go", |
| "ninjagraph.go", |
| "ninjagraph_test.go", |
| ] |
| deps = [ |
| "//third_party/golibs:golang.org/x/sync", |
| "//tools/build/ninjago/ninjalog", |
| ] |
| } |
| |
| if (is_host) { |
| _testdata_path = "$target_gen_dir/testdata" |
| |
| go_test("ninjagraph_tests") { |
| gopackages = [ "go.fuchsia.dev/fuchsia/tools/build/ninjago/ninjagraph" ] |
| args = [ |
| "--test_data_dir", |
| rebase_path(_testdata_path, root_build_dir), |
| ] |
| deps = [ |
| ":ninjagraph", |
| "//third_party/golibs:github.com/google/go-cmp", |
| "//tools/build/ninjago/compdb", |
| "//tools/build/ninjago/ninjalog", |
| ] |
| non_go_deps = [ ":testdata" ] |
| } |
| |
| host_test_data("testdata") { |
| sources = [ |
| "//tools/build/ninjago/test_data/compdb.json.gz", |
| "//tools/build/ninjago/test_data/graph.dot.gz", |
| "//tools/build/ninjago/test_data/ninja_log.gz", |
| ] |
| outputs = [ "${_testdata_path}/{{source_file_part}}" ] |
| } |
| } |