diff options
-rw-r--r-- | CONTRIBUTING.md | 2 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | doc/markdown/faq.md | 1 | ||||
-rw-r--r-- | doc/markdown/roadmap.md | 15 | ||||
-rw-r--r-- | examples/separate_headers/test.cpp | 34 | ||||
-rw-r--r-- | examples/separate_headers/test_output/separate_headers.txt | 71 |
6 files changed, 14 insertions, 111 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 915764a..edbb7f4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -12,7 +12,7 @@ Consider opening an issue for a discussion before making a pull request to make All pull requests should be made against the ```dev``` branch because the ```master``` is the stable one with the latest release. -If you're going to change something in the library itself - make sure you don't modify ```doctest/doctest.h``` because it's generated from ```doctest/parts/doctest_fwd.h``` and ```doctest/parts/doctest_impl.h``` - they get concatenated by CMake - so make sure you do a CMake build after you modify them so the ```assemble_single_header``` target gets built. +If you're going to change something in the library itself - make sure you don't modify ```doctest/doctest.h``` because it's generated from ```doctest/parts/doctest_fwd.h``` and ```doctest/parts/doctest_impl.h``` - they get concatenated by CMake - so make sure you do a CMake build after you modify them so the ```assemble_single_header``` target gets built. Also take into consideration how the change affects the code coverage - based on the project in ```scripts/code_coverage_source```. Also update any relevant examples in the ```examples``` folder. This framework has some design goals which must be kept. Make sure you have read the [**features and design goals**](features.md) page. @@ -47,6 +47,8 @@ This allows the framework to be used in more ways than any other - tests can be The library can be used like any other if you don't like the idea of mixing production code and tests - check out the [**features**](doc/markdown/features.md) +[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/503/badge)](https://bestpractices.coreinfrastructure.org/projects/503) + [![Language](https://img.shields.io/badge/language-C++-blue.svg)](https://isocpp.org/) [![Standard](https://img.shields.io/badge/c%2B%2B-98/11/14/17-blue.svg)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT) diff --git a/doc/markdown/faq.md b/doc/markdown/faq.md index 1a2d69f..a373c2d 100644 --- a/doc/markdown/faq.md +++ b/doc/markdown/faq.md @@ -31,7 +31,6 @@ Missing stuff: - no support for tags (the user can add *tags* in the test case names like this: ```TEST_CASE("[myTag] test name")```) - a reporter/listener system - to a file, to xml, ability for the user to write their own reporter, etc. - measuring how much time a test case executes -- signal handling - matchers and generators - other small stuff diff --git a/doc/markdown/roadmap.md b/doc/markdown/roadmap.md index 2705ab0..0a00bd6 100644 --- a/doc/markdown/roadmap.md +++ b/doc/markdown/roadmap.md @@ -95,22 +95,24 @@ Planned features for future releases - order changes constantly... - checkpoint/passpoint - like in [boost test](http://www.boost.org/doc/libs/1_63_0/libs/test/doc/html/boost_test/test_output/test_tools_support_for_logging/checkpoints.html) (also make all assert/subcase/logging macros to act as passpoints and print the last one on crashes or exceptions) - log levels - like in [boost test](http://www.boost.org/doc/libs/1_63_0/libs/test/doc/html/boost_test/utf_reference/rt_param_reference/log_level.html) - integrate static analysis on the CI: **msvc**, **clang**, **cppcheck** -- option to list files in which there are test cases who match the current filters -- option for filters to switch from "match any" to "match all" mode -- option to list test suites and test cases in a tree view - queries for the current test case - name (and probably decorators) - thread safety - asserts/subcases/captures should be safe to be used by multiple threads simultaneously - support for running tests in parallel in multiple threads - death tests - as in [google test](https://github.com/google/googletest/blob/master/googletest/docs/AdvancedGuide.md#death-tests) +- command line + - ability to specify ASC/DESC for the order option + - command line error handling/reporting + - ability for the user to extend the command line - as requested [here](https://github.com/philsquared/Catch/issues/622) + - option to list files in which there are test cases who match the current filters + - option for filters to switch from "match any" to "match all" mode + - option to list test suites and test cases in a tree view + - add a "wait key" option - as requested [here](https://github.com/philsquared/Catch/issues/477#issuecomment-256417686) - setup / teardown support - global setup / teardown - can be currently achieved by providing a custom main function - per test suite - perhaps for fixtures in addition to the constructor / destructor - since throwing in the destructor might terminate the program - or just ignore all of this this - it would require globals or classes and inheritance - and we already have subcases - doctest in a GUI environment? with no console? APIs for attaching a console? querying if there is one? [investigate...](https://github.com/philsquared/Catch/blob/master/docs/configuration.md#stdout) -- ability to specify ASC/DESC for the order option -- command line error handling/reporting -- ability for the user to extend the command line - as requested [here](https://github.com/philsquared/Catch/issues/622) - look into MSTest integration - http://accu.org/index.php/journals/1851 - https://msdn.microsoft.com/en-us/library/hh270865.aspx @@ -131,7 +133,6 @@ Planned features for future releases - order changes constantly... - utf8??? - handle ```wchar``` strings??? - hierarchical test suites - using a stack for the pushed ones -- add a "wait key" option - as requested [here](https://github.com/philsquared/Catch/issues/477#issuecomment-256417686) - ability to specify the width of the terminal in terms of characters (for example 60 - less than 80 - the default) - ability to re-run only newly compiled tests based on time stamps using ```__DATE__``` and ```__TIME__``` - stored in some file - add underscores to all preprocessor identifiers not intended for use by the user diff --git a/examples/separate_headers/test.cpp b/examples/separate_headers/test.cpp index 34ea2b0..44f81b6 100644 --- a/examples/separate_headers/test.cpp +++ b/examples/separate_headers/test.cpp @@ -3,38 +3,6 @@ #include <iostream> using namespace std; -using doctest::Approx; +TEST_CASE("dev stuff") { -class Volatility -{ - double underlying_; - -public: - explicit Volatility(double u) - : underlying_(u) {} - //explicit - operator double() const { return underlying_; } -}; - -//static int throws(bool in) { if(in) throw 42; return 42; } - -TEST_CASE("") { - Volatility asd(1.0); - CHECK(static_cast<double>(asd) == Approx(1)); - CHECK(asd == Approx(1)); - CHECK(Approx(1) == asd); - CHECK(Approx(asd) == 1.0); - - INFO("aaaa" << "sad :("); - //throws(true); - - CHECK(Approx(1) == 2); - CHECK(Approx(1) == 2.0); - CHECK(Approx(1) == 2.f); - CHECK(Approx(1.0) == 2); - CHECK(Approx(1.0) == 2.0); - CHECK(Approx(1.0) == 2.f); - CHECK(Approx(1.f) == 2); - CHECK(Approx(1.f) == 2.0); - CHECK(Approx(1.f) == 2.f); } diff --git a/examples/separate_headers/test_output/separate_headers.txt b/examples/separate_headers/test_output/separate_headers.txt index 6c9b10d..9f6cbf1 100644 --- a/examples/separate_headers/test_output/separate_headers.txt +++ b/examples/separate_headers/test_output/separate_headers.txt @@ -1,71 +1,4 @@ [doctest] run with "--help" for options -== TEST CASE ================================================================== -test.cpp(0) - - -test.cpp(0) ERROR! - CHECK( Approx(1) == 2 ) -with expansion: - CHECK( Approx( 1.0 ) == 2 ) -with context: - aaaasad :( - -test.cpp(0) ERROR! - CHECK( Approx(1) == 2.0 ) -with expansion: - CHECK( Approx( 1.0 ) == 2.0 ) -with context: - aaaasad :( - -test.cpp(0) ERROR! - CHECK( Approx(1) == 2.f ) -with expansion: - CHECK( Approx( 1.0 ) == 2.0f ) -with context: - aaaasad :( - -test.cpp(0) ERROR! - CHECK( Approx(1.0) == 2 ) -with expansion: - CHECK( Approx( 1.0 ) == 2 ) -with context: - aaaasad :( - -test.cpp(0) ERROR! - CHECK( Approx(1.0) == 2.0 ) -with expansion: - CHECK( Approx( 1.0 ) == 2.0 ) -with context: - aaaasad :( - -test.cpp(0) ERROR! - CHECK( Approx(1.0) == 2.f ) -with expansion: - CHECK( Approx( 1.0 ) == 2.0f ) -with context: - aaaasad :( - -test.cpp(0) ERROR! - CHECK( Approx(1.f) == 2 ) -with expansion: - CHECK( Approx( 1.0 ) == 2 ) -with context: - aaaasad :( - -test.cpp(0) ERROR! - CHECK( Approx(1.f) == 2.0 ) -with expansion: - CHECK( Approx( 1.0 ) == 2.0 ) -with context: - aaaasad :( - -test.cpp(0) ERROR! - CHECK( Approx(1.f) == 2.f ) -with expansion: - CHECK( Approx( 1.0 ) == 2.0f ) -with context: - aaaasad :( - =============================================================================== -[doctest] test cases: 1 | 0 passed | 1 failed | 0 skipped -[doctest] assertions: 13 | 4 passed | 9 failed | +[doctest] test cases: 1 | 1 passed | 0 failed | 0 skipped +[doctest] assertions: 0 | 0 passed | 0 failed | |