Skip to content

Commit

Permalink
version 2.3.1 - mainly a fix for #210 - nothing in the doctest header…
Browse files Browse the repository at this point in the history
… has changed. Also renamed a bit the recently merged examples using doctest as installed
  • Loading branch information
onqtam committed Mar 24, 2019
1 parent c1f3e01 commit a3ae958
Show file tree
Hide file tree
Showing 19 changed files with 114 additions and 101 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Change Log

## [2.3.1](https://github.com/onqtam/doctest/tree/2.3.1) (2019-03-24)
[Full Changelog](https://github.com/onqtam/doctest/compare/2.3.0...2.3.1)

**Closed issues:**

- CMake config deletes doctest.h on clean [\#210](https://github.com/onqtam/doctest/issues/210)

**Merged pull requests:**

- Add two very simple examples of using doctest with CMake [\#209](https://github.com/onqtam/doctest/pull/209) ([pr0g](https://github.com/pr0g))

## [2.3.0](https://github.com/onqtam/doctest/tree/2.3.0) (2019-03-23)
[Full Changelog](https://github.com/onqtam/doctest/compare/2.2.3...2.3.0)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/503/badge)](https://bestpractices.coreinfrastructure.org/projects/503)
[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/onqtam/doctest.svg)](https://lgtm.com/projects/g/onqtam/doctest/context:cpp)
[![Join the chat at https://gitter.im/onqtam/doctest](https://badges.gitter.im/onqtam/doctest.svg)](https://gitter.im/onqtam/doctest?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![Try it online](https://img.shields.io/badge/try%20it-online-orange.svg)](https://wandbox.org/permlink/yuzdXqAzeMbmYwi6)
[![Try it online](https://img.shields.io/badge/try%20it-online-orange.svg)](https://wandbox.org/permlink/D72PilxcBN7T8bNI)
<!--
[![Language](https://img.shields.io/badge/language-C++-blue.svg)](https://isocpp.org/)
[![documentation](https://img.shields.io/badge/documentation%20%20-online-blue.svg)](https://github.com/onqtam/doctest/blob/master/doc/markdown/readme.md#reference)
Expand Down
4 changes: 2 additions & 2 deletions doctest/doctest.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@

#define DOCTEST_VERSION_MAJOR 2
#define DOCTEST_VERSION_MINOR 3
#define DOCTEST_VERSION_PATCH 0
#define DOCTEST_VERSION_STR "2.3.0"
#define DOCTEST_VERSION_PATCH 1
#define DOCTEST_VERSION_STR "2.3.1"

#define DOCTEST_VERSION \
(DOCTEST_VERSION_MAJOR * 10000 + DOCTEST_VERSION_MINOR * 100 + DOCTEST_VERSION_PATCH)
Expand Down
4 changes: 2 additions & 2 deletions doctest/parts/doctest_fwd.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@

#define DOCTEST_VERSION_MAJOR 2
#define DOCTEST_VERSION_MINOR 3
#define DOCTEST_VERSION_PATCH 0
#define DOCTEST_VERSION_STR "2.3.0"
#define DOCTEST_VERSION_PATCH 1
#define DOCTEST_VERSION_STR "2.3.1"

#define DOCTEST_VERSION \
(DOCTEST_VERSION_MAJOR * 10000 + DOCTEST_VERSION_MINOR * 100 + DOCTEST_VERSION_PATCH)
Expand Down
2 changes: 1 addition & 1 deletion examples/all_features/test_output/version.txt
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"
2 changes: 1 addition & 1 deletion examples/all_features/test_output/version_xml.txt
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>
22 changes: 0 additions & 22 deletions examples/dll_installed_doctest/dll.cpp

This file was deleted.

34 changes: 0 additions & 34 deletions examples/dll_installed_doctest/main.cpp

This file was deleted.

35 changes: 0 additions & 35 deletions examples/executable_installed_doctest/main.cpp

This file was deleted.

22 changes: 22 additions & 0 deletions examples/installed_doctest_cmake/dll/dll.cpp
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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -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.
34 changes: 34 additions & 0 deletions examples/installed_doctest_cmake/dll/main.cpp
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)
35 changes: 35 additions & 0 deletions examples/installed_doctest_cmake/executable/main.cpp
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)
2 changes: 2 additions & 0 deletions scripts/random_dev_notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

figure out how to get the filters to the reporter interface so users can access them in any .cpp file (also the list of reporters)

move down from /Wall to /W4 for Visual Studio... /Wall is absolutely unnecessary and handling it clutters the repository

get rid of DOCTEST_DECLARE_DEFAULTS & friends...
AND get rid of DOCTEST_INTERFACE for simple structs!

Expand Down
2 changes: 1 addition & 1 deletion scripts/update_wandbox_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
readme_contents = ""
for line in fileinput.input(["../README.md"]):
if line.startswith("[![Try it online]"):
readme_contents += "[![Try it online](https://img.shields.io/badge/try-online-orange.svg)](" + url + ")\n"
readme_contents += "[![Try it online](https://img.shields.io/badge/try%20it-online-orange.svg)](" + url + ")\n"
else:
readme_contents += line

Expand Down
2 changes: 1 addition & 1 deletion scripts/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.3.0
2.3.1

0 comments on commit a3ae958

Please sign in to comment.