mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-09 07:34:44 +02:00
Updated intro
10
Tutorial.md
10
Tutorial.md
@@ -1,16 +1,16 @@
|
|||||||
# Getting the source code
|
# Getting the source code
|
||||||
|
|
||||||
CATCH is hosted here on GitHub. If you're familiar with Git or GitHub already then you can probably skip this section.
|
CATCH is hosted here on GitHub. There are three ways to get CATCH. All are available from the [[Source|https://github.com/philsquared/Catch]] page.
|
||||||
|
|
||||||
The simplest way to get CATCH is to just download the zip or tar file. Go to the [[Source|https://github.com/philsquared/Catch]] page and hit Downloads.
|
The simplest way is to download the single-header version of the library. To do so click the Downloads button, then select catch.hpp from the "Download Packages" section and you're done.
|
||||||
|
|
||||||
Just under the Downloads button you can also find the urls for pulling the code directly using Git, if you prefer. If you plan to use CATCH within a project that is already in a Git repository you'll probably want to get CATCH as a Git submodule. This will allow you to track CATCH independently of your own project.
|
If you prefer you can get the full source, including self-test projects and sample tests, from the same Downloads Button (from under "Download Source" as a zip or tar file), or using git to grab the head revision.
|
||||||
|
|
||||||
## Where to put it?
|
## Where to put it?
|
||||||
|
|
||||||
CATCH is header only (there are some project files and cpp files for self test in there too, at the moment - just ignore those for now). So all you need to do is drop the files somewhere reachable from your project. The simplest way is to make a folder called catch, under your project's root source folder and place them there.
|
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]].
|
||||||
|
|
||||||
The rest of this tutorial will assume that the CATCH root folder is available unqualified - but you may need to prefix it with a folder name if necessary.
|
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.
|
||||||
|
|
||||||
# Writing tests
|
# Writing tests
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user