Add a section about multiple file tests.

Personally, I chased my tail for a while because this was missing. There are a few raised issues about this, so I really think this will help others get started with the library quicker.
This commit is contained in:
Mazyad Alabduljaleel 2015-04-12 09:52:20 +04:00
parent 35f4266d00
commit da280ae094
1 changed files with 8 additions and 0 deletions

View File

@ -219,6 +219,14 @@ Scenario: vectors can be sized and resized
Then: the capacity changes but not the size Then: the capacity changes but not the size
``` ```
## Spliting Test Cases Across Multiple Files
There is a very small chance you will want to write all your test cases in a single file, so here is how you can split the tests across multple files.
As noted above, you only need one `cpp` file where you include the `catch.hpp` with `CATCH_CONFIG_MAIN`. You can leave that file with just those two lines.
Then, simply create more `cpp` files, include the `catch.hpp` header, and start writing those tests! No more includes or configuration is required.
## Next steps ## Next steps
This has been a brief introduction to get you up and running with Catch, and to point out some of the key differences between Catch and other frameworks you may already be familiar with. This will get you going quite far already and you are now in a position to dive in and write some tests. This has been a brief introduction to get you up and running with Catch, and to point out some of the key differences between Catch and other frameworks you may already be familiar with. This will get you going quite far already and you are now in a position to dive in and write some tests.