diff --git a/docs/Readme.md b/docs/Readme.md index b1623626..e7815671 100644 --- a/docs/Readme.md +++ b/docs/Readme.md @@ -1,4 +1,6 @@ +# Reference + To get the most out of Catch, start with the [tutorial](tutorial.md#top). Once you're up and running consider the following reference material. diff --git a/docs/command-line.md b/docs/command-line.md index 0e1a7af8..12517bcc 100644 --- a/docs/command-line.md +++ b/docs/command-line.md @@ -1,4 +1,6 @@ +# 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 35809ab4..82edc55c 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -1,4 +1,6 @@ +# 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 c887ce26..1dc7baba 100644 --- a/docs/test-fixtures.md +++ b/docs/test-fixtures.md @@ -1,4 +1,6 @@ +# 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 f4bcb07d..80465ba2 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -1,5 +1,7 @@ -# 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. @@ -12,7 +14,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). @@ -83,7 +85,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.