| # Copyright 2020 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 fxbug.dev/36139. # |
| ########################################## |
| |
| assert(!defined(zx) || zx != "/", |
| "This file can only be used in the Fuchsia GN build.") |
| |
| import("//build/test.gni") |
| import("//src/sys/build/fuchsia_unittest_package.gni") |
| |
| group("test") { |
| testonly = true |
| deps = [ |
| ":trace-vthread-test", |
| ":trace-vthread-with-static-engine-test", |
| ] |
| } |
| |
| # Common pieces of the unittest. |
| source_set("test-common") { |
| testonly = true |
| visibility = [ ":*" ] |
| sources = [ "event_vthread_tests.cc" ] |
| deps = [ |
| "//sdk/lib/fdio", |
| "//zircon/public/lib/async", |
| "//zircon/public/lib/async-cpp", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxtest", |
| "//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/trace", |
| "//zircon/system/ulib/trace-provider:trace-handler", |
| "//zircon/system/ulib/trace-reader", |
| "//zircon/system/ulib/trace-test-utils", |
| "//zircon/system/ulib/trace-vthread", |
| ] |
| } |
| |
| # The unittest for the default case of dynamically linked trace-engine. |
| test("trace-vthread-test") { |
| output_name = "trace-vthread-test-test" |
| 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 = [ |
| ":test-common", |
| "//zircon/system/ulib/trace-engine", |
| ] |
| } |
| |
| # The unittest with a static trace-engine. |
| test("trace-vthread-with-static-engine-test") { |
| output_name = "trace-vthread-with-static-engine-test-test" |
| 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 = [ |
| ":test-common", |
| "//zircon/system/ulib/trace-engine:trace-engine-static", |
| ] |
| } |
| |
| fuchsia_unittest_package("trace-vthread-test-pkg") { |
| package_name = "trace-vthread-test-test" |
| executable_path = "test/trace-vthread-test-test" |
| deps = [ ":trace-vthread-test" ] |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":trace-vthread-test-pkg", |
| ":trace-vthread-with-static-engine-test-pkg", |
| ] |
| } |
| |
| fuchsia_unittest_package("trace-vthread-with-static-engine-test-pkg") { |
| package_name = "trace-vthread-with-static-engine-test-test" |
| executable_path = "test/trace-vthread-with-static-engine-test-test" |
| deps = [ ":trace-vthread-with-static-engine-test" ] |
| } |