Automatically generate boilerplate comments and code for new files with a single command.
Usage:
autogen.sh -c [copyright holder] -l [license] [filename]
Modify an existing file in-place:
autogen.sh -i [...other params as above...]
To get a list of supported licenses, or to see the full set of flags, run
autogen.sh
with no parameters.
File type or language is determined based on the full filename or extension, as
appropriate. See autogen.sh
for a list of recognized file types.
Sample outputs:
For details on adding Autogen support to your editor, please see
the editors
directory.
To add a new file type or feature, change autogen.sh
and add
several files to the testdata
directory, namely:
testdata/<feature>.in
- the input file containing command-line args to pass toautogen.sh
testdata/<feature>.out
- expected stdout for the testtestdata/<feature>.err
- expected stderr for the test
To generate the *.out
and *.err
files automatically, just add the *.in
files and run make regen
. Then, examine the resulting *.out
and *.err
files.
Other custom tests can be added as separate scripts in the tests
directory. If the file has the suffix _tests.sh
, it will be automatically
picked up by tests/run_all_tests.sh
script, which
means that make test
will automatically run it without any other changes.
Be sure to also add an entry for it in tests/BUILD
file for
Bazel to be able to run it as well, including appropriate dependencies on any
data files it may need.
You have two options:
- via Bazel:
bazel test //...
- via Make:
make test
Bazel is typically faster, especially when rerunning tests, due to built-in caching.
Apache 2.0; see LICENSE.txt for details.