| # 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") |
| |
| standalone_libraries = [ |
| "anonymous.test.fidl", |
| "arrays.test.fidl", |
| "bits.test.fidl", |
| "byte_and_bytes.test.fidl", |
| "bits_constants.test.fidl", |
| "constants.test.fidl", |
| "consts.test.fidl", |
| "doc_comments.test.fidl", |
| "driver_handle.test.fidl", |
| "driver_one_way.test.fidl", |
| "driver_two_way.test.fidl", |
| "empty_struct.test.fidl", |
| "encapsulated_structs.test.fidl", |
| "enum.test.fidl", |
| "driver_service.test.fidl", |
| "error.test.fidl", |
| "escaping.test.fidl", |
| "experimental_maybe_from_alias.test.fidl", |
| "experimental_zx_c_types.test.fidl", |
| "handles.test.fidl", |
| "handles_in_types.test.fidl", |
| "inheritance.test.fidl", |
| "inheritance_with_recursive_decl.test.fidl", |
| "new_type.test.fidl", |
| "nullable.test.fidl", |
| "overlay.test.fidl", |
| "padding.test.fidl", |
| "protocol_request.test.fidl", |
| "protocols.test.fidl", |
| "request_flexible_envelope.test.fidl", |
| "service.test.fidl", |
| "string_arrays.test.fidl", |
| "struct.test.fidl", |
| "table.test.fidl", |
| "types_in_protocols.test.fidl", |
| "union.test.fidl", |
| "union_sandwich.test.fidl", |
| "unknown_interactions.test.fidl", |
| "vectors.test.fidl", |
| "versions.test.fidl", |
| ] |
| |
| foreach(filename, standalone_libraries) { |
| library = "test." + |
| string_replace(string_replace(filename, ".test.fidl", ""), "_", "") |
| |
| # TODO(https://fxbug.dev/42179004): Make a special template for golden FIDL libraries so |
| # that they are configured consistently here and in the subdirectories used |
| # for multi-library goldens. |
| fidl(library) { |
| testonly = true |
| sources = [ filename ] |
| public_deps = [ "//zircon/vdso/zx" ] |
| if (filename == "handles.test.fidl") { |
| public_deps += [ "//sdk/fidl/fdf" ] |
| } |
| |
| experimental_flags = [] |
| |
| if (filename == "new_type.test.fidl") { |
| experimental_flags += [ "allow_new_types" ] |
| } |
| |
| if (filename == "experimental_zx_c_types.test.fidl") { |
| experimental_flags += [ "zx_c_types" ] |
| } |
| |
| if (filename == "string_arrays.test.fidl") { |
| experimental_flags += [ "zx_c_types" ] |
| } |
| if (filename == "overlay.test.fidl") { |
| experimental_flags += [ "zx_c_types" ] |
| } |
| |
| if (filename == "versions.test.fidl") { |
| versioned = "test:1" |
| available = [ |
| "fuchsia:HEAD", |
| "test:HEAD", |
| ] |
| } |
| |
| # To output index jsons |
| experimental_flags += [ "output_index_json" ] |
| |
| # Some test files use the driver transport. |
| contains_drivers = true |
| |
| # Generate fuzzers to make sure they build. |
| golden_fuzzer = true |
| disable_rustdoc = true |
| } |
| } |
| |
| # Ensure the files above exist. The test library targets are only reachable |
| # through fidl_testdata_info in info.gni, so when removing a library it's easy |
| # to forget to remove it from standalone_libraries. |
| action("verify_files_exist") { |
| testonly = true |
| script = "//build/scripts/no_op.sh" |
| sources = standalone_libraries |
| outputs = [ "$target_out_dir/files_in_standalone_libraries_exist.verified" ] |
| args = [ rebase_path(outputs[0], root_build_dir) ] |
| } |