| # 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/fidl/fidl.gni") |
| import("//build/test.gni") |
| import("//build/test/test_package.gni") |
| import("//build/testing/environments.gni") |
| import("//src/tests/fidl/conformance_suite/gidl-conformance-suite.gni") |
| import("//tools/fidl/gidl/gidl.gni") |
| |
| gidl_deps = [] |
| foreach(gidl_file, conformance_suite_gidl_files) { |
| gidl_name = get_path_info(gidl_file, "name") |
| target = "conformance_suite__${gidl_name}" |
| gidl_deps += [ ":" + target ] |
| gidl_llcpp_conformance(target) { |
| testonly = true |
| inputs = [ gidl_file ] |
| fidl = conformance_suite_fidl_target |
| deps = [ "//third_party/googletest:gtest" ] |
| if (is_fuchsia) { |
| deps += [ "//sdk/lib/fidl/cpp:handle_util" ] |
| } |
| } |
| } |
| |
| executable("fidl_llcpp_conformance_test_bin") { |
| testonly = true |
| |
| output_name = "fidl_llcpp_conformance_test" |
| |
| sources = [ |
| "manual_conformance_test.cc", |
| "test_utils.cc", |
| ] |
| |
| deps = [ |
| "//sdk/lib/fidl/cpp/test:fidl_test_llcpp", |
| "//src/lib/fxl/test:gtest_main", |
| "//src/tests/fidl/conformance_suite:conformance_fidl_llcpp", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/fbl", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| ] + gidl_deps |
| } |
| |
| test_package("fidl-llcpp-conformance-test") { |
| deps = [ ":fidl_llcpp_conformance_test_bin" ] |
| |
| tests = [ |
| { |
| name = "fidl_llcpp_conformance_test" |
| environments = basic_envs |
| }, |
| ] |
| } |
| |
| test("fidl_llcpp_conformance_test") { |
| output_name = "fidl_llcpp_conformance_host_test" |
| sources = [ "test_utils.cc" ] |
| deps = [ |
| "//src/lib/fxl/test:gtest_main", |
| "//src/tests/fidl/conformance_suite:conformance_fidl_llcpp", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/fbl", |
| ] |
| } |
| |
| fidl("fidl.llcpp.types.test") { |
| sources = [ "types.test.fidl" ] |
| } |
| |
| fidl("fidl.llcpp.linearized.test") { |
| sources = [ "linearized.test.fidl" ] |
| } |
| |
| fidl("llcpptest.flexible.test") { |
| sources = [ "flexible.test.fidl" ] |
| } |
| |
| fidl("llcpptest.protocol.test") { |
| sources = [ "protocol.test.fidl" ] |
| public_deps = [ "//zircon/vdso/zx" ] |
| } |
| |
| fidl("llcpptest.handles.test") { |
| sources = [ "handles.test.fidl" ] |
| public_deps = [ "//zircon/vdso/zx" ] |
| } |
| |
| fidl("llcpptest.transitional.test") { |
| sources = [ "transitional.test.fidl" ] |
| } |
| |
| executable("fidl_llcpp_types_test_bin") { |
| testonly = true |
| |
| output_name = "fidl_llcpp_types_test" |
| |
| sources = [ |
| "bits_test.cc", |
| "enum_test.cc", |
| "flexible_test.cc", |
| "handle_test.cc", |
| "linearized_and_encoded_test.cc", |
| "protocol_test.cc", |
| "table_test.cc", |
| "test_utils.cc", |
| "traits_test.cc", |
| "transitional_test.cc", |
| "types_test_utils.cc", |
| "xunion_test.cc", |
| ] |
| |
| deps = [ |
| ":fidl.llcpp.linearized.test_llcpp", |
| ":fidl.llcpp.types.test_llcpp", |
| ":llcpptest.flexible.test_llcpp", |
| ":llcpptest.handles.test_llcpp", |
| ":llcpptest.protocol.test_llcpp", |
| ":llcpptest.transitional.test_llcpp", |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/fidl-llcpp", |
| "//zircon/system/ulib/async-loop:async-loop-cpp", |
| "//zircon/system/ulib/async-loop:async-loop-default", |
| "//zircon/system/ulib/fidl-async:fidl-async-cpp", |
| ] |
| } |
| |
| package("fidl_llcpp_types_test") { |
| testonly = true |
| |
| deps = [ ":fidl_llcpp_types_test_bin" ] |
| |
| meta = [ |
| { |
| path = "fidl_llcpp_types_test.cmx" |
| dest = "fidl_llcpp_types_test.cmx" |
| }, |
| ] |
| |
| tests = [ |
| { |
| name = "fidl_llcpp_types_test" |
| environments = basic_envs |
| }, |
| ] |
| } |
| |
| executable("fidl_llcpp_builder_test_bin") { |
| testonly = true |
| |
| output_name = "fidl_llcpp_builder_test" |
| |
| sources = [ |
| "aligned_test.cc", |
| "allocator_test.cc", |
| "buffer_then_heap_allocator_test.cc", |
| "failover_allocator_test.cc", |
| "heap_allocator_test.cc", |
| "memory_test.cc", |
| "tracking_ptr_test.cc", |
| "unowned_ptr_test.cc", |
| "unsafe_buffer_allocator_test.cc", |
| "vector_view_test.cc", |
| ] |
| |
| deps = [ |
| "//src/lib/fxl/test:gtest_main", |
| "//third_party/googletest:gtest", |
| "//zircon/public/lib/fbl", |
| "//zircon/public/lib/fidl", |
| "//zircon/public/lib/fidl-llcpp", |
| ] |
| } |
| |
| package("fidl_llcpp_builder_test") { |
| testonly = true |
| |
| deps = [ ":fidl_llcpp_builder_test_bin" ] |
| |
| meta = [ |
| { |
| path = "fidl_llcpp_builder_test.cmx" |
| dest = "fidl_llcpp_builder_test.cmx" |
| }, |
| ] |
| |
| tests = [ |
| { |
| name = "fidl_llcpp_builder_test" |
| environments = basic_envs |
| }, |
| ] |
| } |
| |
| group("tests") { |
| testonly = true |
| public_deps = [ |
| ":fidl-llcpp-conformance-test", |
| ":fidl_llcpp_builder_test", |
| ":fidl_llcpp_conformance_test($host_toolchain)", |
| ":fidl_llcpp_types_test", |
| ] |
| } |