| # 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. |
| |
| import("//build/components.gni") |
| import("//build/fidl/fidl.gni") |
| import("//build/test.gni") |
| import("//tools/fidl/gidl/gidl.gni") |
| |
| source_set("test_sources") { |
| testonly = true |
| sources = [ |
| "fidl_align_tests.cc", |
| "fidl_coded_types.cc", |
| "formatting_tests.cc", |
| "validating_tests.cc", |
| ] |
| public_deps = [ |
| ":fidl.test.coding.fuchsia_cpp", |
| ":fidl.test.coding.fuchsia_hlcpp", |
| ":fidl.test.coding_cpp", |
| ":fidl.test.coding_hlcpp", |
| "//sdk/lib/fidl", |
| "//sdk/lib/fidl/cpp:cpp_base", |
| "//sdk/lib/fit", |
| "//zircon/system/ulib/async", |
| "//zircon/system/ulib/async:async-cpp", |
| "//zircon/system/ulib/async-loop", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/sync", |
| "//zircon/system/ulib/zx", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| if (is_fuchsia) { |
| executable("walker_tests_bin") { |
| output_name = "walker-tests" |
| fdio_config = [ "//build/config/fuchsia:fdio_config" ] |
| if (configs + fdio_config - fdio_config != configs) { |
| configs -= fdio_config |
| } |
| testonly = true |
| sources = [] |
| deps = [ |
| ":test_sources", |
| "//sdk/lib/fdio", |
| ] |
| } |
| |
| fuchsia_unittest_package("fidl-walker-tests") { |
| deps = [ ":walker_tests_bin" ] |
| deprecated_legacy_test_execution = true |
| } |
| |
| executable("tests_to_run_under_handle_policy") { |
| # this must match the requested binary in run_with_handle_policy_tests.cc |
| output_name = "fidl-handle-policy-test-app" |
| testonly = true |
| sources = [ "fidl_coded_types.cc" ] |
| public_deps = [ |
| "//sdk/lib/fidl", |
| "//sdk/lib/fit", |
| "//zircon/system/ulib/zx", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| executable("test_launcher_bin") { |
| testonly = true |
| output_name = "run_with_handle_policy_tests" |
| sources = [ "run_with_handle_policy_tests.cc" ] |
| deps = [ |
| ":fidl.test.coding.fuchsia_cpp", |
| ":fidl.test.coding_cpp", |
| ":tests_to_run_under_handle_policy", |
| "//sdk/lib/fdio", |
| "//src/lib/fxl/test:gtest_main", |
| "//zircon/system/ulib/fbl", |
| "//zircon/system/ulib/zx", |
| ] |
| } |
| |
| fuchsia_unittest_package("fidl-handle-closing-tests") { |
| manifest = "run_with_handle_policy_tests.cml" |
| deps = [ ":test_launcher_bin" ] |
| } |
| } |
| |
| source_set("host_test_sources") { |
| testonly = true |
| sources = [ |
| "fidl_align_tests.cc", |
| "fidl_coded_types.cc", |
| "validating_tests.cc", |
| ] |
| public_deps = [ |
| ":fidl.test.coding_cpp", |
| ":fidl.test.coding_hlcpp", |
| "//sdk/lib/fidl/cpp:cpp_base", |
| "//sdk/lib/fidl_base", |
| "//zircon/system/ulib/zxtest", |
| ] |
| } |
| |
| if (!is_fuchsia) { |
| # Some of the tests can run on host. |
| test("fidl-walker-host-tests") { |
| testonly = true |
| sources = [] |
| deps = [ ":host_test_sources" ] |
| } |
| } |
| |
| fidl("fidl.test.coding") { |
| testonly = true |
| visibility = [ ":*" ] |
| sources = [ "extra_messages.test.fidl" ] |
| enable_hlcpp = true |
| } |
| |
| fidl("fidl.test.coding.fuchsia") { |
| testonly = true |
| visibility = [ ":*" ] |
| sources = [ |
| "extra_messages_fuchsia.test.fidl", |
| "messages.test.fidl", |
| ] |
| public_deps = [ "//zircon/vdso/zx" ] |
| enable_hlcpp = true |
| } |