| # 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/fidl/fidl.gni") |
| import("//build/test.gni") |
| import("//build/test/test_package.gni") |
| import("//src/sys/build/components.gni") |
| |
| source_set("test_sources") { |
| testonly = true |
| sources = [ |
| "cpp_types_tests.cc", |
| "decoding_tests.cc", |
| "encoding_tests.cc", |
| "fidl_align_tests.cc", |
| "fidl_coded_types.cc", |
| "formatting_tests.cc", |
| "llcpp_client_test.cc", |
| "llcpp_gen_api_test.cc", |
| "llcpp_server_test.cc", |
| "llcpp_transaction_tests.cc", |
| "llcpp_types_tests.cc", |
| "message_tests.cc", |
| "on_error_handle_tests.cc", |
| "validating_tests.cc", |
| ] |
| public_deps = [ |
| ":fidl.test.coding.fuchsia_llcpp", |
| ":fidl.test.coding_llcpp", |
| "//sdk/lib/fdio", |
| "//zircon/public/lib/async", |
| "//zircon/public/lib/async-cpp", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/fidl", |
| "//zircon/public/lib/fidl-llcpp", |
| "//zircon/public/lib/fit", |
| "//zircon/public/lib/sync", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/zxtest", |
| "//zircon/system/ulib/async-loop", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fidl-async", |
| ] |
| } |
| |
| 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" ] |
| } |
| |
| fuchsia_unittest_package("fidl-walker-tests") { |
| executable_path = "bin/walker-tests" |
| deps = [ ":walker_tests_bin" ] |
| } |
| |
| 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", |
| "handle_closing_tests.cc", |
| ] |
| public_deps = [ |
| "//zircon/public/lib/fidl", |
| "//zircon/public/lib/fit", |
| "//zircon/public/lib/zx", |
| "//zircon/public/lib/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_llcpp", |
| ":fidl.test.coding_llcpp", |
| ":tests_to_run_under_handle_policy", |
| "//sdk/lib/fdio", |
| "//third_party/googletest:gtest_main", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/zx", |
| ] |
| } |
| |
| fuchsia_unittest_package("fidl-handle-closing-tests") { |
| manifest = "run_with_handle_policy_tests.cmx" |
| deps = [ ":test_launcher_bin" ] |
| } |
| } |
| |
| source_set("host_test_sources") { |
| testonly = true |
| sources = [ |
| "cpp_types_tests.cc", |
| "decoding_tests.cc", |
| "encoding_tests.cc", |
| "fidl_align_tests.cc", |
| "fidl_coded_types.cc", |
| "validate_string_tests.cc", |
| "validating_tests.cc", |
| ] |
| public_deps = [ |
| ":fidl.test.coding_llcpp", |
| "//zircon/public/lib/fidl_base", |
| "//zircon/public/lib/zxtest", |
| ] |
| } |
| |
| if (is_linux || is_mac) { |
| # Some of the tests can run on host. |
| test("fidl-walker-host-tests") { |
| if (is_fuchsia) { |
| fdio_config = [ "//build/config/fuchsia:fdio_config" ] |
| if (configs + fdio_config - fdio_config != configs) { |
| configs -= fdio_config |
| } |
| } |
| testonly = true |
| sources = [] |
| deps = [ ":host_test_sources" ] |
| } |
| } |
| |
| fidl("fidl.test.coding") { |
| visibility = [ ":*" ] |
| sources = [ "extra_messages.test.fidl" ] |
| host_llcpp = true |
| } |
| |
| fidl("fidl.test.coding.fuchsia") { |
| visibility = [ ":*" ] |
| sources = [ |
| "extra_messages_fuchsia.test.fidl", |
| "llcpp.test.fidl", |
| "messages.test.fidl", |
| ] |
| public_deps = [ "$zx/vdso/zx" ] |
| } |