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 | |
Stefan | eb8b04a | 2022-04-25 11:01:11 +0200 | [diff] [blame] | 19 | |
| 20 | root |
| 21 | outside of subcase |
| 22 | inside subcase 0 |
| 23 | outside of subcase |
| 24 | inside subcase 1 |
| 25 | outside of subcase |
| 26 | inside subcase 2 |
| 27 | |
| 28 | root |
| 29 | outside of subcase |
| 30 | also inside 0 |
| 31 | outside of subcase |
| 32 | also inside 1 |
| 33 | outside of subcase |
| 34 | also inside 2 |
| 35 | |
| 36 | root |
| 37 | outside of subcase |
| 38 | fail inside 0 |
| 39 | outside of subcase |
| 40 | =============================================================================== |
| 41 | subcases.cpp(0): |
| 42 | TEST CASE: reentering subcase via regular control flow |
| 43 | |
| 44 | DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE): |
| 45 | |
| 46 | subcases.cpp(0): FATAL ERROR: 1 |
| 47 | |
| 48 | |
| 49 | root |
| 50 | outside of subcase |
| 51 | inside outside |
| 52 | nested twice 0, 0 |
| 53 | nested twice 0, 1 |
| 54 | nested twice 0, 2 |
| 55 | outside of subcase |
| 56 | inside outside |
| 57 | nested twice 1, 0 |
| 58 | nested twice 1, 1 |
| 59 | nested twice 1, 2 |
| 60 | outside of subcase |
| 61 | inside outside |
| 62 | nested twice 2, 0 |
| 63 | nested twice 2, 1 |
| 64 | nested twice 2, 2 |
| 65 | |
| 66 | root |
| 67 | outside of subcase |
| 68 | inside outside |
| 69 | also twice 0, 0 |
| 70 | also twice 0, 1 |
| 71 | also twice 0, 2 |
| 72 | outside of subcase |
| 73 | inside outside |
| 74 | also twice 1, 0 |
| 75 | also twice 1, 1 |
| 76 | also twice 1, 2 |
| 77 | outside of subcase |
| 78 | inside outside |
| 79 | also twice 2, 0 |
| 80 | also twice 2, 1 |
| 81 | also twice 2, 2 |
onqtam | 35c14cd | 2017-04-24 12:54:03 +0300 | [diff] [blame] | 82 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 83 | subcases.cpp(0): |
onqtam | 35c14cd | 2017-04-24 12:54:03 +0300 | [diff] [blame] | 84 | TEST CASE: subcases can be used in a separate function as well |
onqtam | 5dbcb1e | 2017-05-02 23:07:56 +0300 | [diff] [blame] | 85 | from function... |
| 86 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 87 | subcases.cpp(0): MESSAGE: print me twice |
onqtam | 5dbcb1e | 2017-05-02 23:07:56 +0300 | [diff] [blame] | 88 | |
| 89 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 90 | subcases.cpp(0): |
onqtam | 5dbcb1e | 2017-05-02 23:07:56 +0300 | [diff] [blame] | 91 | TEST CASE: subcases can be used in a separate function as well |
| 92 | from function... |
onqtam | 378d670 | 2017-04-19 11:30:03 +0300 | [diff] [blame] | 93 | sc1 |
| 94 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 95 | subcases.cpp(0): MESSAGE: hello! from sc1 |
onqtam | 378d670 | 2017-04-19 11:30:03 +0300 | [diff] [blame] | 96 | |
onqtam | 35c14cd | 2017-04-24 12:54:03 +0300 | [diff] [blame] | 97 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 98 | subcases.cpp(0): |
onqtam | 35c14cd | 2017-04-24 12:54:03 +0300 | [diff] [blame] | 99 | TEST CASE: subcases can be used in a separate function as well |
onqtam | a82c1e4 | 2017-05-07 17:36:41 +0300 | [diff] [blame] | 100 | |
onqtam | 72bf24e | 2020-05-17 20:19:54 +0300 | [diff] [blame] | 101 | DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE): |
| 102 | from function... |
| 103 | sc1 |
| 104 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 105 | subcases.cpp(0): MESSAGE: lala |
onqtam | a82c1e4 | 2017-05-07 17:36:41 +0300 | [diff] [blame] | 106 | |
| 107 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 108 | subcases.cpp(0): |
onqtam | a82c1e4 | 2017-05-07 17:36:41 +0300 | [diff] [blame] | 109 | TEST CASE: subcases can be used in a separate function as well |
onqtam | 5dbcb1e | 2017-05-02 23:07:56 +0300 | [diff] [blame] | 110 | from function... |
| 111 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 112 | subcases.cpp(0): MESSAGE: print me twice |
onqtam | 5dbcb1e | 2017-05-02 23:07:56 +0300 | [diff] [blame] | 113 | |
| 114 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 115 | subcases.cpp(0): |
onqtam | 5dbcb1e | 2017-05-02 23:07:56 +0300 | [diff] [blame] | 116 | TEST CASE: subcases can be used in a separate function as well |
| 117 | from function... |
onqtam | 378d670 | 2017-04-19 11:30:03 +0300 | [diff] [blame] | 118 | sc2 |
| 119 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 120 | subcases.cpp(0): MESSAGE: hello! from sc2 |
onqtam | 378d670 | 2017-04-19 11:30:03 +0300 | [diff] [blame] | 121 | |
onqtam | 35c14cd | 2017-04-24 12:54:03 +0300 | [diff] [blame] | 122 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 123 | subcases.cpp(0): |
onqtam | a82c1e4 | 2017-05-07 17:36:41 +0300 | [diff] [blame] | 124 | TEST CASE: subcases can be used in a separate function as well |
| 125 | |
onqtam | 72bf24e | 2020-05-17 20:19:54 +0300 | [diff] [blame] | 126 | DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE): |
| 127 | from function... |
| 128 | sc2 |
| 129 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 130 | subcases.cpp(0): MESSAGE: lala |
onqtam | a82c1e4 | 2017-05-07 17:36:41 +0300 | [diff] [blame] | 131 | |
| 132 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 133 | subcases.cpp(0): |
onqtam | 2c100d6 | 2017-04-16 22:47:28 +0300 | [diff] [blame] | 134 | Scenario: vectors can be sized and resized |
| 135 | Given: A vector with some items |
| 136 | When: the size is increased |
| 137 | Then: the size and capacity change |
| 138 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 139 | subcases.cpp(0): ERROR: CHECK( v.size() == 20 ) is NOT correct! |
| 140 | values: CHECK( 10 == 20 ) |
onqtam | 2c100d6 | 2017-04-16 22:47:28 +0300 | [diff] [blame] | 141 | |
onqtam | 35c14cd | 2017-04-24 12:54:03 +0300 | [diff] [blame] | 142 | =============================================================================== |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 143 | subcases.cpp(0): |
onqtam | 2c100d6 | 2017-04-16 22:47:28 +0300 | [diff] [blame] | 144 | Scenario: vectors can be sized and resized |
| 145 | Given: A vector with some items |
| 146 | When: less capacity is reserved |
| 147 | Then: neither size nor capacity are changed |
| 148 | |
onqtam | 1655b24 | 2018-05-10 15:29:21 +0300 | [diff] [blame] | 149 | subcases.cpp(0): ERROR: CHECK( v.size() == 10 ) is NOT correct! |
| 150 | values: CHECK( 5 == 10 ) |
onqtam | 2c100d6 | 2017-04-16 22:47:28 +0300 | [diff] [blame] | 151 | |
onqtam | 2c100d6 | 2017-04-16 22:47:28 +0300 | [diff] [blame] | 152 | =============================================================================== |
onqtam | dc01198 | 2018-10-24 16:57:10 +0300 | [diff] [blame] | 153 | subcases.cpp(0): |
| 154 | TEST CASE: test case should fail even though the last subcase passes |
| 155 | one |
| 156 | |
| 157 | subcases.cpp(0): ERROR: CHECK( false ) is NOT correct! |
| 158 | values: CHECK( false ) |
| 159 | |
| 160 | =============================================================================== |
onqtam | b656d60 | 2019-03-18 18:33:00 +0200 | [diff] [blame] | 161 | subcases.cpp(0): |
| 162 | TEST CASE: fails from an exception but gets re-entered to traverse all subcases |
| 163 | level zero |
| 164 | one |
| 165 | |
| 166 | subcases.cpp(0): ERROR: CHECK( false ) is NOT correct! |
| 167 | values: CHECK( false ) |
| 168 | |
| 169 | =============================================================================== |
| 170 | subcases.cpp(0): |
| 171 | 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] | 172 | level zero |
| 173 | |
onqtam | 72bf24e | 2020-05-17 20:19:54 +0300 | [diff] [blame] | 174 | DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE): |
| 175 | level zero |
| 176 | one |
| 177 | |
onqtam | 2e137ae | 2019-09-22 21:06:02 +0300 | [diff] [blame] | 178 | 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) |
| 179 | |
| 180 | =============================================================================== |
| 181 | subcases.cpp(0): |
| 182 | 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] | 183 | |
onqtam | 72bf24e | 2020-05-17 20:19:54 +0300 | [diff] [blame] | 184 | DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE): |
| 185 | level zero |
| 186 | one |
| 187 | |
onqtam | b656d60 | 2019-03-18 18:33:00 +0200 | [diff] [blame] | 188 | subcases.cpp(0): ERROR: test case THREW exception: failure... but the show must go on! |
| 189 | |
| 190 | =============================================================================== |
| 191 | subcases.cpp(0): |
| 192 | TEST CASE: fails from an exception but gets re-entered to traverse all subcases |
| 193 | level zero |
| 194 | two |
| 195 | |
| 196 | subcases.cpp(0): ERROR: CHECK( false ) is NOT correct! |
| 197 | values: CHECK( false ) |
| 198 | |
| 199 | =============================================================================== |
| 200 | subcases.cpp(0): |
| 201 | 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] | 202 | level zero |
| 203 | |
onqtam | 72bf24e | 2020-05-17 20:19:54 +0300 | [diff] [blame] | 204 | DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE): |
| 205 | level zero |
| 206 | two |
| 207 | |
onqtam | 2e137ae | 2019-09-22 21:06:02 +0300 | [diff] [blame] | 208 | 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) |
| 209 | |
| 210 | =============================================================================== |
| 211 | subcases.cpp(0): |
| 212 | 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] | 213 | |
onqtam | 72bf24e | 2020-05-17 20:19:54 +0300 | [diff] [blame] | 214 | DEEPEST SUBCASE STACK REACHED (DIFFERENT FROM THE CURRENT ONE): |
| 215 | level zero |
| 216 | two |
| 217 | |
onqtam | b656d60 | 2019-03-18 18:33:00 +0200 | [diff] [blame] | 218 | subcases.cpp(0): ERROR: test case THREW exception: failure... but the show must go on! |
| 219 | |
| 220 | =============================================================================== |
onqtam | 3375222 | 2020-02-24 18:35:42 +0200 | [diff] [blame] | 221 | subcases.cpp(0): |
| 222 | TEST CASE: subcases with changing names |
| 223 | outer 0 |
| 224 | inner 0 |
| 225 | |
| 226 | subcases.cpp(0): MESSAGE: msg! |
| 227 | |
| 228 | =============================================================================== |
| 229 | subcases.cpp(0): |
| 230 | TEST CASE: subcases with changing names |
| 231 | outer 0 |
| 232 | inner 1 |
| 233 | |
| 234 | subcases.cpp(0): MESSAGE: msg! |
| 235 | |
| 236 | =============================================================================== |
| 237 | subcases.cpp(0): |
| 238 | TEST CASE: subcases with changing names |
| 239 | outer 1 |
| 240 | inner 0 |
| 241 | |
| 242 | subcases.cpp(0): MESSAGE: msg! |
| 243 | |
| 244 | =============================================================================== |
| 245 | subcases.cpp(0): |
| 246 | TEST CASE: subcases with changing names |
| 247 | outer 1 |
| 248 | inner 1 |
| 249 | |
| 250 | subcases.cpp(0): MESSAGE: msg! |
| 251 | |
| 252 | =============================================================================== |
| 253 | subcases.cpp(0): |
| 254 | TEST CASE: subcases with changing names |
| 255 | separate |
| 256 | |
| 257 | subcases.cpp(0): MESSAGE: separate msg! |
| 258 | |
| 259 | =============================================================================== |
Egor Suvorov | bef1965 | 2022-03-05 15:36:58 +0300 | [diff] [blame] | 260 | subcases.cpp(0): |
| 261 | TEST SUITE: with a funny name, |
| 262 | TEST CASE: with a funnier name\: |
| 263 | with the funniest name\, |
| 264 | |
| 265 | subcases.cpp(0): MESSAGE: Yes! |
| 266 | |
| 267 | =============================================================================== |
| 268 | subcases.cpp(0): |
| 269 | TEST SUITE: with a funny name, |
| 270 | TEST CASE: with a funnier name\: |
| 271 | with a slightly funny name : |
| 272 | |
| 273 | subcases.cpp(0): MESSAGE: Yep! |
| 274 | |
| 275 | =============================================================================== |
| 276 | subcases.cpp(0): |
| 277 | TEST SUITE: with a funny name, |
| 278 | TEST CASE: with a funnier name\: |
| 279 | without a funny name |
| 280 | |
| 281 | subcases.cpp(0): MESSAGE: NO! |
| 282 | |
| 283 | =============================================================================== |
| 284 | subcases.cpp(0): |
| 285 | TEST SUITE: with a funny name, |
| 286 | TEST CASE: without a funny name: |
| 287 | |
| 288 | subcases.cpp(0): MESSAGE: Nooo |
| 289 | |
| 290 | =============================================================================== |
Stefan | eb8b04a | 2022-04-25 11:01:11 +0200 | [diff] [blame] | 291 | [doctest] test cases: 10 | 5 passed | 5 failed | |
| 292 | [doctest] assertions: 26 | 19 passed | 7 failed | |
onqtam | 754f402 | 2017-05-06 20:07:49 +0300 | [diff] [blame] | 293 | [doctest] Status: FAILURE! |
onqtam | 2c100d6 | 2017-04-16 22:47:28 +0300 | [diff] [blame] | 294 | Program code. |