blob: 253bfad63ae43e86ffe760a8ddf0a5656dfa00c9 [file] [log] [blame]
# 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/host.gni")
import("//build/package.gni")
import("//build/sdk/sdk_host_tool.gni")
import("//build/test.gni")
import("//build/testing/host_test_data.gni")
executable("bin") {
output_name = "trace2json"
sources = [ "main.cc" ]
deps = [
":lib",
"//src/lib/fxl",
]
}
source_set("lib") {
sources = [
"convert.cc",
"convert.h",
"trace_parser.cc",
"trace_parser.h",
]
deps = [ "//src/lib/fxl" ]
public_deps = [
"//garnet/lib/trace_converters:chromium",
"//third_party/zlib:zfstream",
"//zircon/system/ulib/trace-reader",
# TODO(fxbug.dev/57392): Move it back to //third_party once unification completes.
"//zircon/third_party/rapidjson",
]
configs += [
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
"//build/config:Wno-conversion",
]
}
sdk_host_tool("bin_sdk") {
category = "partner"
output_name = "trace2json"
deps = [ ":bin" ]
}
install_host_tools("trace2json") {
deps = [ ":bin" ]
outputs = [ "trace2json" ]
}
if (is_host) {
host_test_data("test_data") {
sources = [
"test_data/example_benchmark.fxt",
"test_data/example_benchmark_expected.json",
"test_data/no_magic.fxt",
"test_data/simple_trace.fxt",
"test_data/simple_trace.fxt.gz",
"test_data/simple_trace_expected.json",
"test_data/simple_trace_expected.json.gz",
]
outputs = [ "$root_out_dir/test_data/trace2json/{{source_file_part}}" ]
}
test("trace2json_tests") {
output_name = "trace2json_tests"
sources = [
"convert_test.cc",
"trace_parser_test.cc",
]
deps = [
":lib",
"//src/lib/fxl/test:gtest_main",
"//third_party/googletest:gtest",
]
data_deps = [ ":test_data" ]
# TODO(fxbug.dev/58162): delete the below and fix compiler warnings
configs += [ "//build/config:Wno-conversion" ]
}
}