| # 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") |
| |
| source_set("test_utils") { |
| testonly = true |
| |
| sources = [ |
| "run_program.cc", |
| "run_program.h", |
| ] |
| |
| public_deps = [ |
| "//sdk/lib/async-loop:async-loop-cpp", |
| "//sdk/lib/fdio", |
| "//sdk/lib/sys/cpp", |
| "//src/lib/fxl", |
| "//src/lib/fxl:cli", |
| "//zircon/system/ulib/zx", |
| ] |
| |
| deps = [ "//src/lib/fsl" ] |
| } |
| |
| executable("tracing_test_utils_tests_app") { |
| testonly = true |
| output_name = "tracing_test_utils_tests" |
| |
| sources = [ "run_program_tests.cc" ] |
| |
| deps = [ |
| ":test_utils", |
| "//src/lib/fxl/test:gtest_main", |
| ] |
| } |
| |
| executable("tracing_test_utils_return_1234") { |
| testonly = true |
| output_dir = target_out_dir |
| output_name = "return_1234" |
| |
| sources = [ "return_1234.cc" ] |
| } |
| |
| executable("tracing_test_utils_signal_peer") { |
| testonly = true |
| output_dir = target_out_dir |
| output_name = "signal_peer" |
| |
| sources = [ "signal_peer.cc" ] |
| |
| deps = [ "//zircon/system/ulib/zx" ] |
| } |
| |
| fuchsia_unittest_package("tracing_test_utils_tests") { |
| manifest = "meta/tracing_test_utils_tests.cml" |
| deps = [ |
| ":tracing_test_utils_return_1234", |
| ":tracing_test_utils_signal_peer", |
| ":tracing_test_utils_tests_app", |
| ] |
| } |
| |
| # This is a library for use in Fuchsia-side tests that will start and stop |
| # tracing in order to capture a trace from a test. This contrasts with the |
| # alternative of starting and stopping tracing from the host-side part of |
| # a test. Starting and stopping tracing from the Fuchsia side makes it |
| # easier to enable tracing only for the part of the test we're interested in, |
| # reducing the size of the trace, and it can avoid the need for host-side |
| # test code. |
| source_set("trace_controller") { |
| testonly = true |
| sources = [ |
| "trace_controller.cc", |
| "trace_controller.h", |
| ] |
| public_deps = [ |
| "//sdk/fidl/fuchsia.tracing.controller:fuchsia.tracing.controller_cpp", |
| "//sdk/lib/component/incoming/cpp", |
| "//sdk/lib/syslog/cpp", |
| "//zircon/system/ulib/trace-provider", |
| ] |
| deps = [ "//src/lib/fsl" ] |
| } |