mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-17 03:02:24 +01:00
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:
parent
35f4266d00
commit
da280ae094
@ -219,6 +219,14 @@ Scenario: vectors can be sized and resized
|
||||
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
|
||||
|
||||
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.
|
||||
|
Loading…
Reference in New Issue
Block a user