better-enums/CONTRIBUTING.md
2015-07-02 16:56:33 -05:00

2.8 KiB

Contributing to Better Enums

All contributions are welcome: feedback, documentation changes, and, of course, pull requests and patch suggestions. A list of contributors is maintained in the CONTRIBUTORS file. I am grateful to everyone mentioned.

Testing

I typically write small programs to play around with enum.h. The scratch/ directory is in .gitignore for this purpose. Create scratch/ and feel free to do anything you want in it. Once your change is nearly complete, you should run the automated test suite.

While still actively developing, run make -C test to do quick builds. Before submitting your pull request, run make -C test default-all. The first command tests your code on your system compiler in one configuration, and the second command tests it in all configurations that your compiler supports. Configurations refers to the optional features of Better Enums, such as constexpr string conversion and using an enum class for switch statements.

Once your pull request is submitted, the AppVeyor and Travis web services will automatically test it on many versions of GCC, Clang, and Visual C++. This takes about an hour, unfortunately, but if I am around, I might download your patch and give you results much sooner. I have most of the compilers installed locally on test machines.

The make targets mentioned above depend on the following software:

CxxTest's bin/ directory has to be in PATH and the root cxxtest/ directory has to be in whatever environment variable your system compiler uses to search for header files.

On Windows, you also need Cygwin. The directory containing MSBuild.exe must be in PATH.

The programs in example/ are generated from the Markdown files in doc/tutorial/ and doc/demo/. If you have edited the Markdown files, you should run make -C test examples to update the example program sources.

If you have created a new example program or compilation performance test, add it to test/CMakeLists.txt. Search for the name of an existing program, such as 1-hello-world, and you should see where to add new ones.

Commits

Please write descriptive commit messages that follow the 50/72 rule. I am likely to edit commit messages when merging into master. I will also squash multiple commits in most cases. If you prefer I not do either one, let me know, but then we will have to go back and forth on the exact contents of the pull request.

Generating the documentation

To generate an offline copy of the documentation, run make -C doc. To view it, open doc/html/index.html.