mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 05:16:10 +01:00
Update documentation not to reference master branch
This commit is contained in:
parent
923bcc5d6f
commit
0c7f96ba63
@ -1,10 +1,10 @@
|
|||||||
<a id="top"></a>
|
<a id="top"></a>
|
||||||
![catch logo](data/artwork/catch2-logo-small.png)
|
![Catch2 logo](data/artwork/catch2-logo-small.png)
|
||||||
|
|
||||||
[![Github Releases](https://img.shields.io/github/release/catchorg/catch2.svg)](https://github.com/catchorg/catch2/releases)
|
[![Github Releases](https://img.shields.io/github/release/catchorg/catch2.svg)](https://github.com/catchorg/catch2/releases)
|
||||||
[![Build Status](https://travis-ci.org/catchorg/Catch2.svg?branch=master)](https://travis-ci.org/catchorg/Catch2)
|
[![Build Status](https://travis-ci.org/catchorg/Catch2.svg?branch=devel)](https://travis-ci.org/catchorg/Catch2)
|
||||||
[![Build status](https://ci.appveyor.com/api/projects/status/github/catchorg/Catch2?svg=true)](https://ci.appveyor.com/project/catchorg/catch2)
|
[![Build Status](https://ci.appveyor.com/api/projects/status/github/catchorg/Catch2?svg=true&branch=devel)](https://ci.appveyor.com/project/catchorg/catch2)
|
||||||
[![codecov](https://codecov.io/gh/catchorg/Catch2/branch/master/graph/badge.svg)](https://codecov.io/gh/catchorg/Catch2)
|
[![Code Coverage](https://codecov.io/gh/catchorg/Catch2/branch/devel/graph/badge.svg)](https://codecov.io/gh/catchorg/Catch2)
|
||||||
[![Try online](https://img.shields.io/badge/try-online-blue.svg)](https://godbolt.org/z/9x9qoM)
|
[![Try online](https://img.shields.io/badge/try-online-blue.svg)](https://godbolt.org/z/9x9qoM)
|
||||||
[![Join the chat in Discord: https://discord.gg/4CWS9zD](https://img.shields.io/badge/Discord-Chat!-brightgreen.svg)](https://discord.gg/4CWS9zD)
|
[![Join the chat in Discord: https://discord.gg/4CWS9zD](https://img.shields.io/badge/Discord-Chat!-brightgreen.svg)](https://discord.gg/4CWS9zD)
|
||||||
|
|
||||||
|
@ -782,7 +782,7 @@ than `single_include/catch.hpp`.**
|
|||||||
* CLR objects (`T^`) can now be stringified (#1216)
|
* CLR objects (`T^`) can now be stringified (#1216)
|
||||||
* This affects code compiled as C++/CLI
|
* This affects code compiled as C++/CLI
|
||||||
* Added `PredicateMatcher`, a matcher that takes an arbitrary predicate function (#1236)
|
* Added `PredicateMatcher`, a matcher that takes an arbitrary predicate function (#1236)
|
||||||
* See [documentation for details](https://github.com/catchorg/Catch2/blob/master/docs/matchers.md)
|
* See [documentation for details](https://github.com/catchorg/Catch2/blob/devel/docs/matchers.md)
|
||||||
|
|
||||||
### Others
|
### Others
|
||||||
* Modified CMake-installed pkg-config to allow `#include <catch.hpp>`(#1239)
|
* Modified CMake-installed pkg-config to allow `#include <catch.hpp>`(#1239)
|
||||||
@ -810,7 +810,7 @@ than `single_include/catch.hpp`.**
|
|||||||
* Added an option to warn (+ exit with error) when no tests were ran (#1158)
|
* Added an option to warn (+ exit with error) when no tests were ran (#1158)
|
||||||
* Use as `-w NoTests`
|
* Use as `-w NoTests`
|
||||||
* Added provisional support for Emscripten (#1114)
|
* Added provisional support for Emscripten (#1114)
|
||||||
* [Added a way to override the fallback stringifier](https://github.com/catchorg/Catch2/blob/master/docs/configuration.md#fallback-stringifier) (#1024)
|
* [Added a way to override the fallback stringifier](https://github.com/catchorg/Catch2/blob/devel/docs/configuration.md#fallback-stringifier) (#1024)
|
||||||
* This allows project's own stringification machinery to be easily reused for Catch
|
* This allows project's own stringification machinery to be easily reused for Catch
|
||||||
* `Catch::Session::run()` now accepts `char const * const *`, allowing it to accept array of string literals (#1031, #1178)
|
* `Catch::Session::run()` now accepts `char const * const *`, allowing it to accept array of string literals (#1031, #1178)
|
||||||
* The embedded version of Clara was bumped to v1.1.3
|
* The embedded version of Clara was bumped to v1.1.3
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
|
|
||||||
**Contents**<br>
|
**Contents**<br>
|
||||||
[Getting Catch2](#getting-catch2)<br>
|
[Getting Catch2](#getting-catch2)<br>
|
||||||
[Where to put it?](#where-to-put-it)<br>
|
|
||||||
[Writing tests](#writing-tests)<br>
|
[Writing tests](#writing-tests)<br>
|
||||||
[Test cases and sections](#test-cases-and-sections)<br>
|
[Test cases and sections](#test-cases-and-sections)<br>
|
||||||
[BDD-Style](#bdd-style)<br>
|
[BDD-Style](#bdd-style)<br>
|
||||||
@ -13,23 +12,33 @@
|
|||||||
|
|
||||||
## Getting Catch2
|
## Getting Catch2
|
||||||
|
|
||||||
The simplest way to get Catch2 is to download the latest [single header version](https://raw.githubusercontent.com/catchorg/Catch2/master/single_include/catch2/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 Catch2 is to download the latest
|
||||||
|
[amalgamated header](https://raw.githubusercontent.com/catchorg/Catch2/devel/extras/catch_amalgamated.hpp)
|
||||||
|
and [amalgamated source file](https://raw.githubusercontent.com/catchorg/Catch2/devel/extras/catch_amalgamated.cpp).
|
||||||
|
|
||||||
Alternative ways of getting Catch2 include using your system package
|
These two files are the result of merging all headers, respectively
|
||||||
manager, or installing it using [its CMake package](cmake-integration.md#installing-catch2-from-git-repository).
|
all source files, into one file. To use them, just drop them next to your
|
||||||
|
own project. Using Catch2 like this has a significant disadvantage in terms
|
||||||
|
of final compilation times, but it works well enough to get you started.
|
||||||
|
|
||||||
The full source for Catch2, including test projects, documentation, and other things, is hosted on GitHub. [http://catch-lib.net](http://catch-lib.net) will redirect you there.
|
Later, you should move towards using Catch2 as a proper library, preferably
|
||||||
|
via CMake. See our documentation on the [CMake integration](cmake-integration.md#top).
|
||||||
|
|
||||||
|
|
||||||
## Where to put it?
|
|
||||||
|
|
||||||
Catch2 is header only. All you need to do is drop the file 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](https://levelofindirection.com/blog/unit-testing-in-cpp-and-objective-c-just-got-ridiculously-easier-still.html).
|
|
||||||
|
|
||||||
The rest of this tutorial will assume that the Catch2 single-include header (or the include folder) is available unqualified - but you may need to prefix it with a folder name if necessary.
|
|
||||||
|
|
||||||
_If you have installed Catch2 from system package manager, or CMake
|
_If you have installed Catch2 from system package manager, or CMake
|
||||||
package, you need to include the header as `#include <catch2/catch.hpp>`_
|
package, you need to include the header as `#include <catch2/catch.hpp>`_
|
||||||
|
|
||||||
|
|
||||||
|
--------
|
||||||
|
|
||||||
|
The rest of this page is currently waiting for rewrite for the v3
|
||||||
|
release. It might not be accurate in places, and likely doesn't mention
|
||||||
|
the proper header to include, or might refer to outdated functionality,
|
||||||
|
like the `CATCH_CONFIG_MAIN` macro.
|
||||||
|
|
||||||
|
--------
|
||||||
|
|
||||||
|
|
||||||
## Writing tests
|
## Writing tests
|
||||||
|
|
||||||
Let's start with a really simple example ([code](../examples/010-TestCase.cpp)). Say you have written a function to calculate factorials and now you want to test it (let's leave aside TDD for now).
|
Let's start with a really simple example ([code](../examples/010-TestCase.cpp)). Say you have written a function to calculate factorials and now you want to test it (let's leave aside TDD for now).
|
||||||
|
Loading…
Reference in New Issue
Block a user