Skip to content

Commit

Permalink
Recollect tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Saalvage committed Apr 28, 2022
1 parent e8ba771 commit a35e7ce
Show file tree
Hide file tree
Showing 5 changed files with 116 additions and 29 deletions.
3 changes: 0 additions & 3 deletions doctest/doctest.h
Original file line number Diff line number Diff line change
Expand Up @@ -3081,10 +3081,7 @@ DOCTEST_MAKE_STD_HEADERS_CLEAN_FROM_WARNINGS_ON_WALL_BEGIN
#include <cfloat>
#include <cctype>
#include <cstdint>
#if DOCTEST_MSVC >= DOCTEST_COMPILER(19, 20, 0)
// see this issue on why this is needed: https://github.com/doctest/doctest/issues/183
#include <string>
#endif // VS 2019

#ifdef DOCTEST_PLATFORM_MAC
#include <sys/types.h>
Expand Down
2 changes: 1 addition & 1 deletion examples/all_features/test_output/filter_2.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[doctest] run with "--help" for options
===============================================================================
[doctest] test cases: 0 | 0 passed | 0 failed | 100 skipped
[doctest] test cases: 0 | 0 passed | 0 failed | 102 skipped
[doctest] assertions: 0 | 0 passed | 0 failed |
[doctest] Status: SUCCESS!
Program code.
2 changes: 1 addition & 1 deletion examples/all_features/test_output/filter_2_xml.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,6 @@
<TestCase name="without a funny name:" filename="subcases.cpp" line="0" skipped="true"/>
</TestSuite>
<OverallResultsAsserts successes="0" failures="0"/>
<OverallResultsTestCases successes="0" failures="0" skipped="100"/>
<OverallResultsTestCases successes="0" failures="0" skipped="102"/>
</doctest>
Program code.
69 changes: 57 additions & 12 deletions examples/all_features/test_output/no_multi_lane_atomics.txt
Original file line number Diff line number Diff line change
Expand Up @@ -214,20 +214,28 @@ logging.cpp(0): ERROR: test case THREW exception: 0
stringification.cpp(0):
TEST CASE: all asserts should fail and show how the objects get stringified

stringification.cpp(0): MESSAGE: Foo{}

stringification.cpp(0): ERROR: CHECK( f1 == f2 ) is NOT correct!
values: CHECK( Foo{} == Foo{} )

stringification.cpp(0): MESSAGE: omg

stringification.cpp(0): ERROR: CHECK( dummy == "tralala" ) is NOT correct!
values: CHECK( omg == tralala )

stringification.cpp(0): ERROR: CHECK( "tralala" == dummy ) is NOT correct!
values: CHECK( tralala == omg )

stringification.cpp(0): MESSAGE: [1, 2, 3]

stringification.cpp(0): ERROR: CHECK( vec1 == vec2 ) is NOT correct!
values: CHECK( [1, 2, 3] == [1, 2, 4] )

stringification.cpp(0): MESSAGE: [1, 42, 3]

stringification.cpp(0): ERROR: CHECK( lst_1 == lst_2 ) is NOT correct!
values: CHECK( [1, 42, 3, ] == [1, 2, 666, ] )
values: CHECK( [1, 42, 3] == [1, 2, 666] )

stringification.cpp(0): ERROR: CHECK( s1 == s2 ) is NOT correct!
values: CHECK( MyOtherType: 42 == MyOtherType: 666 )
Expand All @@ -238,12 +246,6 @@ stringification.cpp(0): ERROR: CHECK( s1 == s2 ) is NOT correct!
logged: s1=MyOtherType: 42 s2=MyOtherType: 666
MyOtherType: 42 is not really MyOtherType: 666

stringification.cpp(0): ERROR: CHECK( doctest::IsNaN<double>(0.5) ) is NOT correct!
values: CHECK( 0.5 )

stringification.cpp(0): ERROR: CHECK( doctest::IsNaN<float>(std::numeric_limits<float>::infinity()) ) is NOT correct!
values: CHECK( inf )

stringification.cpp(0): ERROR: CHECK( "a" == doctest::Contains("aaa") ) is NOT correct!
values: CHECK( a == Contains( aaa ) )

Expand Down Expand Up @@ -581,25 +583,58 @@ subcases.cpp(0): FATAL ERROR:

===============================================================================
templated_test_cases.cpp(0):
TEST CASE: multiple types<>
TEST CASE: multiple types<Custom name test>

templated_test_cases.cpp(0): ERROR: CHECK( t2 != T2() ) is NOT correct!
values: CHECK( 0 != 0 )

===============================================================================
templated_test_cases.cpp(0):
TEST CASE: multiple types<>
TEST CASE: multiple types<Other custom name>

templated_test_cases.cpp(0): ERROR: CHECK( t2 != T2() ) is NOT correct!
values: CHECK( 0 != 0 )

===============================================================================
templated_test_cases.cpp(0):
TEST CASE: multiple types<>
TEST CASE: multiple types<TypePair<bool, int>>

templated_test_cases.cpp(0): ERROR: CHECK( t2 != T2() ) is NOT correct!
values: CHECK( 0 != 0 )

===============================================================================
stringification.cpp(0):
TEST CASE: no headers

stringification.cpp(0): MESSAGE: 1as

stringification.cpp(0): ERROR: CHECK( chs == nullptr ) is NOT correct!
values: CHECK( 1as == nullptr )

stringification.cpp(0): MESSAGE: 1as

stringification.cpp(0): ERROR: CHECK( "1as" == nullptr ) is NOT correct!
values: CHECK( 1as == nullptr )

stringification.cpp(0): MESSAGE: [0, 1, 1, 2, 3, 5, 8, 13]

stringification.cpp(0): ERROR: CHECK( ints == nullptr ) is NOT correct!
values: CHECK( [0, 1, 1, 2, 3, 5, 8, 13] == nullptr )

stringification.cpp(0): MESSAGE: [0, 1, 1, 2, 3, 5, 8, 13]

stringification.cpp(0): MESSAGE: nullptr

stringification.cpp(0): ERROR: CHECK( cnptr != nullptr ) is NOT correct!
values: CHECK( nullptr != nullptr )

stringification.cpp(0): MESSAGE: 0

stringification.cpp(0): ERROR: CHECK( A == C ) is NOT correct!
values: CHECK( 0 == 100 )

stringification.cpp(0): MESSAGE: int

===============================================================================
assertion_macros.cpp(0):
TEST CASE: normal macros
Expand All @@ -617,6 +652,16 @@ TEST CASE: normal test in a test suite from a decorator
test_cases_and_suites.cpp(0): MESSAGE: failing because of the timeout decorator!

Test case exceeded time limit of 0.000001!
===============================================================================
stringification.cpp(0):
TEST CASE: operator<<

stringification.cpp(0): MESSAGE: A

stringification.cpp(0): MESSAGE: B

stringification.cpp(0): MESSAGE: C

===============================================================================
test_cases_and_suites.cpp(0):
TEST SUITE: scoped test suite
Expand Down Expand Up @@ -877,7 +922,7 @@ TEST CASE: without a funny name:
subcases.cpp(0): MESSAGE: Nooo

===============================================================================
[doctest] test cases: 80 | 30 passed | 50 failed |
[doctest] assertions: 216 | 100 passed | 116 failed |
[doctest] test cases: 82 | 31 passed | 51 failed |
[doctest] assertions: 224 | 105 passed | 119 failed |
[doctest] Status: FAILURE!
Program code.
69 changes: 57 additions & 12 deletions examples/all_features/test_output/no_multithreading.txt
Original file line number Diff line number Diff line change
Expand Up @@ -214,20 +214,28 @@ logging.cpp(0): ERROR: test case THREW exception: 0
stringification.cpp(0):
TEST CASE: all asserts should fail and show how the objects get stringified

stringification.cpp(0): MESSAGE: Foo{}

stringification.cpp(0): ERROR: CHECK( f1 == f2 ) is NOT correct!
values: CHECK( Foo{} == Foo{} )

stringification.cpp(0): MESSAGE: omg

stringification.cpp(0): ERROR: CHECK( dummy == "tralala" ) is NOT correct!
values: CHECK( omg == tralala )

stringification.cpp(0): ERROR: CHECK( "tralala" == dummy ) is NOT correct!
values: CHECK( tralala == omg )

stringification.cpp(0): MESSAGE: [1, 2, 3]

stringification.cpp(0): ERROR: CHECK( vec1 == vec2 ) is NOT correct!
values: CHECK( [1, 2, 3] == [1, 2, 4] )

stringification.cpp(0): MESSAGE: [1, 42, 3]

stringification.cpp(0): ERROR: CHECK( lst_1 == lst_2 ) is NOT correct!
values: CHECK( [1, 42, 3, ] == [1, 2, 666, ] )
values: CHECK( [1, 42, 3] == [1, 2, 666] )

