We keep a set of "golden" files to ensure the generator has not changed its output in unexpected ways. If you need to update these files, use this command:
bazel_output_base="$(bazel info output_base)"
bazel run \
//generator:google-cloud-cpp-codegen -- \
--protobuf_proto_path="${bazel_output_base}/external/protobuf~/src" \
--googleapis_proto_path="${bazel_output_base}/external/googleapis~" \
--golden_proto_path="${PWD}" \
--output_path="${PWD}" \
--update_ci=false \
--config_file="${PWD}/generator/integration_tests/golden_config.textproto"The generate-libraries build also runs this command and highlights any changes
using git diff.
We write unit tests to verify the generated files work as expected. These tests
are in the tests/ subdirectory. Do not insert hand-crafted code into the
golden/ subdirectory. That directory does not get the usual creature comforts,
such as automatic code formatting.