mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-08 15:14:44 +02:00
Move note about other files in catch's repo to a separate paragraph
@@ -8,10 +8,12 @@ If you prefer you can get the full source, including self-test projects and samp
|
||||
|
||||
## Where to put it?
|
||||
|
||||
CATCH is header only (the full distribution also contains some project files and cpp files, too. This are just for self test - they're not part of the library). So all you need to do is drop the file(s) somewhere reachable from your project - either in some central location you can set your header search path to find, or directly into your project tree itself! This is a particularly good option for other Open-Source projects that want to use CATCH for their test suite. See [[this blog entry for more on that|http://www.levelofindirection.com/journal/2011/5/27/unit-testing-in-c-and-objective-c-just-got-ridiculously-easi-1.html]].
|
||||
CATCH is header only. All you need to do is drop the file(s) somewhere reachable from your project - either in some central location you can set your header search path to find, or directly into your project tree itself! This is a particularly good option for other Open-Source projects that want to use CATCH for their test suite. See [[this blog entry for more on that|http://www.levelofindirection.com/journal/2011/5/27/unit-testing-in-c-and-objective-c-just-got-ridiculously-easi-1.html]].
|
||||
|
||||
The rest of this tutorial will assume that the CATCH single header or root folder is available unqualified - but you may need to prefix it with a folder name if necessary.
|
||||
|
||||
Note that the full distribution also contains some project files and cpp files, too. You can ignore these, they are just for self test - they're not part of the library.
|
||||
|
||||
# Writing tests
|
||||
|
||||
Let's start with a really simple example. Say you have written a function to calculate factorials and now you want to test it (let's leave aside TDD for now). To keep things simple we'll put everything in a single file.
|
||||
|
Reference in New Issue
Block a user