| # 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/unification/zx_library.gni") |
| |
| zx_library("unittest") { |
| sdk = "shared" |
| sdk_headers = [ "unittest/unittest.h" ] |
| testonly = true |
| host = true |
| shared = true |
| sources = [ |
| "all-tests.cc", |
| "unittest-main.cc", |
| "unittest.cc", |
| "watchdog.cc", |
| ] |
| deps = [ "//zircon/public/lib/pretty" ] |
| if (current_os == "linux") { |
| libs = [ "pthread" ] |
| } |
| if (is_fuchsia) { |
| deps += [ |
| "//zircon/public/lib/zx", |
| "//zircon/system/ulib/test-exceptions", |
| ] |
| } |
| |
| # TODO(fxbug.dev/58162): delete the below and fix compiler warnings |
| configs += [ "//build/config:Wno-conversion" ] |
| metadata = { |
| # Used by the fuchsia_test_component_manifest() template. |
| test_component_manifest_cml = [ |
| { |
| include = [ "src/sys/test_runners/elf/default.shard.cml" ] |
| }, |
| ] |
| } |
| } |
| |
| # This static version is used for host binaries in the GN build. |
| zx_library("unittest-static") { |
| sdk = "static" |
| sdk_headers = [ "unittest/unittest.h" ] |
| testonly = true |
| host = true |
| sources = [ |
| "all-tests.cc", |
| "unittest-main.cc", |
| "unittest.cc", |
| "watchdog.cc", |
| ] |
| deps = [ "//zircon/public/lib/pretty" ] |
| if (current_os == "linux") { |
| libs = [ "pthread" ] |
| } |
| if (is_fuchsia) { |
| deps += [ "//zircon/system/ulib/test-exceptions" ] |
| } |
| metadata = { |
| # Used by the fuchsia_test_component_manifest() template. |
| test_component_manifest_cml = [ |
| { |
| include = [ "src/sys/test_runners/elf/default.shard.cml" ] |
| }, |
| ] |
| } |
| } |
| |
| group("tests") { |
| testonly = true |
| deps = [ "test:tests" ] |
| } |