-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
d Add docs for doctest integration - see #11
Co-Authored-By: Llewellyn Falco <[email protected]>
- Loading branch information
1 parent
1807399
commit 43a29d7
Showing
7 changed files
with
120 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// startcode doctest_main | ||
// begin-snippet: doctest_main | ||
// main.cpp: | ||
#define APPROVALS_DOCTEST // This tells Approval Tests to provide a main() - only do this in one cpp file | ||
#include "ApprovalTests.hpp" | ||
// endcode | ||
// end-snippet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<!-- | ||
GENERATED FILE - DO NOT EDIT | ||
This file was generated by [MarkdownSnippets](https://github.com/SimonCropp/MarkdownSnippets). | ||
Source File: /doc/mdsource/UsingDoctest.source.md | ||
To change this file edit the source file and then run MarkdownSnippets. | ||
--> | ||
|
||
<a id="top"></a> | ||
|
||
# Using Approval Tests With doctest | ||
|
||
|
||
<!-- toc --> | ||
## Contents | ||
|
||
* [Getting Started With doctest](#getting-started-with-doctest) | ||
* [New Project](#new-project) | ||
<!-- endtoc --> | ||
|
||
|
||
|
||
|
||
## Getting Started With doctest | ||
|
||
The [doctest](https://github.com/onqtam/doctest) test framework works fairly well with Approval Tests. | ||
|
||
Doctest is similar to Catch, but claims to give faster compilation times. | ||
|
||
### New Project | ||
|
||
Create a file `main.cpp` and add just the following two lines: | ||
|
||
<!-- snippet: doctest_main --> | ||
```cpp | ||
// main.cpp: | ||
#define APPROVALS_DOCTEST // This tells Approval Tests to provide a main() - only do this in one cpp file | ||
#include "ApprovalTests.hpp" | ||
``` | ||
<sup>[snippet source](/ApprovalTests_DocTest_Tests/main.cpp#L1-L5)</sup> | ||
<!-- endsnippet --> | ||
**Note**: currently, ApprovalTests overrides any `--reporter` command-line argument supplied. | ||
This is needed for ApprovalTests to function with doctest. The ApprovalTests reporter works like doctest's `console` reporter. This means that it is not possible to run ApprovalTests with the doctest test framework, and use reporters such as `xml`. | ||
We currently do not have a better workaround. | ||
--- | ||
[Back to User Guide](/doc/README.md#top) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<a id="top"></a> | ||
|
||
# Using Approval Tests With doctest | ||
|
||
|
||
toc | ||
|
||
|
||
|
||
## Getting Started With doctest | ||
|
||
The [doctest](https://github.com/onqtam/doctest) test framework works fairly well with Approval Tests. | ||
|
||
Doctest is similar to Catch, but claims to give faster compilation times. | ||
|
||
### New Project | ||
|
||
Create a file `main.cpp` and add just the following two lines: | ||
|
||
snippet: doctest_main | ||
|
||
**Note**: currently, ApprovalTests overrides any `--reporter` command-line argument supplied. | ||
This is needed for ApprovalTests to function with doctest. The ApprovalTests reporter works like doctest's `console` reporter. This means that it is not possible to run ApprovalTests with the doctest test framework, and use reporters such as `xml`. | ||
|
||
We currently do not have a better workaround. | ||
|
||
--- | ||
|
||
[Back to User Guide](/doc/README.md#top) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters