tree: 976a493cc8d8b41c47d99a951a744a90d63313fd [path history] [tgz]
  1. aliases/
  2. bindings_denylist/
  3. error_syntax/
  4. foreign_type_in_response_used_through_compose/
  5. imported_const_values/
  6. placement_of_attributes/
  7. protocol_layouts/
  8. protocol_layouts_same_library/
  9. protocol_payloads/
  10. struct_default_value_enum_library_reference/
  11. transitive_dependencies/
  12. transitive_dependencies_compose/
  13. anonymous.test.fidl
  14. arrays.test.fidl
  15. bits.test.fidl
  16. bits_constants.test.fidl
  17. BUILD.gn
  18. byte_and_bytes.test.fidl
  19. constants.test.fidl
  20. consts.test.fidl
  21. doc_comments.test.fidl
  22. driver_handle.test.fidl
  23. driver_one_way.test.fidl
  24. driver_service.test.fidl
  25. driver_two_way.test.fidl
  26. empty_struct.test.fidl
  27. encapsulated_structs.test.fidl
  28. enum.test.fidl
  29. error.test.fidl
  30. escaping.test.fidl
  31. experimental_maybe_from_alias.test.fidl
  32. experimental_zx_c_types.test.fidl
  33. handles.test.fidl
  34. handles_in_types.test.fidl
  35. info.gni
  36. inheritance.test.fidl
  37. inheritance_with_recursive_decl.test.fidl
  38. large_messages.test.fidl
  39. new_type.test.fidl
  40. nullable.test.fidl
  41. overlay.test.fidl
  42. padding.test.fidl
  43. protocol_request.test.fidl
  44. protocols.test.fidl
  45. README.md
  46. request_flexible_envelope.test.fidl
  47. service.test.fidl
  48. string_arrays.test.fidl
  49. struct.test.fidl
  50. table.test.fidl
  51. types_in_protocols.test.fidl
  52. union.test.fidl
  53. union_sandwich.test.fidl
  54. unknown_interactions.test.fidl
  55. vectors.test.fidl
  56. versions.test.fidl
tools/fidl/fidlc/testdata/README.md

FIDL test libraries

This directory contains the FIDL test libraries used for golden files.

Add a new library

To add a new standalone library:

  1. Choose a name, e.g. foo_bar.
  2. Create a FIDL file with the .test.fidl extension, e.g. foo_bar.test.fidl.
  3. Declare the library as test. followed by name without underscores, e.g. library test.foobar;.
  4. Add the filename to the standalone_libraries list in BUILD.gn.
  5. Add an entry to fidl_testdata_info in info.gni, providing the name and the target that BUILD.gn generates, e.g.:
{
  name = "foo_bar"
  target = "//tools/fidl/fidlc/testdata:test.foobar"
}

Add a new library with dependencies

To add a new library with dependencies, you must create a subdirectory containing multiple FIDL files. This should only be done to accommodate dependencies, not to group together similar standalone libraries.

  1. Choose a name, e.g. foo_bar.
  2. Create a subdirectory named name containing two or more FIDL files ending in .test.fidl and a BUILD.gn to build them.
  3. Ensure one of the libraries is named appropriately, e.g. test.foobar, and that its build target name is the same.
  4. Add an entry to fidl_testdata_info in info.gni, providing the name and the target that BUILD.gn generates, e.g.:
{
  name = "foo_bar"
  target = "//tools/fidl/fidlc/testdata/foo_bar:test.foobar"
}

Golden tests

FIDL tools in //tools/fidl use the test libraries as input when defining golden tests with //build/testing/golden_files.gni.

To check or update all FIDL-related goldens, run fx check-goldens fidl.