| # Copyright 2019 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") |
| |
| go_library("ninjalog") { |
| sources = [ |
| "doc.go", |
| "ninjalog.go", |
| "ninjalog_test.go", |
| "trace.go", |
| "trace_test.go", |
| ] |
| deps = [ |
| "//third_party/golibs:github.com/google/shlex", |
| "//tools/build/ninjago/compdb", |
| "//tools/lib/jsonutil", |
| ] |
| } |
| |
| if (is_host) { |
| _testdata_path = "$target_gen_dir/testdata/ninja_log.gz" |
| |
| go_test("ninjalog_tests") { |
| gopackages = [ "go.fuchsia.dev/fuchsia/tools/build/ninjago/ninjalog" ] |
| args = [ |
| "--test_ninjalog", |
| rebase_path(_testdata_path, root_build_dir), |
| ] |
| deps = [ |
| ":ninjalog", |
| "//third_party/golibs:github.com/google/go-cmp", |
| ] |
| non_go_deps = [ ":testdata" ] |
| } |
| |
| host_test_data("testdata") { |
| sources = [ "//tools/build/ninjago/test_data/ninja_log.gz" ] |
| outputs = [ _testdata_path ] |
| } |
| } |