Make each generated file comparison into a goldenTest case. Golden files
can be updated/added for changes in codegen/tests using --accept command
line switch.
The cmdargs library silently skips short names for options if more than
one option starts with the same letter. This can lead to inadvertent
breaks when a new option is added, like happened with adding
`--no-banner` option, breaking the short name -n for the `--namespace`
option.
The tests compare checked-in generated files with code generated using
the current compiler.
Discrepancy indicates a change in the generated code which may be a
bug or an intentional change. In the latter case the generated file(s)
should be re-generated and updated in the same commit as the change.
Note that the checked-in files are generated with --no-banner option.
File(s) with the `.json` extension are assumed to contain the JSON
representation of schema abstract syntax tree in the format produced by
`gbc schema`
The schema AST is written in JSON format. We foresee two classes of
scenarios that will use it.
Tools that need to process Bond schema files using languages other than
Haskell can avoid recreating Bond parser. Example might be schema
repositories, lints, etc.
The schema AST will also be used to allow users to inject schema
transformations into codegen process. This in many cases can be a
lightweight alternative to custom codegen.
When compiling multiple .bond files at once, the `--jobs=[NUM]` command
line option can be used to specify how many jobs should be run
concurrently. When used without arguments, the default is to run as many
jobs as there are processors. The option also accepts negative numbers
to specify fewer jobs than the number of processors. Often the optimal
performance is achieved by leaving one or more cores for other processes
on the machine.