diff --git a/docs/Readme.md b/docs/Readme.md index 36048ff8..973a5f90 100644 --- a/docs/Readme.md +++ b/docs/Readme.md @@ -1,3 +1,5 @@ +# Reference + To get the most out of Catch, start with the [tutorial](tutorial.md). Once you're up and running consider the following reference material. diff --git a/docs/command-line.md b/docs/command-line.md index cc944734..184efe69 100644 --- a/docs/command-line.md +++ b/docs/command-line.md @@ -1,3 +1,5 @@ +# Command line + Catch works quite nicely without any command line options at all - but for those times when you want greater control the following options are available. Click one of the followings links to take you straight to that option - or scroll on to browse the available options. diff --git a/docs/configuration.md b/docs/configuration.md index 59712020..3ffba08c 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -1,3 +1,5 @@ +# Compile-time configuration + Catch is designed to "just work" as much as possible. For most people the only configuration needed is telling Catch which source file should host all the implementation code (```CATCH_CONFIG_MAIN```). Nonetheless there are still some occasions where finer control is needed. For these occasions Catch exposes a set of macros for configuring how it is built. diff --git a/docs/test-fixtures.md b/docs/test-fixtures.md index fc546b39..3952a847 100644 --- a/docs/test-fixtures.md +++ b/docs/test-fixtures.md @@ -1,3 +1,5 @@ +# Test fixtures + Although Catch allows you to group tests together as sections within a test case, it can still be convenient, sometimes, to group them using a more traditional test fixture. Catch fully supports this too. You define the test fixture as a simple structure: ```c++ diff --git a/docs/tutorial.md b/docs/tutorial.md index 600ba3ba..9b9a1a05 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -1,4 +1,6 @@ -# Getting Catch +# Tutorial + +## Getting Catch The simplest way to get Catch is to download the latest [single header version](https://raw.githubusercontent.com/philsquared/Catch/master/single_include/catch.hpp). The single header is generated by merging a set of individual headers but it is still just normal source code in a header file. @@ -11,7 +13,7 @@ Catch is header only. All you need to do is drop the file(s) somewhere reachable The rest of this tutorial will assume that the Catch single-include header (or the include folder) is available unqualified - but you may need to prefix it with a folder name if necessary. -# Writing tests +## 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). @@ -82,7 +84,7 @@ Now all the tests pass. Of course there are still more issues to deal with. For example we'll hit problems when the return value starts to exceed the range of an unsigned int. With factorials that can happen quite quickly. You might want to add tests for such cases and decide how to handle them. We'll stop short of doing that here. -## What did we do here? +### What did we do here? Although this was a simple test it's been enough to demonstrate a few things about how Catch is used. Let's take moment to consider those before we move on.