Bram Moolenaar | 4334554 | 2015-11-29 17:35:35 +0100 | [diff] [blame] | 1 | " This script is sourced while editing the .vim file with the tests. |
| 2 | " When the script is successful the .res file will be created. |
| 3 | " Errors are appended to the test.log file. |
| 4 | " |
Bram Moolenaar | befb366 | 2016-02-20 14:41:40 +0100 | [diff] [blame] | 5 | " To execute only specific test functions, add a second argument. It will be |
| 6 | " matched against the names of the Test_ funtion. E.g.: |
| 7 | " ../vim -u NONE -S runtest.vim test_channel.vim open_delay |
| 8 | " The output can be found in the "messages" file. |
| 9 | " |
Bram Moolenaar | 4334554 | 2015-11-29 17:35:35 +0100 | [diff] [blame] | 10 | " The test script may contain anything, only functions that start with |
| 11 | " "Test_" are special. These will be invoked and should contain assert |
| 12 | " functions. See test_assert.vim for an example. |
| 13 | " |
| 14 | " It is possible to source other files that contain "Test_" functions. This |
| 15 | " can speed up testing, since Vim does not need to restart. But be careful |
| 16 | " that the tests do not interfere with each other. |
| 17 | " |
| 18 | " If an error cannot be detected properly with an assert function add the |
| 19 | " error to the v:errors list: |
| 20 | " call add(v:errors, 'test foo failed: Cannot find xyz') |
| 21 | " |
| 22 | " If preparation for each Test_ function is needed, define a SetUp function. |
| 23 | " It will be called before each Test_ function. |
| 24 | " |
| 25 | " If cleanup after each Test_ function is needed, define a TearDown function. |
| 26 | " It will be called after each Test_ function. |
Bram Moolenaar | 00af60b | 2016-02-13 14:06:14 +0100 | [diff] [blame] | 27 | " |
| 28 | " When debugging a test it can be useful to add messages to v:errors: |
| 29 | " call add(v:errors, "this happened") |
| 30 | |
Bram Moolenaar | 4334554 | 2015-11-29 17:35:35 +0100 | [diff] [blame] | 31 | |
| 32 | " Without the +eval feature we can't run these tests, bail out. |
Bram Moolenaar | 4686b32 | 2015-12-28 14:44:10 +0100 | [diff] [blame] | 33 | so small.vim |
Bram Moolenaar | 4334554 | 2015-11-29 17:35:35 +0100 | [diff] [blame] | 34 | |
| 35 | " Check that the screen size is at least 24 x 80 characters. |
| 36 | if &lines < 24 || &columns < 80 |
| 37 | let error = 'Screen size too small! Tests require at least 24 lines with 80 characters' |
| 38 | echoerr error |
| 39 | split test.log |
| 40 | $put =error |
| 41 | w |
| 42 | cquit |
| 43 | endif |
| 44 | |
Bram Moolenaar | 89b1042 | 2016-07-12 22:51:22 +0200 | [diff] [blame] | 45 | " Common with all tests on all systems. |
| 46 | source setup.vim |
| 47 | |
Bram Moolenaar | c066246 | 2015-12-30 15:49:05 +0100 | [diff] [blame] | 48 | " For consistency run all tests with 'nocompatible' set. |
| 49 | " This also enables use of line continuation. |
| 50 | set nocp viminfo+=nviminfo |
| 51 | |
Bram Moolenaar | eb992cb | 2017-03-09 18:20:16 +0100 | [diff] [blame] | 52 | " Use utf-8 or latin1 by default, instead of whatever the system default |
Bram Moolenaar | ac105ed | 2016-07-21 20:33:32 +0200 | [diff] [blame] | 53 | " happens to be. Individual tests can overrule this at the top of the file. |
| 54 | if has('multi_byte') |
| 55 | set encoding=utf-8 |
| 56 | else |
| 57 | set encoding=latin1 |
| 58 | endif |
| 59 | |
Bram Moolenaar | 7a07354 | 2017-02-01 23:17:36 +0100 | [diff] [blame] | 60 | " Avoid stopping at the "hit enter" prompt |
| 61 | set nomore |
| 62 | |
Bram Moolenaar | c066246 | 2015-12-30 15:49:05 +0100 | [diff] [blame] | 63 | " Output all messages in English. |
| 64 | lang mess C |
| 65 | |
Bram Moolenaar | f60b796 | 2016-01-16 22:47:23 +0100 | [diff] [blame] | 66 | " Always use forward slashes. |
| 67 | set shellslash |
| 68 | |
Bram Moolenaar | 28fb79d | 2016-01-09 22:28:33 +0100 | [diff] [blame] | 69 | let s:srcdir = expand('%:p:h:h') |
| 70 | |
Bram Moolenaar | 8e8df25 | 2016-05-25 21:23:21 +0200 | [diff] [blame] | 71 | " Prepare for calling test_garbagecollect_now(). |
Bram Moolenaar | ebf7dfa | 2016-04-14 12:46:51 +0200 | [diff] [blame] | 72 | let v:testing = 1 |
| 73 | |
Bram Moolenaar | 28fb79d | 2016-01-09 22:28:33 +0100 | [diff] [blame] | 74 | " Support function: get the alloc ID by name. |
| 75 | function GetAllocId(name) |
| 76 | exe 'split ' . s:srcdir . '/alloc.h' |
Bram Moolenaar | 065ee9a | 2016-01-15 20:53:38 +0100 | [diff] [blame] | 77 | let top = search('typedef enum') |
| 78 | if top == 0 |
| 79 | call add(v:errors, 'typedef not found in alloc.h') |
| 80 | endif |
Bram Moolenaar | 28fb79d | 2016-01-09 22:28:33 +0100 | [diff] [blame] | 81 | let lnum = search('aid_' . a:name . ',') |
| 82 | if lnum == 0 |
| 83 | call add(v:errors, 'Alloc ID ' . a:name . ' not defined') |
| 84 | endif |
| 85 | close |
Bram Moolenaar | 065ee9a | 2016-01-15 20:53:38 +0100 | [diff] [blame] | 86 | return lnum - top - 1 |
Bram Moolenaar | 28fb79d | 2016-01-09 22:28:33 +0100 | [diff] [blame] | 87 | endfunc |
| 88 | |
Bram Moolenaar | 4220555 | 2017-03-18 19:42:22 +0100 | [diff] [blame] | 89 | func RunTheTest(test) |
Bram Moolenaar | b5760a1 | 2016-03-03 13:10:44 +0100 | [diff] [blame] | 90 | echo 'Executing ' . a:test |
Bram Moolenaar | e5f2a07 | 2017-02-01 22:31:49 +0100 | [diff] [blame] | 91 | |
| 92 | " Avoid stopping at the "hit enter" prompt |
| 93 | set nomore |
| 94 | |
| 95 | " Avoid a three second wait when a message is about to be overwritten by the |
| 96 | " mode message. |
| 97 | set noshowmode |
| 98 | |
Bram Moolenaar | eb992cb | 2017-03-09 18:20:16 +0100 | [diff] [blame] | 99 | " Clear any overrides. |
| 100 | call test_override('ALL', 0) |
| 101 | |
Bram Moolenaar | cf1ba35 | 2017-10-27 00:55:04 +0200 | [diff] [blame] | 102 | " Some tests wipe out buffers. To be consistent, always wipe out all |
| 103 | " buffers. |
| 104 | %bwipe! |
| 105 | |
Bram Moolenaar | 209d387 | 2017-11-16 21:52:51 +0100 | [diff] [blame] | 106 | " The test may change the current directory. Save and restore the |
| 107 | " directory after executing the test. |
| 108 | let save_cwd = getcwd() |
| 109 | |
Bram Moolenaar | b5760a1 | 2016-03-03 13:10:44 +0100 | [diff] [blame] | 110 | if exists("*SetUp") |
Bram Moolenaar | cc28e2d | 2016-11-17 17:56:13 +0100 | [diff] [blame] | 111 | try |
| 112 | call SetUp() |
| 113 | catch |
| 114 | call add(v:errors, 'Caught exception in SetUp() before ' . a:test . ': ' . v:exception . ' @ ' . v:throwpoint) |
| 115 | endtry |
Bram Moolenaar | b5760a1 | 2016-03-03 13:10:44 +0100 | [diff] [blame] | 116 | endif |
| 117 | |
| 118 | call add(s:messages, 'Executing ' . a:test) |
| 119 | let s:done += 1 |
Bram Moolenaar | f204e05 | 2017-10-26 17:14:01 +0200 | [diff] [blame] | 120 | |
| 121 | if a:test =~ 'Test_nocatch_' |
| 122 | " Function handles errors itself. This avoids skipping commands after the |
| 123 | " error. |
Bram Moolenaar | b5760a1 | 2016-03-03 13:10:44 +0100 | [diff] [blame] | 124 | exe 'call ' . a:test |
Bram Moolenaar | f204e05 | 2017-10-26 17:14:01 +0200 | [diff] [blame] | 125 | else |
| 126 | try |
Bram Moolenaar | 8903676 | 2018-06-12 14:58:39 +0200 | [diff] [blame] | 127 | let s:test = a:test |
| 128 | au VimLeavePre * call EarlyExit(s:test) |
Bram Moolenaar | f204e05 | 2017-10-26 17:14:01 +0200 | [diff] [blame] | 129 | exe 'call ' . a:test |
Bram Moolenaar | 8903676 | 2018-06-12 14:58:39 +0200 | [diff] [blame] | 130 | au! VimLeavePre |
Bram Moolenaar | f204e05 | 2017-10-26 17:14:01 +0200 | [diff] [blame] | 131 | catch /^\cskipped/ |
| 132 | call add(s:messages, ' Skipped') |
| 133 | call add(s:skipped, 'SKIPPED ' . a:test . ': ' . substitute(v:exception, '^\S*\s\+', '', '')) |
| 134 | catch |
| 135 | call add(v:errors, 'Caught exception in ' . a:test . ': ' . v:exception . ' @ ' . v:throwpoint) |
| 136 | endtry |
| 137 | endif |
Bram Moolenaar | b5760a1 | 2016-03-03 13:10:44 +0100 | [diff] [blame] | 138 | |
| 139 | if exists("*TearDown") |
Bram Moolenaar | cc28e2d | 2016-11-17 17:56:13 +0100 | [diff] [blame] | 140 | try |
| 141 | call TearDown() |
| 142 | catch |
| 143 | call add(v:errors, 'Caught exception in TearDown() after ' . a:test . ': ' . v:exception . ' @ ' . v:throwpoint) |
| 144 | endtry |
Bram Moolenaar | b5760a1 | 2016-03-03 13:10:44 +0100 | [diff] [blame] | 145 | endif |
Bram Moolenaar | 7cba71d | 2016-08-02 23:04:49 +0200 | [diff] [blame] | 146 | |
Bram Moolenaar | cf1ba35 | 2017-10-27 00:55:04 +0200 | [diff] [blame] | 147 | " Clear any autocommands |
| 148 | au! |
| 149 | |
Bram Moolenaar | ce11de8 | 2017-10-26 22:00:00 +0200 | [diff] [blame] | 150 | " Close any extra tab pages and windows and make the current one not modified. |
| 151 | while tabpagenr('$') > 1 |
Bram Moolenaar | cf1ba35 | 2017-10-27 00:55:04 +0200 | [diff] [blame] | 152 | quit! |
Bram Moolenaar | ce11de8 | 2017-10-26 22:00:00 +0200 | [diff] [blame] | 153 | endwhile |
| 154 | |
Bram Moolenaar | 358308d | 2016-08-24 21:21:26 +0200 | [diff] [blame] | 155 | while 1 |
| 156 | let wincount = winnr('$') |
| 157 | if wincount == 1 |
| 158 | break |
| 159 | endif |
Bram Moolenaar | 7cba71d | 2016-08-02 23:04:49 +0200 | [diff] [blame] | 160 | bwipe! |
Bram Moolenaar | 358308d | 2016-08-24 21:21:26 +0200 | [diff] [blame] | 161 | if wincount == winnr('$') |
| 162 | " Did not manage to close a window. |
| 163 | only! |
| 164 | break |
| 165 | endif |
Bram Moolenaar | 7cba71d | 2016-08-02 23:04:49 +0200 | [diff] [blame] | 166 | endwhile |
Bram Moolenaar | 209d387 | 2017-11-16 21:52:51 +0100 | [diff] [blame] | 167 | |
| 168 | exe 'cd ' . save_cwd |
Bram Moolenaar | b5760a1 | 2016-03-03 13:10:44 +0100 | [diff] [blame] | 169 | endfunc |
Bram Moolenaar | 28fb79d | 2016-01-09 22:28:33 +0100 | [diff] [blame] | 170 | |
Bram Moolenaar | 4220555 | 2017-03-18 19:42:22 +0100 | [diff] [blame] | 171 | func AfterTheTest() |
| 172 | if len(v:errors) > 0 |
| 173 | let s:fail += 1 |
| 174 | call add(s:errors, 'Found errors in ' . s:test . ':') |
| 175 | call extend(s:errors, v:errors) |
| 176 | let v:errors = [] |
| 177 | endif |
| 178 | endfunc |
| 179 | |
Bram Moolenaar | 8903676 | 2018-06-12 14:58:39 +0200 | [diff] [blame] | 180 | func EarlyExit(test) |
| 181 | " It's OK for the test we use to test the quit detection. |
| 182 | if a:test != 'Test_zz_quit_detected()' |
| 183 | call add(v:errors, 'Test caused Vim to exit: ' . a:test) |
| 184 | endif |
| 185 | |
| 186 | call FinishTesting() |
| 187 | endfunc |
| 188 | |
Bram Moolenaar | 4220555 | 2017-03-18 19:42:22 +0100 | [diff] [blame] | 189 | " This function can be called by a test if it wants to abort testing. |
| 190 | func FinishTesting() |
| 191 | call AfterTheTest() |
| 192 | |
| 193 | " Don't write viminfo on exit. |
| 194 | set viminfo= |
| 195 | |
Bram Moolenaar | d1ee004 | 2017-07-29 20:39:53 +0200 | [diff] [blame] | 196 | " Clean up files created by setup.vim |
| 197 | call delete('XfakeHOME', 'rf') |
| 198 | |
Bram Moolenaar | 4220555 | 2017-03-18 19:42:22 +0100 | [diff] [blame] | 199 | if s:fail == 0 |
| 200 | " Success, create the .res file so that make knows it's done. |
| 201 | exe 'split ' . fnamemodify(g:testname, ':r') . '.res' |
| 202 | write |
| 203 | endif |
| 204 | |
| 205 | if len(s:errors) > 0 |
| 206 | " Append errors to test.log |
| 207 | split test.log |
| 208 | call append(line('$'), '') |
| 209 | call append(line('$'), 'From ' . g:testname . ':') |
| 210 | call append(line('$'), s:errors) |
| 211 | write |
| 212 | endif |
| 213 | |
Bram Moolenaar | 29f9ed2 | 2018-04-10 19:20:31 +0200 | [diff] [blame] | 214 | if s:done == 0 |
| 215 | let message = 'NO tests executed' |
| 216 | else |
| 217 | let message = 'Executed ' . s:done . (s:done > 1 ? ' tests' : ' test') |
| 218 | endif |
Bram Moolenaar | 4220555 | 2017-03-18 19:42:22 +0100 | [diff] [blame] | 219 | echo message |
| 220 | call add(s:messages, message) |
| 221 | if s:fail > 0 |
| 222 | let message = s:fail . ' FAILED:' |
| 223 | echo message |
| 224 | call add(s:messages, message) |
| 225 | call extend(s:messages, s:errors) |
| 226 | endif |
| 227 | |
| 228 | " Add SKIPPED messages |
| 229 | call extend(s:messages, s:skipped) |
| 230 | |
| 231 | " Append messages to the file "messages" |
| 232 | split messages |
| 233 | call append(line('$'), '') |
| 234 | call append(line('$'), 'From ' . g:testname . ':') |
| 235 | call append(line('$'), s:messages) |
| 236 | write |
| 237 | |
| 238 | qall! |
| 239 | endfunc |
| 240 | |
Bram Moolenaar | 4334554 | 2015-11-29 17:35:35 +0100 | [diff] [blame] | 241 | " Source the test script. First grab the file name, in case the script |
Bram Moolenaar | 00af60b | 2016-02-13 14:06:14 +0100 | [diff] [blame] | 242 | " navigates away. g:testname can be used by the tests. |
| 243 | let g:testname = expand('%') |
| 244 | let s:done = 0 |
| 245 | let s:fail = 0 |
| 246 | let s:errors = [] |
| 247 | let s:messages = [] |
Bram Moolenaar | dac1947 | 2016-09-03 22:35:40 +0200 | [diff] [blame] | 248 | let s:skipped = [] |
Bram Moolenaar | b544f3c | 2017-02-23 19:03:28 +0100 | [diff] [blame] | 249 | if expand('%') =~ 'test_vimscript.vim' |
Bram Moolenaar | 00af60b | 2016-02-13 14:06:14 +0100 | [diff] [blame] | 250 | " this test has intentional s:errors, don't use try/catch. |
Bram Moolenaar | 4686b32 | 2015-12-28 14:44:10 +0100 | [diff] [blame] | 251 | source % |
Bram Moolenaar | a2cce86 | 2016-01-02 19:50:04 +0100 | [diff] [blame] | 252 | else |
| 253 | try |
| 254 | source % |
| 255 | catch |
Bram Moolenaar | 00af60b | 2016-02-13 14:06:14 +0100 | [diff] [blame] | 256 | let s:fail += 1 |
| 257 | call add(s:errors, 'Caught exception: ' . v:exception . ' @ ' . v:throwpoint) |
Bram Moolenaar | a2cce86 | 2016-01-02 19:50:04 +0100 | [diff] [blame] | 258 | endtry |
| 259 | endif |
Bram Moolenaar | 4334554 | 2015-11-29 17:35:35 +0100 | [diff] [blame] | 260 | |
Bram Moolenaar | b5760a1 | 2016-03-03 13:10:44 +0100 | [diff] [blame] | 261 | " Names of flaky tests. |
Bram Moolenaar | e1c8c7a | 2016-09-11 16:48:50 +0200 | [diff] [blame] | 262 | let s:flaky = [ |
Bram Moolenaar | 4220555 | 2017-03-18 19:42:22 +0100 | [diff] [blame] | 263 | \ 'Test_client_server()', |
Bram Moolenaar | 6fe2eb4 | 2017-01-29 21:49:51 +0100 | [diff] [blame] | 264 | \ 'Test_close_and_exit_cb()', |
Bram Moolenaar | b245559 | 2017-02-01 18:00:13 +0100 | [diff] [blame] | 265 | \ 'Test_collapse_buffers()', |
| 266 | \ 'Test_communicate()', |
Bram Moolenaar | 6587384 | 2018-03-25 17:12:58 +0200 | [diff] [blame] | 267 | \ 'Test_cwd()', |
Bram Moolenaar | 0529b3e | 2017-03-16 22:30:37 +0100 | [diff] [blame] | 268 | \ 'Test_exit_callback_interval()', |
Bram Moolenaar | b245559 | 2017-02-01 18:00:13 +0100 | [diff] [blame] | 269 | \ 'Test_nb_basic()', |
Bram Moolenaar | d512e17 | 2017-02-27 21:35:53 +0100 | [diff] [blame] | 270 | \ 'Test_oneshot()', |
Bram Moolenaar | 1eca6f1 | 2017-12-05 14:04:27 +0100 | [diff] [blame] | 271 | \ 'Test_out_cb()', |
Bram Moolenaar | 2482069 | 2017-12-02 16:38:12 +0100 | [diff] [blame] | 272 | \ 'Test_paused()', |
Bram Moolenaar | c79d6aa | 2016-09-25 22:27:37 +0200 | [diff] [blame] | 273 | \ 'Test_pipe_through_sort_all()', |
Bram Moolenaar | 4e032e1 | 2017-02-01 20:48:13 +0100 | [diff] [blame] | 274 | \ 'Test_pipe_through_sort_some()', |
Bram Moolenaar | 142ae73 | 2018-08-19 17:04:01 +0200 | [diff] [blame] | 275 | \ 'Test_popup_and_window_resize()', |
Bram Moolenaar | 0fbff64 | 2017-03-05 14:30:52 +0100 | [diff] [blame] | 276 | \ 'Test_quoteplus()', |
Bram Moolenaar | 7dd4850 | 2017-03-19 20:04:22 +0100 | [diff] [blame] | 277 | \ 'Test_quotestar()', |
Bram Moolenaar | b245559 | 2017-02-01 18:00:13 +0100 | [diff] [blame] | 278 | \ 'Test_reltime()', |
Bram Moolenaar | bfbea56 | 2018-02-12 21:31:35 +0100 | [diff] [blame] | 279 | \ 'Test_repeat_three()', |
Bram Moolenaar | f204e05 | 2017-10-26 17:14:01 +0200 | [diff] [blame] | 280 | \ 'Test_terminal_composing_unicode()', |
Bram Moolenaar | 75a60f7 | 2017-09-07 22:24:41 +0200 | [diff] [blame] | 281 | \ 'Test_terminal_noblock()', |
Bram Moolenaar | 7dd88c5 | 2017-11-04 20:46:40 +0100 | [diff] [blame] | 282 | \ 'Test_terminal_redir_file()', |
Bram Moolenaar | 2482069 | 2017-12-02 16:38:12 +0100 | [diff] [blame] | 283 | \ 'Test_terminal_tmap()', |
Bram Moolenaar | d09be32 | 2017-07-30 21:37:58 +0200 | [diff] [blame] | 284 | \ 'Test_with_partial_callback()', |
Bram Moolenaar | e1c8c7a | 2016-09-11 16:48:50 +0200 | [diff] [blame] | 285 | \ ] |
Bram Moolenaar | b5760a1 | 2016-03-03 13:10:44 +0100 | [diff] [blame] | 286 | |
Bram Moolenaar | 4334554 | 2015-11-29 17:35:35 +0100 | [diff] [blame] | 287 | " Locate Test_ functions and execute them. |
| 288 | redir @q |
Bram Moolenaar | 93bf558 | 2016-02-18 22:25:47 +0100 | [diff] [blame] | 289 | silent function /^Test_ |
Bram Moolenaar | 4334554 | 2015-11-29 17:35:35 +0100 | [diff] [blame] | 290 | redir END |
Bram Moolenaar | 00af60b | 2016-02-13 14:06:14 +0100 | [diff] [blame] | 291 | let s:tests = split(substitute(@q, 'function \(\k*()\)', '\1', 'g')) |
Bram Moolenaar | 4334554 | 2015-11-29 17:35:35 +0100 | [diff] [blame] | 292 | |
Bram Moolenaar | befb366 | 2016-02-20 14:41:40 +0100 | [diff] [blame] | 293 | " If there is an extra argument filter the function names against it. |
| 294 | if argc() > 1 |
| 295 | let s:tests = filter(s:tests, 'v:val =~ argv(1)') |
| 296 | endif |
| 297 | |
Bram Moolenaar | cfc0a35 | 2016-01-09 20:23:00 +0100 | [diff] [blame] | 298 | " Execute the tests in alphabetical order. |
Bram Moolenaar | 93bf558 | 2016-02-18 22:25:47 +0100 | [diff] [blame] | 299 | for s:test in sort(s:tests) |
Bram Moolenaar | 4a6fcf8 | 2017-10-12 21:29:22 +0200 | [diff] [blame] | 300 | " Silence, please! |
| 301 | set belloff=all |
| 302 | |
Bram Moolenaar | b5760a1 | 2016-03-03 13:10:44 +0100 | [diff] [blame] | 303 | call RunTheTest(s:test) |
Bram Moolenaar | 4334554 | 2015-11-29 17:35:35 +0100 | [diff] [blame] | 304 | |
Bram Moolenaar | b5760a1 | 2016-03-03 13:10:44 +0100 | [diff] [blame] | 305 | if len(v:errors) > 0 && index(s:flaky, s:test) >= 0 |
Bram Moolenaar | 6caf606 | 2017-03-18 20:45:05 +0100 | [diff] [blame] | 306 | call add(s:messages, 'Found errors in ' . s:test . ':') |
| 307 | call extend(s:messages, v:errors) |
Bram Moolenaar | b5760a1 | 2016-03-03 13:10:44 +0100 | [diff] [blame] | 308 | call add(s:messages, 'Flaky test failed, running it again') |
Bram Moolenaar | 15e737f | 2017-03-18 21:22:47 +0100 | [diff] [blame] | 309 | let first_run = v:errors |
| 310 | |
Bram Moolenaar | 5505860 | 2017-11-21 15:14:51 +0100 | [diff] [blame] | 311 | " Flakiness is often caused by the system being very busy. Sleep a couple |
| 312 | " of seconds to have a higher chance of succeeding the second time. |
| 313 | sleep 2 |
| 314 | |
Bram Moolenaar | b5760a1 | 2016-03-03 13:10:44 +0100 | [diff] [blame] | 315 | let v:errors = [] |
| 316 | call RunTheTest(s:test) |
Bram Moolenaar | 15e737f | 2017-03-18 21:22:47 +0100 | [diff] [blame] | 317 | if len(v:errors) > 0 |
| 318 | let second_run = v:errors |
| 319 | let v:errors = ['First run:'] |
| 320 | call extend(v:errors, first_run) |
| 321 | call add(v:errors, 'Second run:') |
| 322 | call extend(v:errors, second_run) |
| 323 | endif |
Bram Moolenaar | b5760a1 | 2016-03-03 13:10:44 +0100 | [diff] [blame] | 324 | endif |
Bram Moolenaar | 4334554 | 2015-11-29 17:35:35 +0100 | [diff] [blame] | 325 | |
Bram Moolenaar | 4220555 | 2017-03-18 19:42:22 +0100 | [diff] [blame] | 326 | call AfterTheTest() |
Bram Moolenaar | 4334554 | 2015-11-29 17:35:35 +0100 | [diff] [blame] | 327 | endfor |
| 328 | |
Bram Moolenaar | 4220555 | 2017-03-18 19:42:22 +0100 | [diff] [blame] | 329 | call FinishTesting() |
Bram Moolenaar | cc28e2d | 2016-11-17 17:56:13 +0100 | [diff] [blame] | 330 | |
| 331 | " vim: shiftwidth=2 sts=2 expandtab |