blob: 363d61ad03d14d8a55df8f0c77a20d625f5168f8 [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/components.gni")
import("//build/test.gni")
import("//build/testing/bootfs_test.gni")
# Common pieces.
source_set("common") {
testonly = true
visibility = [ ":*" ]
sources = [
"engine_tests.cc",
"event_tests.c",
"event_tests.cc",
"event_tests_ntrace.c",
"event_tests_ntrace.cc",
"fields_tests.cc",
"no_optimization.c",
"record_tests.cc",
]
deps = [
"//zircon/system/ulib/async",
"//zircon/system/ulib/async:async-cpp",
"//zircon/system/ulib/async-default",
"//zircon/system/ulib/async-loop",
"//zircon/system/ulib/async-loop:async-loop-cpp",
"//zircon/system/ulib/async-loop:async-loop-default",
"//zircon/system/ulib/fbl",
"//zircon/system/ulib/trace",
# The engine is chosen by the binary, we just need engine headers here.
"//zircon/system/ulib/trace-engine:trace-engine-headers-for-reader",
"//zircon/system/ulib/trace-reader",
"//zircon/system/ulib/trace-test-utils",
"//zircon/system/ulib/zx",
"//zircon/system/ulib/zxtest",
# fdio is here so that things like printf work.
# Otherwise they silently fail (output is dropped).
"//sdk/lib/fdio",
]
}
# Version of test that uses libtrace-engine.so.
test("trace") {
if (is_fuchsia) {
fdio_config = [ "//build/config/fuchsia:fdio_config" ]
if (configs + fdio_config - fdio_config != configs) {
configs -= fdio_config
}
}
output_dir = "$root_out_dir/zircon-migrated"
deps = [
":common",
"//zircon/system/ulib/trace-engine",
]
data_deps = [ ":trace-static-engine" ]
}
# And again using libtrace-engine.a.
test("trace-static-engine") {
if (is_fuchsia) {
fdio_config = [ "//build/config/fuchsia:fdio_config" ]
if (configs + fdio_config - fdio_config != configs) {
configs -= fdio_config
}
}
deps = [
":common",
"//zircon/system/ulib/trace-engine",
]
}
bootfs_test("trace-bootfs-test") {
name = "trace"
deps = [ ":trace" ]
}
fuchsia_unittest_package("trace-static-engine-test-pkg") {
package_name = "trace-static-engine"
deps = [ ":trace-static-engine" ]
}
group("tests") {
testonly = true
deps = [ ":trace-static-engine-test-pkg" ]
}