| # 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 fxb/36139. # |
| ########################################## |
| |
| assert(!defined(zx) || zx != "/", |
| "This file can only be used in the Fuchsia GN build.") |
| |
| import("//build/test.gni") |
| import("//build/test/test_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") { |
| visibility = [ ":*" ] |
| sources = [ "event_vthread_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/fdio", |
| "//zircon/public/lib/trace", |
| "//zircon/public/lib/trace-handler", |
| "//zircon/public/lib/trace-vthread", |
| "//zircon/public/lib/unittest", |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/trace-reader", |
| "//zircon/system/ulib/trace-test-utils", |
| ] |
| } |
| |
| # The unittest for the default case of dynamically linked trace-engine. |
| test("trace-vthread-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/public/lib/trace-engine", |
| ] |
| } |
| |
| # The unittest with a static trace-engine. |
| test("trace-vthread-with-static-engine-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/public/lib/trace-engine-static", |
| ] |
| } |
| |
| unittest_package("trace-vthread-test-package") { |
| package_name = "trace-vthread-test" |
| deps = [ ":trace-vthread-test" ] |
| |
| tests = [ |
| { |
| name = "trace-vthread-test" |
| dest = "trace-vthread-test-test" |
| }, |
| ] |
| } |
| |
| unittest_package("trace-vthread-with-static-engine-test-package") { |
| package_name = "trace-vthread-with-static-engine-test" |
| deps = [ ":trace-vthread-with-static-engine-test" ] |
| |
| tests = [ |
| { |
| name = "trace-vthread-with-static-engine-test" |
| dest = "trace-vthread-with-static-engine-test-test" |
| }, |
| ] |
| } |