This directory contains the FIDL test libraries used for golden files.
To add a new standalone library:
foo_bar..test.fidl extension, e.g. foo_bar.test.fidl.fidl.test. followed by name without underscores, e.g. library fidl.test.foobar;.standalone_libraries list in BUILD.gn.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:fidl.test.foobar"
}
To add a new library with dependencies:
foo_bar..test.fidl and a BUILD.gn to build them.fidl.test.foobar, and that its build target name is the same.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:fidl.test.foobar"
}
FIDL tools in //tools/fidl use the test libraries as input when defining golden tests with //build/testing/golden_test.gni. The fidlc goldens are in //tools/fidl/fidlc -- eventually all fidlc source code will move there.
To regenerate all goldens, run fx regen-goldens fidl.
To test goldens, run fx test ${TOOL}_golden_tests for the specific tool, e.g. fx test fidlc_golden_tests.