stringification.cpp(0): ERROR: CHECK( s1 == s2 ) is NOT correct!
values: CHECK( MyOtherType: 42 == MyOtherType: 666 )
Expand All @@ -238,12 +246,6 @@ stringification.cpp(0): ERROR: CHECK( s1 == s2 ) is NOT correct!
logged: s1=MyOtherType: 42 s2=MyOtherType: 666
MyOtherType: 42 is not really MyOtherType: 666

stringification.cpp(0): ERROR: CHECK( doctest::IsNaN<double>(0.5) ) is NOT correct!
values: CHECK( 0.5 )

stringification.cpp(0): ERROR: CHECK( doctest::IsNaN<float>(std::numeric_limits<float>::infinity()) ) is NOT correct!
values: CHECK( inf )

stringification.cpp(0): ERROR: CHECK( "a" == doctest::Contains("aaa") ) is NOT correct!
values: CHECK( a == Contains( aaa ) )

Expand Down Expand Up @@ -581,25 +583,58 @@ subcases.cpp(0): FATAL ERROR:

===============================================================================
templated_test_cases.cpp(0):
TEST CASE: multiple types<>
TEST CASE: multiple types<Custom name test>

templated_test_cases.cpp(0): ERROR: CHECK( t2 != T2() ) is NOT correct!
values: CHECK( 0 != 0 )

===============================================================================
templated_test_cases.cpp(0):
TEST CASE: multiple types<>
TEST CASE: multiple types<Other custom name>

templated_test_cases.cpp(0): ERROR: CHECK( t2 != T2() ) is NOT correct!
values: CHECK( 0 != 0 )

===============================================================================
templated_test_cases.cpp(0):
TEST CASE: multiple types<>
TEST CASE: multiple types<TypePair<bool, int>>

templated_test_cases.cpp(0): ERROR: CHECK( t2 != T2() ) is NOT correct!
values: CHECK( 0 != 0 )

===============================================================================
stringification.cpp(0):
TEST CASE: no headers

stringification.cpp(0): MESSAGE: 1as

stringification.cpp(0): ERROR: CHECK( chs == nullptr ) is NOT correct!
values: CHECK( 1as == nullptr )

stringification.cpp(0): MESSAGE: 1as

stringification.cpp(0): ERROR: CHECK( "1as" == nullptr ) is NOT correct!
values: CHECK( 1as == nullptr )

stringification.cpp(0): MESSAGE: [0, 1, 1, 2, 3, 5, 8, 13]

stringification.cpp(0): ERROR: CHECK( ints == nullptr ) is NOT correct!
values: CHECK( [0, 1, 1, 2, 3, 5, 8, 13] == nullptr )

stringification.cpp(0): MESSAGE: [0, 1, 1, 2, 3, 5, 8, 13]

stringification.cpp(0): MESSAGE: nullptr

stringification.cpp(0): ERROR: CHECK( cnptr != nullptr ) is NOT correct!
values: CHECK( nullptr != nullptr )

stringification.cpp(0): MESSAGE: 0

stringification.cpp(0): ERROR: CHECK( A == C ) is NOT correct!
values: CHECK( 0 == 100 )

stringification.cpp(0): MESSAGE: int

===============================================================================
assertion_macros.cpp(0):
TEST CASE: normal macros
Expand All @@ -617,6 +652,16 @@ TEST CASE: normal test in a test suite from a decorator
test_cases_and_suites.cpp(0): MESSAGE: failing because of the timeout decorator!

Test case exceeded time limit of 0.000001!
===============================================================================
stringification.cpp(0):
TEST CASE: operator<<

stringification.cpp(0): MESSAGE: A

stringification.cpp(0): MESSAGE: B

stringification.cpp(0): MESSAGE: C

===============================================================================
test_cases_and_suites.cpp(0):
TEST SUITE: scoped test suite
Expand Down Expand Up @@ -877,7 +922,7 @@ TEST CASE: without a funny name:
subcases.cpp(0): MESSAGE: Nooo

===============================================================================
[doctest] test cases: 80 | 30 passed | 50 failed |
[doctest] assertions: 216 | 100 passed | 116 failed |
[doctest] test cases: 82 | 31 passed | 51 failed |
[doctest] assertions: 224 | 105 passed | 119 failed |
[doctest] Status: FAILURE!
Program code.

0 comments on commit a35e7ce

Please sign in to comment.