| # 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. |
| |
| ########################################## |
| # Though under //zircon, this build file # |
| # is meant to be used in the Fuchsia GN # |
| # build. # |
| # See fxb/36139. # |
| ########################################## |
| |
| assert(!defined(zx) || zx != "/", |
| "This file can only be used in the Fuchsia GN build.") |
| |
| import("//build/test.gni") |
| import("//build/unification/images/migrated_manifest.gni") |
| |
| # Common pieces. |
| source_set("common") { |
| 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/public/lib/async", |
| "//zircon/public/lib/async-cpp", |
| "//zircon/public/lib/async-default", |
| "//zircon/public/lib/async-loop", |
| "//zircon/public/lib/async-loop-cpp", |
| "//zircon/public/lib/async-loop-default", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/trace", |
| |
| # The engine is chosen by the binary, we just need engine headers here. |
| "//zircon/public/lib/trace-engine-headers-for-reader", |
| "//zircon/public/lib/unittest", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/trace-reader", |
| "//zircon/system/ulib/trace-test-utils", |
| |
| # fdio is here so that things like printf work. |
| # Otherwise they silently fail (output is dropped). |
| "//zircon/public/lib/fdio", |
| ] |
| |
| # TODO(41900): 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" ] |
| } |
| |
| # Version of test that uses libtrace-engine.so. |
| test("trace") { |
| # Dependent manifests unfortunately cannot be marked as `testonly`. |
| # TODO(44278): Remove when converting this file to proper GN build idioms. |
| if (is_fuchsia) { |
| testonly = false |
| } |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| 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/public/lib/trace-engine", |
| ] |
| data_deps = [ ":trace-static-engine" ] |
| } |
| |
| # And again using libtrace-engine.a. |
| test("trace-static-engine") { |
| # Dependent manifests unfortunately cannot be marked as `testonly`. |
| # TODO(44278): Remove when converting this file to proper GN build idioms. |
| if (is_fuchsia) { |
| testonly = false |
| } |
| if (is_fuchsia) { |
| configs += [ "//build/unification/config:zircon-migrated" ] |
| } |
| if (is_fuchsia) { |
| fdio_config = [ "//build/config/fuchsia:fdio_config" ] |
| if (configs + fdio_config - fdio_config != configs) { |
| configs -= fdio_config |
| } |
| } |
| deps = [ |
| ":common", |
| "//zircon/public/lib/trace-engine", |
| ] |
| } |
| |
| migrated_manifest("trace-manifest") { |
| deps = [ ":trace" ] |
| } |
| |
| migrated_manifest("trace-static-engine-manifest") { |
| deps = [ ":trace-static-engine" ] |
| } |