blob: 5bd4993010a0c5db944964a815b84e8e66ec01e8 [file] [log] [blame]
# 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/toolchain.gni")
# List of information about FIDL test libraries. Each item has:
#
# name
# Unique name to use in golden filenames.
#
# target
# Label of a FIDL target. Its target_name must be unique among all items,
# and identical to the FIDL library name.
#
# denylist
# List of tools that should not generate golden files.
# Allowed items: fidldoc, fidlgen_dart, fidlgen_go, fidlgen_hlcpp,
# fidlgen_libfuzzer, fidlgen_llcpp, fidlgen_rust, fidlgen_syzkaller.
# To exclude a library from fidlc goldens, simply comment the whole item.
#
# build_denylist
# List of tools that should not compile golden bindings.
# Allowed items: fidlgen_dart, fidlgen_go, fidlgen_hlcpp, fidlgen_libfuzzer,
# fidlgen_llcpp, fidlgen_rust.
# Tools from `denylist` are implicitly included.
#
# host_build_denylist
# List of tools that should not compile golden bindings for host.
# Allowed items: fidlgen_hlcpp, fidlgen_llcpp, fidlgen_rust.
# Tools from `build_denylist` are implicitly included.
#
# device_build_denylist
# List of tools that should not compile golden bindings for device.
# Allowed items: fidlgen_hlcpp, fidlgen_llcpp, fidlgen_rust.
# Tools from `build_denylist` are implicitly included.
#
# target_name (computed)
# Name portion of the target.
#
# library (computed)
# Name of the FIDL library (same as `target_name`).
#
# fidl_gen_dir (computed)
# The target's `target_gen_dir` in `fidl_toolchain`.
#
# Please keep sorted by name.
fidl_testdata_info = [
{
name = "anonymous"
target = "//tools/fidl/fidlc/testdata:test.anonymous"
build_denylist = [
# TODO(fxbug.dev/7644): Dart does not support recursive types
"fidlgen_dart",
]
host_build_denylist = [
# TODO(fxbug.dev/62573): Add ifdefs so that protocols compile on host.
"fidlgen_llcpp",
# TODO(fxbug.dev/72247): Encode libfuzzer dependency on HLCPP and LLCPP.
"fidlgen_libfuzzer",
]
},
{
name = "arrays"
target = "//tools/fidl/fidlc/testdata:test.arrays"
},
{
name = "bindings_denylist"
target =
"//tools/fidl/fidlc/testdata/bindings_denylist:test.bindingsdenylist"
host_build_denylist = [
# TODO(fxbug.dev/62573): Add ifdefs so that protocols compile on host.
"fidlgen_llcpp",
# TODO(fxbug.dev/72247): Encode libfuzzer dependency on HLCPP and LLCPP.
"fidlgen_libfuzzer",
]
},
{
name = "bits"
target = "//tools/fidl/fidlc/testdata:test.bits"
},
{
name = "byte_and_bytes"
target = "//tools/fidl/fidlc/testdata:test.byteandbytes"
},
{
name = "consts"
target = "//tools/fidl/fidlc/testdata:test.consts"
build_denylist = [
# TODO(fxbug.dev/62520): Insert enum/bits <-> primitive conversions.
"fidlgen_hlcpp",
"fidlgen_libfuzzer",
"fidlgen_llcpp",
# TODO(fxbug.dev/62763): Fix undefined_identifier errors.
"fidlgen_dart",
]
},
{
name = "constants"
target = "//tools/fidl/fidlc/testdata:test.constants"
denylist = [
# TODO(fxbug.dev/45006): Implement const expressions in fidlgen.
"fidlgen_dart",
"fidlgen_hlcpp",
"fidlgen_libfuzzer",
"fidlgen_llcpp",
]
},
{
name = "bits_constants"
target = "//tools/fidl/fidlc/testdata:test.bitsconstants"
},
{
name = "doc_comments"
target = "//tools/fidl/fidlc/testdata:test.doccomments"
build_denylist = [
# TODO(fxbug.dev/62523): Make protocol named "Interface" compile.
"fidlgen_llcpp",
"fidlgen_libfuzzer",
]
host_build_denylist = [
# TODO(fxbug.dev/62573): Add ifdefs so that protocols compile on host.
"fidlgen_llcpp",
]
},
{
name = "driver_handle"
target = "//tools/fidl/fidlc/testdata:test.driverhandle"
},
{
name = "driver_one_way"
target = "//tools/fidl/fidlc/testdata:test.driveroneway"
build_denylist = [
# TODO(fxbug.dev/101744): Fix.
"fidlgen_libfuzzer",
]
},
{
name = "driver_two_way"
target = "//tools/fidl/fidlc/testdata:test.drivertwoway"
build_denylist = [
# TODO(fxbug.dev/101744): Fix.
"fidlgen_libfuzzer",
]
},
{
name = "empty_struct"
target = "//tools/fidl/fidlc/testdata:test.emptystruct"
build_denylist = [
# TODO(fxbug.dev/101743): Fix.
"fidlgen_libfuzzer",
]
host_build_denylist = [
# TODO(fxbug.dev/62573): Add ifdefs so that protocols compile on host.
"fidlgen_llcpp",
# TODO(fxbug.dev/72247): Encode libfuzzer dependency on HLCPP and LLCPP.
"fidlgen_libfuzzer",
]
},
{
name = "encapsulated_structs"
target = "//tools/fidl/fidlc/testdata:test.encapsulatedstructs"
},
{
name = "enum"
target = "//tools/fidl/fidlc/testdata:test.enum"
build_denylist = [
# TODO(fxbug.dev/101713): Make libfuzzer work with empty flexible enums.
"fidlgen_libfuzzer",
]
},
# TODO(fxbug.dev/64992): Remove, use only error_syntax example.
{
name = "error"
target = "//tools/fidl/fidlc/testdata:test.error"
host_build_denylist = [
# TODO(fxbug.dev/62573): Add ifdefs so that protocols compile on host.
"fidlgen_llcpp",
# TODO(fxbug.dev/72247): Encode libfuzzer dependency on HLCPP and LLCPP.
"fidlgen_libfuzzer",
]
},
{
name = "error_syntax"
target = "//tools/fidl/fidlc/testdata/error_syntax:test.errorsyntax"
},
{
name = "escaping"
target = "//tools/fidl/fidlc/testdata:test.escaping"
},
{
name = "experimental_maybe_from_type_alias"
target = "//tools/fidl/fidlc/testdata:test.experimentalmaybefromtypealias"
denylist = [
# TODO(fxbug.dev/62533): Fix many issues.
"fidlgen_hlcpp",
"fidlgen_libfuzzer",
"fidlgen_llcpp",
]
},
{
name = "foreign_type_in_response_used_through_compose"
target = "//tools/fidl/fidlc/testdata/foreign_type_in_response_used_through_compose:test.foreigntypeinresponseusedthroughcompose"
host_build_denylist = [
# TODO(fxbug.dev/62573): Add ifdefs so that protocols compile on host.
"fidlgen_llcpp",
# TODO(fxbug.dev/72247): Encode libfuzzer dependency on HLCPP and LLCPP.
"fidlgen_libfuzzer",
]
},
{
name = "handles"
target = "//tools/fidl/fidlc/testdata:test.handles"
build_denylist = [
"fidlgen_libfuzzer",
# TODO(fxbug.dev/62524): Fix Ord/Hash trait issue with fidl::Resource.
"fidlgen_rust",
]
},
{
name = "handles_in_types"
target = "//tools/fidl/fidlc/testdata:test.handlesintypes"
},
{
name = "imported_const_values"
target = "//tools/fidl/fidlc/testdata/imported_const_values:test.importedconstvalues"
},
{
name = "inheritance"
target = "//tools/fidl/fidlc/testdata:test.inheritance"
host_build_denylist = [
# TODO(fxbug.dev/62573): Add ifdefs so that protocols compile on host.
"fidlgen_llcpp",
# TODO(fxbug.dev/72247): Encode libfuzzer dependency on HLCPP and LLCPP.
"fidlgen_libfuzzer",
]
},
{
name = "inheritance_with_recursive_decl"
target = "//tools/fidl/fidlc/testdata:test.inheritancewithrecursivedecl"
host_build_denylist = [
# TODO(fxbug.dev/62573): Add ifdefs so that protocols compile on host.
"fidlgen_llcpp",
# TODO(fxbug.dev/72247): Encode libfuzzer dependency on HLCPP and LLCPP.
"fidlgen_libfuzzer",
]
},
{
name = "nullable"
target = "//tools/fidl/fidlc/testdata:test.nullable"
host_build_denylist = [
# TODO(fxbug.dev/62573): Add ifdefs so that protocols compile on host.
"fidlgen_llcpp",
]
},
{
name = "padding"
target = "//tools/fidl/fidlc/testdata:test.padding"
},
{
name = "placement_of_attributes"
target = "//tools/fidl/fidlc/testdata/placement_of_attributes:test.placementofattributes"
host_build_denylist = [
# TODO(fxbug.dev/62573): Add ifdefs so that protocols compile on host.
"fidlgen_llcpp",
# TODO(fxbug.dev/72247): Encode libfuzzer dependency on HLCPP and LLCPP.
"fidlgen_libfuzzer",
]
},
{
name = "protocol_layouts"
target = "//tools/fidl/fidlc/testdata/protocol_layouts:test.protocollayouts"
# TODO(fxbug.dev/96310): Possibly add backend support for syzkaller.
denylist = [ "fidlgen_syzkaller" ]
},
{
name = "protocol_payloads"
target =
"//tools/fidl/fidlc/testdata/protocol_payloads:test.protocolpayloads"
},
{
name = "protocol_request"
target = "//tools/fidl/fidlc/testdata:test.protocolrequest"
build_denylist = [
# TODO(fxbug.dev/62532): Fix many issues.
"fidlgen_llcpp",
# TODO(fxbug.dev/72247): Encode libfuzzer dependency on HLCPP and LLCPP.
"fidlgen_libfuzzer",
]
host_build_denylist = [
# TODO(fxbug.dev/62573): Add ifdefs so that protocols compile on host.
"fidlgen_llcpp",
# TODO(fxbug.dev/72247): Encode libfuzzer dependency on HLCPP and LLCPP.
"fidlgen_libfuzzer",
]
},
{
name = "protocols"
target = "//tools/fidl/fidlc/testdata:test.protocols"
build_denylist = [
# TODO(fxbug.dev/101744): Fix.
"fidlgen_libfuzzer",
]
host_build_denylist = [
# TODO(fxbug.dev/62573): Add ifdefs so that protocols compile on host.
"fidlgen_llcpp",
# TODO(fxbug.dev/72247): Encode libfuzzer dependency on HLCPP and LLCPP.
"fidlgen_libfuzzer",
]
},
{
name = "request_flexible_envelope"
target = "//tools/fidl/fidlc/testdata:test.requestflexibleenvelope"
host_build_denylist = [
# TODO(fxbug.dev/62573): Add ifdefs so that protocols compile on host.
"fidlgen_llcpp",
]
},
{
name = "service"
target = "//tools/fidl/fidlc/testdata:test.service"
host_build_denylist = [
# TODO(fxbug.dev/62573): Add ifdefs so that protocols compile on host.
"fidlgen_llcpp",
# TODO(fxbug.dev/72247): Encode libfuzzer dependency on HLCPP and LLCPP.
"fidlgen_libfuzzer",
]
},
{
name = "struct"
target = "//tools/fidl/fidlc/testdata:test.struct"
},
{
name = "struct_default_value_enum_library_reference"
target = "//tools/fidl/fidlc/testdata/struct_default_value_enum_library_reference:test.structdefaultvalueenumlibraryreference"
denylist = [
# TODO(fxbug.dev/45007): Syzkaller does not support enum member references
# in struct defaults.
"fidlgen_syzkaller",
]
build_denylist = [
# TODO(fxbug.dev/62761): Fix error about default value not being constant.
"fidlgen_dart",
]
},
{
name = "table"
target = "//tools/fidl/fidlc/testdata:test.table"
},
{
name = "transitive_dependencies"
target = "//tools/fidl/fidlc/testdata/transitive_dependencies:test.transitivedependencies"
},
{
name = "transitive_dependencies_compose"
target = "//tools/fidl/fidlc/testdata/transitive_dependencies_compose:test.transitivedependenciescompose"
host_build_denylist = [
# TODO(fxbug.dev/62573): Add ifdefs so that protocols compile on host.
"fidlgen_llcpp",
# TODO(fxbug.dev/72247): Encode libfuzzer dependency on HLCPP and LLCPP.
"fidlgen_libfuzzer",
]
},
{
name = "type_aliases"
target = "//tools/fidl/fidlc/testdata/type_aliases:test.typealiases"
},
{
name = "union"
target = "//tools/fidl/fidlc/testdata:test.union"
build_denylist = [
# TODO(fxbug.dev/55889): Escape "union" keyword.
"fidlgen_llcpp",
"fidlgen_libfuzzer",
]
host_build_denylist = [
# TODO(fxbug.dev/62573): Add ifdefs so that protocols compile on host.
"fidlgen_llcpp",
]
},
{
name = "union_sandwich"
target = "//tools/fidl/fidlc/testdata:test.unionsandwich"
host_build_denylist = [
# TODO(fxbug.dev/62573): Add ifdefs so that protocols compile on host.
"fidlgen_llcpp",
]
},
{
name = "unknown_interactions"
target = "//tools/fidl/fidlc/testdata:test.unknowninteractions"
},
{
name = "vectors"
target = "//tools/fidl/fidlc/testdata:test.vectors"
},
{
name = "versions"
target = "//tools/fidl/fidlc/testdata:test.versions"
host_build_denylist = [
# TODO(fxbug.dev/62573): Add ifdefs so that protocols compile on host.
"fidlgen_llcpp",
]
},
]
# Add computed properties.
_fidl_testdata_info = fidl_testdata_info
fidl_testdata_info = []
foreach(info, _fidl_testdata_info) {
info.target_name = get_label_info(info.target, "name")
info.library = info.target_name
info.fidl_gen_dir =
get_label_info("${info.target}($fidl_toolchain)", "target_gen_dir")
# Enforce consistent naming. This also ensures that subdirectories are only
# used for wiring up dependencies, not for categorization (see README.md).
desired_target_name = "test." + string_replace(info.name, "_", "")
assert(info.target_name == desired_target_name,
"Expected ${info.target} to have name $desired_target_name")
dir_name = get_path_info(get_label_info(info.target, "dir"), "file")
assert(dir_name == "testdata" || dir_name == info.name,
"Expected ${info.target} to be in testdata/ or testdata/${info.name}/")
if (!defined(info.denylist)) {
info.denylist = []
}
if (!defined(info.build_denylist)) {
info.build_denylist = []
}
if (!defined(info.host_build_denylist)) {
info.host_build_denylist = []
}
if (!defined(info.device_build_denylist)) {
info.device_build_denylist = []
}
info.build_denylist += info.denylist
info.host_build_denylist += info.build_denylist
info.device_build_denylist += info.build_denylist
fidl_testdata_info += [ info ]
}