onqtam | 2c100d6 | 2017-04-16 22:47:28 +0300 | [diff] [blame] | 1 | [doctest] run with "--help" for options |
onqtam | 27079bc | 2017-04-16 23:21:13 +0300 | [diff] [blame] | 2 | |
| 3 | root |
| 4 | 1 |
| 5 | 1.1 |
| 6 | |
| 7 | root |
| 8 | 2 |
| 9 | 2.1 |
| 10 | |
| 11 | root |
| 12 | 2 |
onqtam | 35c14cd | 2017-04-24 12:54:03 +0300 | [diff] [blame] | 13 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 14 | subcases.cpp(0): |
onqtam | 35c14cd | 2017-04-24 12:54:03 +0300 | [diff] [blame] | 15 | TEST CASE: lots of nested subcases |
onqtam | 27079bc | 2017-04-16 23:21:13 +0300 | [diff] [blame] | 16 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 17 | subcases.cpp(0): FATAL ERROR: |
onqtam | 27079bc | 2017-04-16 23:21:13 +0300 | [diff] [blame] | 18 | |
onqtam | 35c14cd | 2017-04-24 12:54:03 +0300 | [diff] [blame] | 19 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 20 | subcases.cpp(0): |
onqtam | 35c14cd | 2017-04-24 12:54:03 +0300 | [diff] [blame] | 21 | TEST CASE: subcases can be used in a separate function as well |
onqtam | 5dbcb1e | 2017-05-02 23:07:56 +0300 | [diff] [blame] | 22 | from function... |
| 23 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 24 | subcases.cpp(0): MESSAGE: print me twice |
onqtam | 5dbcb1e | 2017-05-02 23:07:56 +0300 | [diff] [blame] | 25 | |
| 26 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 27 | subcases.cpp(0): |
onqtam | 5dbcb1e | 2017-05-02 23:07:56 +0300 | [diff] [blame] | 28 | TEST CASE: subcases can be used in a separate function as well |
| 29 | from function... |
onqtam | 378d670 | 2017-04-19 11:30:03 +0300 | [diff] [blame] | 30 | sc1 |
| 31 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 32 | subcases.cpp(0): MESSAGE: hello! from sc1 |
onqtam | 378d670 | 2017-04-19 11:30:03 +0300 | [diff] [blame] | 33 | |
onqtam | 35c14cd | 2017-04-24 12:54:03 +0300 | [diff] [blame] | 34 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 35 | subcases.cpp(0): |
onqtam | 35c14cd | 2017-04-24 12:54:03 +0300 | [diff] [blame] | 36 | TEST CASE: subcases can be used in a separate function as well |
onqtam | a82c1e4 | 2017-05-07 17:36:41 +0300 | [diff] [blame] | 37 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 38 | subcases.cpp(0): MESSAGE: lala |
onqtam | a82c1e4 | 2017-05-07 17:36:41 +0300 | [diff] [blame] | 39 | |
| 40 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 41 | subcases.cpp(0): |
onqtam | a82c1e4 | 2017-05-07 17:36:41 +0300 | [diff] [blame] | 42 | TEST CASE: subcases can be used in a separate function as well |
onqtam | 5dbcb1e | 2017-05-02 23:07:56 +0300 | [diff] [blame] | 43 | from function... |
| 44 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 45 | subcases.cpp(0): MESSAGE: print me twice |
onqtam | 5dbcb1e | 2017-05-02 23:07:56 +0300 | [diff] [blame] | 46 | |
| 47 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 48 | subcases.cpp(0): |
onqtam | 5dbcb1e | 2017-05-02 23:07:56 +0300 | [diff] [blame] | 49 | TEST CASE: subcases can be used in a separate function as well |
| 50 | from function... |
onqtam | 378d670 | 2017-04-19 11:30:03 +0300 | [diff] [blame] | 51 | sc2 |
| 52 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 53 | subcases.cpp(0): MESSAGE: hello! from sc2 |
onqtam | 378d670 | 2017-04-19 11:30:03 +0300 | [diff] [blame] | 54 | |
onqtam | 35c14cd | 2017-04-24 12:54:03 +0300 | [diff] [blame] | 55 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 56 | subcases.cpp(0): |
onqtam | a82c1e4 | 2017-05-07 17:36:41 +0300 | [diff] [blame] | 57 | TEST CASE: subcases can be used in a separate function as well |
| 58 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 59 | subcases.cpp(0): MESSAGE: lala |
onqtam | a82c1e4 | 2017-05-07 17:36:41 +0300 | [diff] [blame] | 60 | |
| 61 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 62 | subcases.cpp(0): |
onqtam | 2c100d6 | 2017-04-16 22:47:28 +0300 | [diff] [blame] | 63 | Scenario: vectors can be sized and resized |
| 64 | Given: A vector with some items |
| 65 | When: the size is increased |
| 66 | Then: the size and capacity change |
| 67 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 68 | subcases.cpp(0): ERROR: CHECK( v.size() == 20 ) is NOT correct! |
| 69 | values: CHECK( 10 == 20 ) |
onqtam | 2c100d6 | 2017-04-16 22:47:28 +0300 | [diff] [blame] | 70 | |
onqtam | 35c14cd | 2017-04-24 12:54:03 +0300 | [diff] [blame] | 71 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 72 | subcases.cpp(0): |
onqtam | 2c100d6 | 2017-04-16 22:47:28 +0300 | [diff] [blame] | 73 | Scenario: vectors can be sized and resized |
| 74 | Given: A vector with some items |
| 75 | When: less capacity is reserved |
| 76 | Then: neither size nor capacity are changed |
| 77 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 78 | subcases.cpp(0): ERROR: CHECK( v.size() == 10 ) is NOT correct! |
| 79 | values: CHECK( 5 == 10 ) |
onqtam | 2c100d6 | 2017-04-16 22:47:28 +0300 | [diff] [blame] | 80 | |
onqtam | 2c100d6 | 2017-04-16 22:47:28 +0300 | [diff] [blame] | 81 | =============================================================================== |
onqtam | dc01198 | 2018-10-24 16:57:10 +0300 | [diff] [blame] | 82 | subcases.cpp(0): |
| 83 | TEST CASE: test case should fail even though the last subcase passes |
| 84 | one |
| 85 | |
| 86 | subcases.cpp(0): ERROR: CHECK( false ) is NOT correct! |
| 87 | values: CHECK( false ) |
| 88 | |
| 89 | =============================================================================== |
onqtam | b656d60 | 2019-03-18 18:33:00 +0200 | [diff] [blame] | 90 | subcases.cpp(0): |
| 91 | TEST CASE: fails from an exception but gets re-entered to traverse all subcases |
| 92 | level zero |
| 93 | one |
| 94 | |
| 95 | subcases.cpp(0): ERROR: CHECK( false ) is NOT correct! |
| 96 | values: CHECK( false ) |
| 97 | |
| 98 | =============================================================================== |
| 99 | subcases.cpp(0): |
| 100 | TEST CASE: fails from an exception but gets re-entered to traverse all subcases |
onqtam | 2e137ae | 2019-09-22 21:06:02 +0300 | [diff] [blame] | 101 | level zero |
| 102 | |
| 103 | subcases.cpp(0): ERROR: test case THREW exception: exception thrown in subcase - will translate later when the whole test case has been exited (cannot translate while there is an active exception) |
| 104 | |
| 105 | =============================================================================== |
| 106 | subcases.cpp(0): |
| 107 | TEST CASE: fails from an exception but gets re-entered to traverse all subcases |
onqtam | b656d60 | 2019-03-18 18:33:00 +0200 | [diff] [blame] | 108 | |
| 109 | subcases.cpp(0): ERROR: test case THREW exception: failure... but the show must go on! |
| 110 | |
| 111 | =============================================================================== |
| 112 | subcases.cpp(0): |
| 113 | TEST CASE: fails from an exception but gets re-entered to traverse all subcases |
| 114 | level zero |
| 115 | two |
| 116 | |
| 117 | subcases.cpp(0): ERROR: CHECK( false ) is NOT correct! |
| 118 | values: CHECK( false ) |
| 119 | |
| 120 | =============================================================================== |
| 121 | subcases.cpp(0): |
| 122 | TEST CASE: fails from an exception but gets re-entered to traverse all subcases |
onqtam | 2e137ae | 2019-09-22 21:06:02 +0300 | [diff] [blame] | 123 | level zero |
| 124 | |
| 125 | subcases.cpp(0): ERROR: test case THREW exception: exception thrown in subcase - will translate later when the whole test case has been exited (cannot translate while there is an active exception) |
| 126 | |
| 127 | =============================================================================== |
| 128 | subcases.cpp(0): |
| 129 | TEST CASE: fails from an exception but gets re-entered to traverse all subcases |
onqtam | b656d60 | 2019-03-18 18:33:00 +0200 | [diff] [blame] | 130 | |
| 131 | subcases.cpp(0): ERROR: test case THREW exception: failure... but the show must go on! |
| 132 | |
| 133 | =============================================================================== |
onqtam | 3375222 | 2020-02-24 18:35:42 +0200 | [diff] [blame^] | 134 | subcases.cpp(0): |
| 135 | TEST CASE: subcases with changing names |
| 136 | outer 0 |
| 137 | inner 0 |
| 138 | |
| 139 | subcases.cpp(0): MESSAGE: msg! |
| 140 | |
| 141 | =============================================================================== |
| 142 | subcases.cpp(0): |
| 143 | TEST CASE: subcases with changing names |
| 144 | outer 0 |
| 145 | inner 1 |
| 146 | |
| 147 | subcases.cpp(0): MESSAGE: msg! |
| 148 | |
| 149 | =============================================================================== |
| 150 | subcases.cpp(0): |
| 151 | TEST CASE: subcases with changing names |
| 152 | outer 1 |
| 153 | inner 0 |
| 154 | |
| 155 | subcases.cpp(0): MESSAGE: msg! |
| 156 | |
| 157 | =============================================================================== |
| 158 | subcases.cpp(0): |
| 159 | TEST CASE: subcases with changing names |
| 160 | outer 1 |
| 161 | inner 1 |
| 162 | |
| 163 | subcases.cpp(0): MESSAGE: msg! |
| 164 | |
| 165 | =============================================================================== |
| 166 | subcases.cpp(0): |
| 167 | TEST CASE: subcases with changing names |
| 168 | separate |
| 169 | |
| 170 | subcases.cpp(0): MESSAGE: separate msg! |
| 171 | |
| 172 | =============================================================================== |
| 173 | [doctest] test cases: 7 | 3 passed | 4 failed | |
onqtam | dca8b66 | 2019-09-22 17:34:50 +0300 | [diff] [blame] | 174 | [doctest] assertions: 25 | 19 passed | 6 failed | |
onqtam | 754f402 | 2017-05-06 20:07:49 +0300 | [diff] [blame] | 175 | [doctest] Status: FAILURE! |
onqtam | 2c100d6 | 2017-04-16 22:47:28 +0300 | [diff] [blame] | 176 | Program code. |