blob: e5b118af82c5b2467b78e22f5bfd0650dd67b659 [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/test.gni")
import("//build/test/test_package.gni")
import("//build/testing/environments.gni")
executable("bin") {
output_name = "netdump"
sources = [
"filter.cc",
"netdump.cc",
"parser.cc",
"tokens.cc",
]
deps = [
":common",
"//sdk/fidl/fuchsia.hardware.ethernet:fuchsia.hardware.ethernet_c_client",
"//zircon/public/lib/pretty",
]
}
source_set("common") {
visibility = [ ":*" ]
public_deps = [
"//zircon/public/lib/fbl",
"//zircon/public/lib/fdio",
"//zircon/public/lib/zx",
]
}
test("unit_tests") {
output_name = "netdump_unit_tests"
sources = [
"filter.cc",
"parser.cc",
"test/filter_builder_test.cc",
"test/filter_test.cc",
"test/parser_test.cc",
"test/tokens_test.cc",
"tokens.cc",
]
include_dirs = [ "." ]
deps = [
":common",
"//zircon/public/lib/mock-function",
"//zircon/public/lib/zxtest",
]
# TODO(46765): Fix the leaks and remove this.
deps += [ "//build/config/sanitizers:suppress-lsan.DO-NOT-USE-THIS" ]
# TODO(46920): UBSan has found an instance of undefined behavior in this target.
# Disable UBSan for this target temporarily until it is migrated into CI/CQ.
configs += [ "//build/config:temporarily_disable_ubsan_do_not_use" ]
}
group("tests") {
testonly = true
deps = [
":netdump",
":netdump_unit_tests",
"integration:tests",
]
}
package("netdump") {
meta = [
{
path = rebase_path("meta/netdump.cmx")
dest = "netdump.cmx"
},
]
deps = [ ":bin" ]
binaries = [
{
name = "netdump"
shell = true
},
]
}
unittest_package("netdump_unit_tests") {
deps = [ ":unit_tests" ]
tests = [
{
name = "netdump_unit_tests"
environments = basic_envs
},
]
}