mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21:36:11 +01:00
Add table of contents
This commit is contained in:
parent
c5553019cc
commit
07211cea9c
@ -1,6 +1,12 @@
|
|||||||
<a id="top"></a>
|
<a id="top"></a>
|
||||||
# Assertion Macros
|
# Assertion Macros
|
||||||
|
|
||||||
|
**Contents**
|
||||||
|
[Natural Expressions](#natural-expressions)
|
||||||
|
[Exceptions](#exceptions)
|
||||||
|
[Matcher expressions](#matcher-expressions)
|
||||||
|
[Thread Safety](#thread-safety)
|
||||||
|
|
||||||
Most test frameworks have a large collection of assertion macros to capture all possible conditional forms (```_EQUALS```, ```_NOTEQUALS```, ```_GREATER_THAN``` etc).
|
Most test frameworks have a large collection of assertion macros to capture all possible conditional forms (```_EQUALS```, ```_NOTEQUALS```, ```_GREATER_THAN``` etc).
|
||||||
|
|
||||||
Catch is different. Because it decomposes natural C-style conditional expressions most of these forms are reduced to one or two that you will use all the time. That said there are a rich set of auxilliary macros as well. We'll describe all of these here.
|
Catch is different. Because it decomposes natural C-style conditional expressions most of these forms are reduced to one or two that you will use all the time. That said there are a rich set of auxilliary macros as well. We'll describe all of these here.
|
||||||
|
@ -1,6 +1,30 @@
|
|||||||
<a id="top"></a>
|
<a id="top"></a>
|
||||||
# Command line
|
# Command line
|
||||||
|
|
||||||
|
**Contents**
|
||||||
|
[Specifying which tests to run](#specifying-which-tests-to-run)
|
||||||
|
[Choosing a reporter to use](#choosing-a-reporter-to-use)
|
||||||
|
[Breaking into the debugger](#breaking-into-the-debugger)
|
||||||
|
[Showing results for successful tests](#showing-results-for-successful-tests)
|
||||||
|
[Aborting after a certain number of failures](#aborting-after-a-certain-number-of-failures)
|
||||||
|
[Listing available tests, tags or reporters](#listing-available-tests-tags-or-reporters)
|
||||||
|
[Sending output to a file](#sending-output-to-a-file)
|
||||||
|
[Naming a test run](#naming-a-test-run)
|
||||||
|
[Eliding assertions expected to throw](#eliding-assertions-expected-to-throw)
|
||||||
|
[Make whitespace visible](#make-whitespace-visible)
|
||||||
|
[Warnings](#warnings)
|
||||||
|
[Reporting timings](#reporting-timings)
|
||||||
|
[Load test names to run from a file](#load-test-names-to-run-from-a-file)
|
||||||
|
[Just test names](#just-test-names)
|
||||||
|
[Specify the order test cases are run](#specify-the-order-test-cases-are-run)
|
||||||
|
[Specify a seed for the Random Number Generator](#specify-a-seed-for-the-random-number-generator)
|
||||||
|
[Identify framework and version according to the libIdentify standard](#identify-framework-and-version-according-to-the-libidentify-standard)
|
||||||
|
[Wait for key before continuing](#wait-for-key-before-continuing)
|
||||||
|
[Specify multiples of clock resolution to run benchmarks for](#specify-multiples-of-clock-resolution-to-run-benchmarks-for)
|
||||||
|
[Usage](#usage)
|
||||||
|
[Specify the section to run](#specify-the-section-to-run)
|
||||||
|
[Filenames as tags](#filenames-as-tags)
|
||||||
|
|
||||||
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.
|
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.
|
Click one of the followings links to take you straight to that option - or scroll on to browse the available options.
|
||||||
|
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
<a id="top"></a>
|
<a id="top"></a>
|
||||||
# Compile-time configuration
|
# Compile-time configuration
|
||||||
|
|
||||||
|
**Contents**
|
||||||
|
[main()/ implementation](#main-implementation)
|
||||||
|
[Prefixing Catch macros](#prefixing-catch-macros)
|
||||||
|
[Terminal colour](#terminal-colour)
|
||||||
|
[Console width](#console-width)
|
||||||
|
[stdout](#stdout)
|
||||||
|
[Other toggles](#other-toggles)
|
||||||
|
[Windows header clutter](#windows-header-clutter)
|
||||||
|
|
||||||
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```).
|
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.
|
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.
|
||||||
|
@ -1,6 +1,12 @@
|
|||||||
<a id="top"></a>
|
<a id="top"></a>
|
||||||
# Why do my tests take so long to compile?
|
# Why do my tests take so long to compile?
|
||||||
|
|
||||||
|
**Contents**
|
||||||
|
[Short answer](#short-answer)
|
||||||
|
[Long answer](#long-answer)
|
||||||
|
[Practical example](#practical-example)
|
||||||
|
[Other possible solutions](#other-possible-solutions)
|
||||||
|
|
||||||
Several people have reported that test code written with Catch takes much longer to compile than they would expect. Why is that?
|
Several people have reported that test code written with Catch takes much longer to compile than they would expect. Why is that?
|
||||||
|
|
||||||
Catch is implemented entirely in headers. There is a little overhead due to this - but not as much as you might think - and you can minimise it simply by organising your test code as follows:
|
Catch is implemented entirely in headers. There is a little overhead due to this - but not as much as you might think - and you can minimise it simply by organising your test code as follows:
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
<a id="top"></a>
|
<a id="top"></a>
|
||||||
# Tutorial
|
# Tutorial
|
||||||
|
|
||||||
|
**Contents**
|
||||||
|
[Getting Catch](#getting-catch)
|
||||||
|
[Where to put it?](#where-to-put-it)
|
||||||
|
[Writing tests](#writing-tests)
|
||||||
|
[Test cases and sections](#test-cases-and-sections)
|
||||||
|
[BDD-Style](#bdd-style)
|
||||||
|
[Scaling up](#scaling-up)
|
||||||
|
[Next steps](#next-steps)
|
||||||
|
|
||||||
## Getting Catch
|
## 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.
|
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.
|
||||||
|
Loading…
Reference in New Issue
Block a user