tree: 6fa3ec7b1484a3a9287f0cb163af62a256954ea5 [path history] [tgz]
  1. foreign_type_in_response_used_through_compose/
  2. placement_of_attributes/
  3. struct_default_value_enum_library_reference/
  4. transitive_dependencies/
  5. transitive_dependencies_compose/
  6. type_aliases/
  7. bindings_denylist.test.fidl
  8. bits.test.fidl
  9. byte_and_bytes.test.fidl
  10. constants.test.fidl
  11. consts.test.fidl
  12. doc_comments.test.fidl
  13. empty_struct.test.fidl
  14. enum.test.fidl
  15. error.test.fidl
  16. escaping.test.fidl
  17. handles.test.fidl
  18. handles_in_types.test.fidl
  19. inheritance.test.fidl
  20. inheritance_with_recursive_decl.test.fidl
  21. nullable.test.fidl
  22. protocol_request.test.fidl
  23. protocols.test.fidl
  24. README.md
  25. regen.sh
  26. request_flexible_envelope.test.fidl
  27. service.test.fidl
  28. struct.test.fidl
  29. table.test.fidl
  30. union.test.fidl
  31. union_sandwich.test.fidl
zircon/tools/fidl/testdata/README.md

Regenerating fidlc Golden Files

Ensure fidlc is built, for instance

fx ninja -C out/default.zircon host-x64-linux-clang/obj/tools/fidl/fidlc host-x64-linux-clang/obj/system/utest/fidl-compiler/fidl-compiler-test

Then run the regen.sh script:

fx exec zircon/tools/fidl/testdata/regen.sh

This script runs fidlc on all of the inputs in the typestest/ directory, and outputs them into the goldens/ directory. The json_generator_tests are a fidlc unit test that will ensure that the output inside goldens/ matches the current state of the fidl compiler.

Each “input” in typestest/ corresponds to a single json output file in goldens/, and can take one of two possible forms:

  • A single fidl file, foo.fidl which gets converted to foo.json
  • A directory foo which gets converted to foo.json. This directory must contain:
    • One or more fidl files.
    • An order.txt file that describes the dependency ordering of the files in this directory. For example, for a library foo that consists of two fidl files a.fidl and b.fidl where a.fidl depends on b.fidl, order.txt would consist of two lines, the first being b.fidl and the second being a.fidl.

Currently json_generator_tests.cc only supports a “linked list” shaped dependency tree, where each fidl file depends on only the fidl file in the line above it (except for the first fidl file which has no dependencies)

Note that you must rebuild fidl-compiler-test after regenerating goldens for the updated goldens to be used in the test.