-
-
Notifications
You must be signed in to change notification settings - Fork 622
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
version 2.3.1 - mainly a fix for #210 - nothing in the doctest header…
… has changed. Also renamed a bit the recently merged examples using doctest as installed
- Loading branch information
Showing
19 changed files
with
114 additions
and
101 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
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
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 +1 @@ | ||
[doctest] doctest version is "2.3.0" | ||
[doctest] doctest version is "2.3.1" |
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,4 +1,4 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<doctest binary="all_features" version="2.3.0"> | ||
<doctest binary="all_features" version="2.3.1"> | ||
<Options order_by="file" rand_seed="324" first="0" last="4294967295" abort_after="0" subcase_filter_levels="2147483647" case_sensitive="false" no_throw="false" no_skip="false"/> | ||
</doctest> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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,22 @@ | ||
#define DOCTEST_CONFIG_IMPLEMENTATION_IN_DLL | ||
#define DOCTEST_CONFIG_IMPLEMENT | ||
#include <doctest/doctest.h> | ||
|
||
#include "dll.h" | ||
#include <stdio.h> | ||
|
||
extern "C" { | ||
void say_hello_dll() { printf("%s", "Hello, World!\n"); } | ||
} | ||
|
||
int factorial(int number) { | ||
return number < 1 ? 1 : number <= 1 ? number : factorial(number - 1) * number; | ||
} | ||
|
||
TEST_CASE("testing the factorial function") { | ||
CHECK(factorial(0) == 1); | ||
CHECK(factorial(1) == 1); | ||
CHECK(factorial(2) == 2); | ||
CHECK(factorial(3) == 6); | ||
CHECK(factorial(10) == 3628800); | ||
} |
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 |
---|---|---|
|
@@ -3,5 +3,5 @@ | |
#include "exporting.h" | ||
|
||
extern "C" { | ||
DLL_API void say_hello_dll(); | ||
DLL_API void say_hello_dll(); | ||
} |
File renamed without changes.
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,34 @@ | ||
#define DOCTEST_CONFIG_IMPLEMENTATION_IN_DLL | ||
#include <doctest/doctest.h> | ||
|
||
#include "dll.h" | ||
|
||
int main(int argc, char **argv) { | ||
doctest::Context context; | ||
context.applyCommandLine(argc, argv); | ||
|
||
int res = context.run(); // run doctest | ||
|
||
// important - query flags (and --exit) rely on the user doing this | ||
if (context.shouldExit()) { | ||
// propagate the result of the tests | ||
return res; | ||
} | ||
|
||
say_hello_dll(); // test dll func | ||
} | ||
|
||
int square(const int number) { return number * number; } | ||
|
||
TEST_CASE("testing the square function") { | ||
CHECK(square(2) == 4); | ||
CHECK(square(4) == 16); | ||
CHECK(square(5) == 25); | ||
CHECK(square(8) == 64); | ||
} | ||
|
||
// running notes | ||
// ./example_dll --no-run (run normal program) | ||
// ./example_dll --exit (run tests then exit) | ||
// ./example_dll (run tests then run program) | ||
// ./example_dll --success (print successful test casts) |
File renamed without changes.
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,35 @@ | ||
#define DOCTEST_CONFIG_IMPLEMENT | ||
#include <doctest/doctest.h> | ||
|
||
int main(int argc, char **argv) { | ||
doctest::Context context; | ||
context.applyCommandLine(argc, argv); | ||
|
||
int res = context.run(); // run doctest | ||
|
||
// important - query flags (and --exit) rely on the user doing this | ||
if (context.shouldExit()) { | ||
// propagate the result of the tests | ||
return res; | ||
} | ||
|
||
printf("%s", "Hello, World!"); | ||
} | ||
|
||
int factorial(const int number) { | ||
return number < 1 ? 1 : number <= 1 ? number : factorial(number - 1) * number; | ||
} | ||
|
||
TEST_CASE("testing the factorial function") { | ||
CHECK(factorial(0) == 1); | ||
CHECK(factorial(1) == 1); | ||
CHECK(factorial(2) == 2); | ||
CHECK(factorial(3) == 6); | ||
CHECK(factorial(10) == 3628800); | ||
} | ||
|
||
// running notes | ||
// ./example_exe --no-run (run normal program) | ||
// ./example_exe --exit (run tests then exit) | ||
// ./example_exe (run tests then run program) | ||
// ./example_exe --success (print successful test casts) |
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 |
---|---|---|
@@ -1 +1 @@ | ||
2.3.0 | ||
2.3.1 |