From 0c7f96ba630a49e18e7b2fb0e5ed241b04a7898a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Wed, 21 Oct 2020 19:59:59 +0200 Subject: [PATCH] Update documentation not to reference master branch --- README.md | 8 ++++---- docs/release-notes.md | 4 ++-- docs/tutorial.md | 31 ++++++++++++++++++++----------- 3 files changed, 26 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index adb32e08..ec269c06 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -![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) -[![Build Status](https://travis-ci.org/catchorg/Catch2.svg?branch=master)](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) -[![codecov](https://codecov.io/gh/catchorg/Catch2/branch/master/graph/badge.svg)](https://codecov.io/gh/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&branch=devel)](https://ci.appveyor.com/project/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) [![Join the chat in Discord: https://discord.gg/4CWS9zD](https://img.shields.io/badge/Discord-Chat!-brightgreen.svg)](https://discord.gg/4CWS9zD) diff --git a/docs/release-notes.md b/docs/release-notes.md index 082093c5..601c092e 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -782,7 +782,7 @@ than `single_include/catch.hpp`.** * CLR objects (`T^`) can now be stringified (#1216) * This affects code compiled as C++/CLI * 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 * Modified CMake-installed pkg-config to allow `#include `(#1239) @@ -810,7 +810,7 @@ than `single_include/catch.hpp`.** * Added an option to warn (+ exit with error) when no tests were ran (#1158) * Use as `-w NoTests` * 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 * `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 diff --git a/docs/tutorial.md b/docs/tutorial.md index 1f0b8ff2..45cb9919 100644 --- a/docs/tutorial.md +++ b/docs/tutorial.md @@ -3,7 +3,6 @@ **Contents**
[Getting Catch2](#getting-catch2)
-[Where to put it?](#where-to-put-it)
[Writing tests](#writing-tests)
[Test cases and sections](#test-cases-and-sections)
[BDD-Style](#bdd-style)
@@ -13,23 +12,33 @@ ## 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 -manager, or installing it using [its CMake package](cmake-integration.md#installing-catch2-from-git-repository). +These two files are the result of merging all headers, respectively +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 package, you need to include the header as `#include `_ + +-------- + +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 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).