Document that user can only provide main in TU with CONFIG_RUNNER

Closes #1851
This commit is contained in:
Martin Hořeňovský 2020-05-15 15:57:27 +02:00
parent c190061001
commit f764ee3d30
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A

View File

@ -11,9 +11,9 @@ The easiest way to use Catch is to let it supply ```main()``` for you and handle
This is achieved by writing ```#define CATCH_CONFIG_MAIN``` before the ```#include "catch.hpp"``` in *exactly one* source file. This is achieved by writing ```#define CATCH_CONFIG_MAIN``` before the ```#include "catch.hpp"``` in *exactly one* source file.
Sometimes, though, you need to write your own version of main(). You can do this by writing ```#define CATCH_CONFIG_RUNNER``` instead. Now you are free to write ```main()``` as normal and call into Catch yourself manually. Sometimes, though, you need to write your own version of main(). You can do this by writing ```#define CATCH_CONFIG_RUNNER``` instead. Now you are free to write ```main()``` as normal and call into Catch yourself manually. You now have a lot of flexibility - but here are three recipes to get your started:
You now have a lot of flexibility - but here are three recipes to get your started: **Important note: you can only provide `main` in the same file you defined `CATCH_CONFIG_RUNNER`.**
## Let Catch take full control of args and config ## Let Catch take full control of args and config