2020-02-24 20:39:13 +00:00
|
|
|
# Contributing to toml++
|
|
|
|
Contributions are very welcome! Either by [reporting issues] or submitting pull requests.
|
|
|
|
If you wish to submit a PR, please be aware that:
|
|
|
|
- The single-header file `toml.hpp` is generated by a script; make your changes in the files in
|
|
|
|
`include`, **not** in `toml.hpp`.
|
|
|
|
- Your changes should compile warning-free on at least one of gcc 8.3.0, clang 8.0, and MSVC 19.2X
|
|
|
|
(Visual Studio 2019). All three is a bonus.
|
|
|
|
- You should regenerate the single-header file as part of your PR (a CI check will fail if you don't).
|
|
|
|
|
2020-04-01 12:53:10 +00:00
|
|
|
<br>
|
|
|
|
|
|
|
|
## Regenerating toml.hpp
|
2020-02-24 20:39:13 +00:00
|
|
|
1. Make your changes as necessary
|
2020-04-01 12:53:10 +00:00
|
|
|
- If you've added a new header file that isn't going to be transitively included by one of the
|
|
|
|
others, add an include directive to `include/toml++/toml.h`
|
2020-02-24 20:39:13 +00:00
|
|
|
3. Run `python/generate_single_header.py`
|
|
|
|
|
2020-04-01 12:53:10 +00:00
|
|
|
<br>
|
|
|
|
|
|
|
|
## Building and running the tests
|
2020-02-24 20:39:13 +00:00
|
|
|
Testing is done using [Catch2], included in the respository as a submodule under `extern/Catch2`.
|
|
|
|
The first time you want to begin testing you'll need to ensure submodules have been fetched:
|
|
|
|
```bash
|
2020-03-03 21:28:24 +00:00
|
|
|
git submodule update --init extern/Catch2
|
|
|
|
git submodule update --init extern/tloptional
|
2020-02-24 20:39:13 +00:00
|
|
|
```
|
|
|
|
|
2020-04-01 12:53:10 +00:00
|
|
|
### Testing on Windows with Visual Studio
|
2020-02-24 20:39:13 +00:00
|
|
|
|
|
|
|
Install [Visual Studio 2019] and [Test Adapter for Catch2], then open `vs/toml++.sln` and build the
|
|
|
|
projects in the `tests` solution folder. Visual Studio's Test Explorer should pick these up and
|
|
|
|
allow you to run the tests directly.
|
|
|
|
|
2020-04-01 12:53:10 +00:00
|
|
|
If test discovery fails you can usually fix it by enabling
|
2020-02-24 20:39:13 +00:00
|
|
|
`Auto Detect runsettings Files` (settings gear icon > `Configure Run Settings`).
|
|
|
|
|
2020-04-01 12:53:10 +00:00
|
|
|
### Testing on Linux (and WSL)
|
2020-02-24 20:39:13 +00:00
|
|
|
Install [meson] and [ninja] if necessary, then test with both gcc and clang:
|
|
|
|
```bash
|
|
|
|
CXX=g++ meson build-gcc
|
|
|
|
CXX=clang++ meson build-clang
|
|
|
|
cd build-gcc && ninja && ninja test
|
|
|
|
cd ../build-clang && ninja && ninja test
|
|
|
|
```
|
|
|
|
|
|
|
|
[Visual Studio 2019]: https://visualstudio.microsoft.com/vs/
|
|
|
|
[Test Adapter for Catch2]: https://marketplace.visualstudio.com/items?itemName=JohnnyHendriks.ext01
|
|
|
|
[reporting issues]: https://github.com/marzer/tomlplusplus/issues
|
|
|
|
[Catch2]: https://github.com/catchorg/Catch2
|
|
|
|
[meson]: https://mesonbuild.com/Getting-meson.html
|
|
|
|
[ninja]: https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages
|