| # 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") |
| import("//build/test.gni") |
| |
| group("tests") { |
| testonly = true |
| deps = [ |
| ":fit($host_toolchain)", |
| ":fit-test-pkg", |
| ":fit-unittest($host_toolchain)", |
| ":fit-unittest-pkg", |
| ] |
| } |
| |
| test("fit-unittest") { |
| output_name = "fit-unittest-test" |
| if (is_fuchsia) { |
| fdio_config = [ "//build/config/fuchsia:fdio_config" ] |
| if (configs + fdio_config - fdio_config != configs) { |
| configs -= fdio_config |
| } |
| } |
| sources = [ "thread_checker_tests.cc" ] |
| deps = [ |
| "//sdk/lib/fit", |
| "//zircon/system/ulib/zxtest", |
| ] |
| configs += [ ":Wshadow" ] |
| configs += [ "//build/config:test_exercising_sdk_headers" ] |
| if (is_fuchsia) { |
| deps += [ "//sdk/lib/fdio" ] |
| } |
| } |
| |
| # TODO: Convert these to zxtest and move them into the test above. |
| test("fit") { |
| if (is_fuchsia) { |
| fdio_config = [ "//build/config/fuchsia:fdio_config" ] |
| if (configs + fdio_config - fdio_config != configs) { |
| configs -= fdio_config |
| } |
| } |
| sources = [ |
| "defer_tests.cc", |
| "examples/function_example1.cc", |
| "examples/function_example2.cc", |
| "function_examples.cc", |
| "function_tests.cc", |
| "function_traits_tests.cc", |
| "inline_any_multi_inheritance_tests.cc", |
| "inline_any_tests.cc", |
| "nullable_tests.cc", |
| "thread_checker_tests.cc", |
| "traits_tests.cc", |
| "utility_internal_tests.cc", |
| ] |
| deps = [ |
| "//sdk/lib/fit", |
| "//zircon/system/ulib/zxtest", |
| ] |
| configs += [ ":Wshadow" ] |
| configs += [ "//build/config:test_exercising_sdk_headers" ] |
| if (is_fuchsia) { |
| deps += [ "//sdk/lib/fdio" ] |
| } |
| } |
| |
| # TODO(https://fxbug.dev/42071929): Remove -Wshadow when all SDK code builds with that flag. |
| config("Wshadow") { |
| cflags_cc = [ "-Wshadow" ] |
| } |
| |
| fuchsia_unittest_package("fit-test-pkg") { |
| package_name = "fit" |
| deps = [ ":fit" ] |
| } |
| |
| fuchsia_unittest_package("fit-unittest-pkg") { |
| package_name = "fit-unittest-test" |
| deps = [ ":fit-unittest" ] |
| } |