diff options
Diffstat (limited to 'examples/all_features')
-rw-r--r-- | examples/all_features/subcases.cpp | 20 | ||||
-rw-r--r-- | examples/all_features/test_output/filter_2.txt | 2 | ||||
-rw-r--r-- | examples/all_features/test_output/filter_2_xml.txt | 3 | ||||
-rw-r--r-- | examples/all_features/test_output/filter_3.txt | 9 | ||||
-rw-r--r-- | examples/all_features/test_output/filter_3_junit.txt | 6 | ||||
-rw-r--r-- | examples/all_features/test_output/filter_3_xml.txt | 10 | ||||
-rw-r--r-- | examples/all_features/test_output/no_multi_lane_atomics.txt | 67 | ||||
-rw-r--r-- | examples/all_features/test_output/no_multithreading.txt | 67 | ||||
-rw-r--r-- | examples/all_features/test_output/subcases.cpp.txt | 67 | ||||
-rw-r--r-- | examples/all_features/test_output/subcases.cpp_junit.txt | 62 | ||||
-rw-r--r-- | examples/all_features/test_output/subcases.cpp_xml.txt | 131 |
11 files changed, 430 insertions, 14 deletions
diff --git a/examples/all_features/subcases.cpp b/examples/all_features/subcases.cpp index df42b9d0..3fad25fd 100644 --- a/examples/all_features/subcases.cpp +++ b/examples/all_features/subcases.cpp @@ -34,6 +34,26 @@ TEST_CASE("lots of nested subcases") { } } +TEST_CASE("reentering subcase via regular control flow") { + cout << endl << "root" << endl; + for (int i : { 0, 1, 2 }) { + cout << "outside of subcase" << endl; + SUBCASE("") { cout << "inside subcase " << i << endl; } + SUBCASE("") { cout << "also inside " << i << endl; } + SUBCASE("") { + if (i != 0) { FAIL(i); } + cout << "fail inside " << i << endl; + } + SUBCASE("") { + cout << "inside outside" << endl; + for (int j : { 0, 1, 2 }) { + SUBCASE("") { cout << "nested twice " << i << ", " << j << endl; } + SUBCASE("") { cout << "also twice " << i << ", " << j << endl; } + } + } + } +} + static void call_func() { SUBCASE("from function...") { MESSAGE("print me twice"); diff --git a/examples/all_features/test_output/filter_2.txt b/examples/all_features/test_output/filter_2.txt index c734cf8f..9c154add 100644 --- a/examples/all_features/test_output/filter_2.txt +++ b/examples/all_features/test_output/filter_2.txt @@ -1,6 +1,6 @@ [doctest] run with "--help" for options =============================================================================== -[doctest] test cases: 0 | 0 passed | 0 failed | 99 skipped +[doctest] test cases: 0 | 0 passed | 0 failed | 100 skipped [doctest] assertions: 0 | 0 passed | 0 failed | [doctest] Status: SUCCESS! Program code. diff --git a/examples/all_features/test_output/filter_2_xml.txt b/examples/all_features/test_output/filter_2_xml.txt index e36071cd..fa6cd147 100644 --- a/examples/all_features/test_output/filter_2_xml.txt +++ b/examples/all_features/test_output/filter_2_xml.txt @@ -104,6 +104,7 @@ <TestCase name="part of some TS" filename="test_cases_and_suites.cpp" line="0" skipped="true"/> </TestSuite> <TestSuite> + <TestCase name="reentering subcase via regular control flow" filename="subcases.cpp" line="0" skipped="true"/> <TestCase name="should fail and no output" filename="no_failures.cpp" line="0" should_fail="true" skipped="true"/> <TestCase name="should fail and no output" filename="test_cases_and_suites.cpp" line="0" should_fail="true" skipped="true"/> <TestCase name="should fail because of an exception" filename="test_cases_and_suites.cpp" line="0" skipped="true"/> @@ -141,6 +142,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="99"/> + <OverallResultsTestCases successes="0" failures="0" skipped="100"/> </doctest> Program code. diff --git a/examples/all_features/test_output/filter_3.txt b/examples/all_features/test_output/filter_3.txt index e2f2be93..7da4b5c4 100644 --- a/examples/all_features/test_output/filter_3.txt +++ b/examples/all_features/test_output/filter_3.txt @@ -1,6 +1,11 @@ [doctest] run with "--help" for options root + +root +outside of subcase +outside of subcase +outside of subcase =============================================================================== subcases.cpp(0): TEST CASE: subcases can be used in a separate function as well @@ -34,7 +39,7 @@ TEST CASE: without a funny name: subcases.cpp(0): MESSAGE: Nooo =============================================================================== -[doctest] test cases: 9 | 9 passed | 0 failed | -[doctest] assertions: 0 | 0 passed | 0 failed | +[doctest] test cases: 10 | 10 passed | 0 failed | +[doctest] assertions: 0 | 0 passed | 0 failed | [doctest] Status: SUCCESS! Program code. diff --git a/examples/all_features/test_output/filter_3_junit.txt b/examples/all_features/test_output/filter_3_junit.txt index 04f78c57..6ea54f98 100644 --- a/examples/all_features/test_output/filter_3_junit.txt +++ b/examples/all_features/test_output/filter_3_junit.txt @@ -1,9 +1,15 @@ <?xml version="1.0" encoding="UTF-8"?> root + +root +outside of subcase +outside of subcase +outside of subcase <testsuites> <testsuite name="all_features" errors="0" failures="0" tests="0"> <testcase classname="subcases.cpp" name="lots of nested subcases" status="run"/> + <testcase classname="subcases.cpp" name="reentering subcase via regular control flow" status="run"/> <testcase classname="subcases.cpp" name="subcases can be used in a separate function as well/from function.../sc1" status="run"/> <testcase classname="subcases.cpp" name=" Scenario: vectors can be sized and resized" status="run"/> <testcase classname="subcases.cpp" name="test case should fail even though the last subcase passes" status="run"/> diff --git a/examples/all_features/test_output/filter_3_xml.txt b/examples/all_features/test_output/filter_3_xml.txt index 1922de26..f662506c 100644 --- a/examples/all_features/test_output/filter_3_xml.txt +++ b/examples/all_features/test_output/filter_3_xml.txt @@ -7,6 +7,14 @@ root <OverallResultsAsserts successes="0" failures="0" test_case_success="true"/> </TestCase> + <TestCase name="reentering subcase via regular control flow" filename="subcases.cpp" line="0"> + +root +outside of subcase +outside of subcase +outside of subcase + <OverallResultsAsserts successes="0" failures="0" test_case_success="true"/> + </TestCase> <TestCase name="subcases can be used in a separate function as well" filename="subcases.cpp" line="0"> <SubCase name="from function..." filename="subcases.cpp" line="0"> <Message type="WARNING" filename="subcases.cpp" line="0"> @@ -59,6 +67,6 @@ root </TestCase> </TestSuite> <OverallResultsAsserts successes="0" failures="0"/> - <OverallResultsTestCases successes="9" failures="0"/> + <OverallResultsTestCases successes="10" failures="0"/> </doctest> Program code. diff --git a/examples/all_features/test_output/no_multi_lane_atomics.txt b/examples/all_features/test_output/no_multi_lane_atomics.txt index 490dd742..0d3888f6 100644 --- a/examples/all_features/test_output/no_multi_lane_atomics.txt +++ b/examples/all_features/test_output/no_multi_lane_atomics.txt @@ -638,6 +638,69 @@ TEST CASE: part of some TS test_cases_and_suites.cpp(0): FATAL ERROR: + +root +outside of subcase +inside subcase 0 +outside of subcase +inside subcase 1 +outside of subcase +inside subcase 2 + +root +outside of subcase +also inside 0 +outside of subcase +also inside 1 +outside of subcase +also inside 2 + +root +outside of subcase +fail inside 0 +outside of subcase +=============================================================================== +subcases.cpp(0): +TEST CASE: reentering subcase via regular control flow + +DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE): + +subcases.cpp(0): FATAL ERROR: 1 + + +root +outside of subcase +inside outside +nested twice 0, 0 +nested twice 0, 1 +nested twice 0, 2 +outside of subcase +inside outside +nested twice 1, 0 +nested twice 1, 1 +nested twice 1, 2 +outside of subcase +inside outside +nested twice 2, 0 +nested twice 2, 1 +nested twice 2, 2 + +root +outside of subcase +inside outside +also twice 0, 0 +also twice 0, 1 +also twice 0, 2 +outside of subcase +inside outside +also twice 1, 0 +also twice 1, 1 +also twice 1, 2 +outside of subcase +inside outside +also twice 2, 0 +also twice 2, 1 +also twice 2, 2 =============================================================================== test_cases_and_suites.cpp(0): TEST CASE: should fail because of an exception @@ -814,7 +877,7 @@ TEST CASE: without a funny name: subcases.cpp(0): MESSAGE: Nooo =============================================================================== -[doctest] test cases: 79 | 30 passed | 49 failed | -[doctest] assertions: 215 | 100 passed | 115 failed | +[doctest] test cases: 80 | 30 passed | 50 failed | +[doctest] assertions: 216 | 100 passed | 116 failed | [doctest] Status: FAILURE! Program code. diff --git a/examples/all_features/test_output/no_multithreading.txt b/examples/all_features/test_output/no_multithreading.txt index 490dd742..0d3888f6 100644 --- a/examples/all_features/test_output/no_multithreading.txt +++ b/examples/all_features/test_output/no_multithreading.txt @@ -638,6 +638,69 @@ TEST CASE: part of some TS test_cases_and_suites.cpp(0): FATAL ERROR: + +root +outside of subcase +inside subcase 0 +outside of subcase +inside subcase 1 +outside of subcase +inside subcase 2 + +root +outside of subcase +also inside 0 +outside of subcase +also inside 1 +outside of subcase +also inside 2 + +root +outside of subcase +fail inside 0 +outside of subcase +=============================================================================== +subcases.cpp(0): +TEST CASE: reentering subcase via regular control flow + +DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE): + +subcases.cpp(0): FATAL ERROR: 1 + + +root +outside of subcase +inside outside +nested twice 0, 0 +nested twice 0, 1 +nested twice 0, 2 +outside of subcase +inside outside +nested twice 1, 0 +nested twice 1, 1 +nested twice 1, 2 +outside of subcase +inside outside +nested twice 2, 0 +nested twice 2, 1 +nested twice 2, 2 + +root +outside of subcase +inside outside +also twice 0, 0 +also twice 0, 1 +also twice 0, 2 +outside of subcase +inside outside +also twice 1, 0 +also twice 1, 1 +also twice 1, 2 +outside of subcase +inside outside +also twice 2, 0 +also twice 2, 1 +also twice 2, 2 =============================================================================== test_cases_and_suites.cpp(0): TEST CASE: should fail because of an exception @@ -814,7 +877,7 @@ TEST CASE: without a funny name: subcases.cpp(0): MESSAGE: Nooo =============================================================================== -[doctest] test cases: 79 | 30 passed | 49 failed | -[doctest] assertions: 215 | 100 passed | 115 failed | +[doctest] test cases: 80 | 30 passed | 50 failed | +[doctest] assertions: 216 | 100 passed | 116 failed | [doctest] Status: FAILURE! Program code. diff --git a/examples/all_features/test_output/subcases.cpp.txt b/examples/all_features/test_output/subcases.cpp.txt index 0acc7bf1..8ce6f4e7 100644 --- a/examples/all_features/test_output/subcases.cpp.txt +++ b/examples/all_features/test_output/subcases.cpp.txt @@ -16,6 +16,69 @@ TEST CASE: lots of nested subcases subcases.cpp(0): FATAL ERROR: + +root +outside of subcase +inside subcase 0 +outside of subcase +inside subcase 1 +outside of subcase +inside subcase 2 + +root +outside of subcase +also inside 0 +outside of subcase +also inside 1 +outside of subcase +also inside 2 + +root +outside of subcase +fail inside 0 +outside of subcase +=============================================================================== +subcases.cpp(0): +TEST CASE: reentering subcase via regular control flow + +DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE): + +subcases.cpp(0): FATAL ERROR: 1 + + +root +outside of subcase +inside outside +nested twice 0, 0 +nested twice 0, 1 +nested twice 0, 2 +outside of subcase +inside outside +nested twice 1, 0 +nested twice 1, 1 +nested twice 1, 2 +outside of subcase +inside outside +nested twice 2, 0 +nested twice 2, 1 +nested twice 2, 2 + +root +outside of subcase +inside outside +also twice 0, 0 +also twice 0, 1 +also twice 0, 2 +outside of subcase +inside outside +also twice 1, 0 +also twice 1, 1 +also twice 1, 2 +outside of subcase +inside outside +also twice 2, 0 +also twice 2, 1 +also twice 2, 2 =============================================================================== subcases.cpp(0): TEST CASE: subcases can be used in a separate function as well @@ -225,7 +288,7 @@ TEST CASE: without a funny name: subcases.cpp(0): MESSAGE: Nooo =============================================================================== -[doctest] test cases: 9 | 5 passed | 4 failed | -[doctest] assertions: 25 | 19 passed | 6 failed | +[doctest] test cases: 10 | 5 passed | 5 failed | +[doctest] assertions: 26 | 19 passed | 7 failed | [doctest] Status: FAILURE! Program code. diff --git a/examples/all_features/test_output/subcases.cpp_junit.txt b/examples/all_features/test_output/subcases.cpp_junit.txt index d1c82380..0526b7d0 100644 --- a/examples/all_features/test_output/subcases.cpp_junit.txt +++ b/examples/all_features/test_output/subcases.cpp_junit.txt @@ -10,11 +10,71 @@ root root 2 + +root +outside of subcase +inside subcase 0 +outside of subcase +inside subcase 1 +outside of subcase +inside subcase 2 + +root +outside of subcase +also inside 0 +outside of subcase +also inside 1 +outside of subcase +also inside 2 + +root +outside of subcase +fail inside 0 +outside of subcase + +root +outside of subcase +inside outside +nested twice 0, 0 +nested twice 0, 1 +nested twice 0, 2 +outside of subcase +inside outside +nested twice 1, 0 +nested twice 1, 1 +nested twice 1, 2 +outside of subcase +inside outside +nested twice 2, 0 +nested twice 2, 1 +nested twice 2, 2 + +root +outside of subcase +inside outside +also twice 0, 0 +also twice 0, 1 +also twice 0, 2 +outside of subcase +inside outside +also twice 1, 0 +also twice 1, 1 +also twice 1, 2 +outside of subcase +inside outside +also twice 2, 0 +also twice 2, 1 +also twice 2, 2 <testsuites> - <testsuite name="all_features" errors="4" failures="5" tests="25"> + <testsuite name="all_features" errors="4" failures="5" tests="26"> <testcase classname="subcases.cpp" name="lots of nested subcases" status="run"/> <testcase classname="subcases.cpp" name="lots of nested subcases" status="run"/> <testcase classname="subcases.cpp" name="lots of nested subcases" status="run"/> + <testcase classname="subcases.cpp" name="reentering subcase via regular control flow" status="run"/> + <testcase classname="subcases.cpp" name="reentering subcase via regular control flow" status="run"/> + <testcase classname="subcases.cpp" name="reentering subcase via regular control flow" status="run"/> + <testcase classname="subcases.cpp" name="reentering subcase via regular control flow" status="run"/> + <testcase classname="subcases.cpp" name="reentering subcase via regular control flow" status="run"/> <testcase classname="subcases.cpp" name="subcases can be used in a separate function as well/from function.../sc1" status="run"/> <testcase classname="subcases.cpp" name="subcases can be used in a separate function as well/from function.../sc2" status="run"/> <testcase classname="subcases.cpp" name=" Scenario: vectors can be sized and resized/ Given: A vector with some items/ When: the size is increased/ Then: the size and capacity change" status="run"> diff --git a/examples/all_features/test_output/subcases.cpp_xml.txt b/examples/all_features/test_output/subcases.cpp_xml.txt index ad208bb4..465fcd0f 100644 --- a/examples/all_features/test_output/subcases.cpp_xml.txt +++ b/examples/all_features/test_output/subcases.cpp_xml.txt @@ -31,6 +31,133 @@ root </SubCase> <OverallResultsAsserts successes="0" failures="1" test_case_success="false"/> </TestCase> + <TestCase name="reentering subcase via regular control flow" filename="subcases.cpp" line="0"> + +root +outside of subcase + <SubCase filename="subcases.cpp" line="0"> +inside subcase 0 + </SubCase> +outside of subcase + <SubCase filename="subcases.cpp" line="0"> +inside subcase 1 + </SubCase> +outside of subcase + <SubCase filename="subcases.cpp" line="0"> +inside subcase 2 + </SubCase> + +root +outside of subcase + <SubCase filename="subcases.cpp" line="0"> +also inside 0 + </SubCase> +outside of subcase + <SubCase filename="subcases.cpp" line="0"> +also inside 1 + </SubCase> +outside of subcase + <SubCase filename="subcases.cpp" line="0"> +also inside 2 + </SubCase> + +root +outside of subcase + <SubCase filename="subcases.cpp" line="0"> +fail inside 0 + </SubCase> +outside of subcase + <SubCase filename="subcases.cpp" line="0"> + <Message type="FATAL ERROR" filename="subcases.cpp" line="0"> + <Text> + 1 + </Text> + </Message> + </SubCase> + +root +outside of subcase + <SubCase filename="subcases.cpp" line="0"> +inside outside + <SubCase filename="subcases.cpp" line="0"> +nested twice 0, 0 + </SubCase> + <SubCase filename="subcases.cpp" line="0"> +nested twice 0, 1 + </SubCase> + <SubCase filename="subcases.cpp" line="0"> +nested twice 0, 2 + </SubCase> + </SubCase> +outside of subcase + <SubCase filename="subcases.cpp" line="0"> +inside outside + <SubCase filename="subcases.cpp" line="0"> +nested twice 1, 0 + </SubCase> + <SubCase filename="subcases.cpp" line="0"> +nested twice 1, 1 + </SubCase> + <SubCase filename="subcases.cpp" line="0"> +nested twice 1, 2 + </SubCase> + </SubCase> +outside of subcase + <SubCase filename="subcases.cpp" line="0"> +inside outside + <SubCase filename="subcases.cpp" line="0"> +nested twice 2, 0 + </SubCase> + <SubCase filename="subcases.cpp" line="0"> +nested twice 2, 1 + </SubCase> + <SubCase filename="subcases.cpp" line="0"> +nested twice 2, 2 + </SubCase> + </SubCase> + +root +outside of subcase + <SubCase filename="subcases.cpp" line="0"> +inside outside + <SubCase filename="subcases.cpp" line="0"> +also twice 0, 0 + </SubCase> + <SubCase filename="subcases.cpp" line="0"> +also twice 0, 1 + </SubCase> + <SubCase filename="subcases.cpp" line="0"> +also twice 0, 2 + </SubCase> + </SubCase> +outside of subcase + <SubCase filename="subcases.cpp" line="0"> +inside outside + <SubCase filename="subcases.cpp" line="0"> +also twice 1, 0 + </SubCase> + <SubCase filename="subcases.cpp" line="0"> +also twice 1, 1 + </SubCase> + <SubCase filename="subcases.cpp" line="0"> +also twice 1, 2 + </SubCase> + </SubCase> +outside of subcase + <SubCase filename="subcases.cpp" line="0"> +inside outside + <SubCase filename="subcases.cpp" line="0"> +also twice 2, 0 + </SubCase> + <SubCase filename="subcases.cpp" line="0"> +also twice 2, 1 + </SubCase> + <SubCase filename="subcases.cpp" line="0"> +also twice 2, 2 + </SubCase> + </SubCase> + <OverallResultsAsserts successes="0" failures="1" test_case_success="false"/> + </TestCase> <TestCase name="subcases can be used in a separate function as well" filename="subcases.cpp" line="0"> <SubCase name="from function..." filename="subcases.cpp" line="0"> <Message type="WARNING" filename="subcases.cpp" line="0"> @@ -269,7 +396,7 @@ root <OverallResultsAsserts successes="0" failures="0" test_case_success="true"/> </TestCase> </TestSuite> - <OverallResultsAsserts successes="19" failures="6"/> - <OverallResultsTestCases successes="5" failures="4"/> + <OverallResultsAsserts successes="19" failures="7"/> + <OverallResultsTestCases successes="5" failures="5"/> </doctest> Program code. |