Mercurial > vim
annotate src/testdir/runtest.vim @ 11105:7c7e496e625d v8.0.0440
patch 8.0.0440: not enough test coverage in Insert mode
commit https://github.com/vim/vim/commit/eb992cb90fd79c77ad2743459ac898e6ac3de939
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Mar 9 18:20:16 2017 +0100
patch 8.0.0440: not enough test coverage in Insert mode
Problem: Not enough test coverage in Insert mode.
Solution: Add lots of tests. Add test_override(). (Christian Brabandt,
closes #1521)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 09 Mar 2017 18:30:07 +0100 |
parents | 679c12064dbc |
children | f4971739ea47 |
rev | line source |
---|---|
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
1 " This script is sourced while editing the .vim file with the tests. |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
2 " When the script is successful the .res file will be created. |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
3 " Errors are appended to the test.log file. |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
4 " |
8142
71aabce3142e
commit https://github.com/vim/vim/commit/befb366affa6309c6b4a469ec7f729821e3a36fa
Christian Brabandt <cb@256bit.org>
parents:
8116
diff
changeset
|
5 " To execute only specific test functions, add a second argument. It will be |
71aabce3142e
commit https://github.com/vim/vim/commit/befb366affa6309c6b4a469ec7f729821e3a36fa
Christian Brabandt <cb@256bit.org>
parents:
8116
diff
changeset
|
6 " matched against the names of the Test_ funtion. E.g.: |
71aabce3142e
commit https://github.com/vim/vim/commit/befb366affa6309c6b4a469ec7f729821e3a36fa
Christian Brabandt <cb@256bit.org>
parents:
8116
diff
changeset
|
7 " ../vim -u NONE -S runtest.vim test_channel.vim open_delay |
71aabce3142e
commit https://github.com/vim/vim/commit/befb366affa6309c6b4a469ec7f729821e3a36fa
Christian Brabandt <cb@256bit.org>
parents:
8116
diff
changeset
|
8 " The output can be found in the "messages" file. |
71aabce3142e
commit https://github.com/vim/vim/commit/befb366affa6309c6b4a469ec7f729821e3a36fa
Christian Brabandt <cb@256bit.org>
parents:
8116
diff
changeset
|
9 " |
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
10 " The test script may contain anything, only functions that start with |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
11 " "Test_" are special. These will be invoked and should contain assert |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
12 " functions. See test_assert.vim for an example. |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
13 " |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
14 " It is possible to source other files that contain "Test_" functions. This |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
15 " can speed up testing, since Vim does not need to restart. But be careful |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
16 " that the tests do not interfere with each other. |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
17 " |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
18 " If an error cannot be detected properly with an assert function add the |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
19 " error to the v:errors list: |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
20 " call add(v:errors, 'test foo failed: Cannot find xyz') |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
21 " |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
22 " If preparation for each Test_ function is needed, define a SetUp function. |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
23 " It will be called before each Test_ function. |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
24 " |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
25 " If cleanup after each Test_ function is needed, define a TearDown function. |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
26 " It will be called after each Test_ function. |
8029
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
27 " |
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
28 " When debugging a test it can be useful to add messages to v:errors: |
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
29 " call add(v:errors, "this happened") |
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
30 |
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
31 |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
32 " Without the +eval feature we can't run these tests, bail out. |
7352
ddab7ae8796d
commit https://github.com/vim/vim/commit/4686b323e4bc0f466500b018959f6c8965f010f9
Christian Brabandt <cb@256bit.org>
parents:
7295
diff
changeset
|
33 so small.vim |
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
34 |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
35 " Check that the screen size is at least 24 x 80 characters. |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
36 if &lines < 24 || &columns < 80 |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
37 let error = 'Screen size too small! Tests require at least 24 lines with 80 characters' |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
38 echoerr error |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
39 split test.log |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
40 $put =error |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
41 w |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
42 cquit |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
43 endif |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
44 |
9501
f0201deac2a2
commit https://github.com/vim/vim/commit/89b10421ca1aea55acbafac1df93be4e20210ceb
Christian Brabandt <cb@256bit.org>
parents:
9452
diff
changeset
|
45 " Common with all tests on all systems. |
f0201deac2a2
commit https://github.com/vim/vim/commit/89b10421ca1aea55acbafac1df93be4e20210ceb
Christian Brabandt <cb@256bit.org>
parents:
9452
diff
changeset
|
46 source setup.vim |
f0201deac2a2
commit https://github.com/vim/vim/commit/89b10421ca1aea55acbafac1df93be4e20210ceb
Christian Brabandt <cb@256bit.org>
parents:
9452
diff
changeset
|
47 |
7391
4761fed349ed
commit https://github.com/vim/vim/commit/c06624661a3aa6642304c06db9cebe553a4cab17
Christian Brabandt <cb@256bit.org>
parents:
7372
diff
changeset
|
48 " For consistency run all tests with 'nocompatible' set. |
4761fed349ed
commit https://github.com/vim/vim/commit/c06624661a3aa6642304c06db9cebe553a4cab17
Christian Brabandt <cb@256bit.org>
parents:
7372
diff
changeset
|
49 " This also enables use of line continuation. |
4761fed349ed
commit https://github.com/vim/vim/commit/c06624661a3aa6642304c06db9cebe553a4cab17
Christian Brabandt <cb@256bit.org>
parents:
7372
diff
changeset
|
50 set nocp viminfo+=nviminfo |
4761fed349ed
commit https://github.com/vim/vim/commit/c06624661a3aa6642304c06db9cebe553a4cab17
Christian Brabandt <cb@256bit.org>
parents:
7372
diff
changeset
|
51 |
11105
7c7e496e625d
patch 8.0.0440: not enough test coverage in Insert mode
Christian Brabandt <cb@256bit.org>
parents:
11056
diff
changeset
|
52 " Use utf-8 or latin1 by default, instead of whatever the system default |
9618
81ba6e4eb72b
commit https://github.com/vim/vim/commit/ac105ed3c420660ddbddc501c97875c48220817e
Christian Brabandt <cb@256bit.org>
parents:
9501
diff
changeset
|
53 " happens to be. Individual tests can overrule this at the top of the file. |
81ba6e4eb72b
commit https://github.com/vim/vim/commit/ac105ed3c420660ddbddc501c97875c48220817e
Christian Brabandt <cb@256bit.org>
parents:
9501
diff
changeset
|
54 if has('multi_byte') |
81ba6e4eb72b
commit https://github.com/vim/vim/commit/ac105ed3c420660ddbddc501c97875c48220817e
Christian Brabandt <cb@256bit.org>
parents:
9501
diff
changeset
|
55 set encoding=utf-8 |
81ba6e4eb72b
commit https://github.com/vim/vim/commit/ac105ed3c420660ddbddc501c97875c48220817e
Christian Brabandt <cb@256bit.org>
parents:
9501
diff
changeset
|
56 else |
81ba6e4eb72b
commit https://github.com/vim/vim/commit/ac105ed3c420660ddbddc501c97875c48220817e
Christian Brabandt <cb@256bit.org>
parents:
9501
diff
changeset
|
57 set encoding=latin1 |
81ba6e4eb72b
commit https://github.com/vim/vim/commit/ac105ed3c420660ddbddc501c97875c48220817e
Christian Brabandt <cb@256bit.org>
parents:
9501
diff
changeset
|
58 endif |
81ba6e4eb72b
commit https://github.com/vim/vim/commit/ac105ed3c420660ddbddc501c97875c48220817e
Christian Brabandt <cb@256bit.org>
parents:
9501
diff
changeset
|
59 |
10811
4cb74eab1733
patch 8.0.0295: test_viml hangs
Christian Brabandt <cb@256bit.org>
parents:
10807
diff
changeset
|
60 " Avoid stopping at the "hit enter" prompt |
4cb74eab1733
patch 8.0.0295: test_viml hangs
Christian Brabandt <cb@256bit.org>
parents:
10807
diff
changeset
|
61 set nomore |
4cb74eab1733
patch 8.0.0295: test_viml hangs
Christian Brabandt <cb@256bit.org>
parents:
10807
diff
changeset
|
62 |
7391
4761fed349ed
commit https://github.com/vim/vim/commit/c06624661a3aa6642304c06db9cebe553a4cab17
Christian Brabandt <cb@256bit.org>
parents:
7372
diff
changeset
|
63 " Output all messages in English. |
4761fed349ed
commit https://github.com/vim/vim/commit/c06624661a3aa6642304c06db9cebe553a4cab17
Christian Brabandt <cb@256bit.org>
parents:
7372
diff
changeset
|
64 lang mess C |
4761fed349ed
commit https://github.com/vim/vim/commit/c06624661a3aa6642304c06db9cebe553a4cab17
Christian Brabandt <cb@256bit.org>
parents:
7372
diff
changeset
|
65 |
7623
2720952e9acb
commit https://github.com/vim/vim/commit/f60b796fa9870bdfc4cdeb91653bac041916077d
Christian Brabandt <cb@256bit.org>
parents:
7595
diff
changeset
|
66 " Always use forward slashes. |
2720952e9acb
commit https://github.com/vim/vim/commit/f60b796fa9870bdfc4cdeb91653bac041916077d
Christian Brabandt <cb@256bit.org>
parents:
7595
diff
changeset
|
67 set shellslash |
2720952e9acb
commit https://github.com/vim/vim/commit/f60b796fa9870bdfc4cdeb91653bac041916077d
Christian Brabandt <cb@256bit.org>
parents:
7595
diff
changeset
|
68 |
7545
4c922651fd78
commit https://github.com/vim/vim/commit/28fb79db6b52d1154e8dc63d227673648c2fce15
Christian Brabandt <cb@256bit.org>
parents:
7540
diff
changeset
|
69 let s:srcdir = expand('%:p:h:h') |
4c922651fd78
commit https://github.com/vim/vim/commit/28fb79db6b52d1154e8dc63d227673648c2fce15
Christian Brabandt <cb@256bit.org>
parents:
7540
diff
changeset
|
70 |
9121
7350959e53c3
commit https://github.com/vim/vim/commit/8e8df251bf2505e5decf258397c6069fbe5e2e01
Christian Brabandt <cb@256bit.org>
parents:
8881
diff
changeset
|
71 " Prepare for calling test_garbagecollect_now(). |
8881
ed0b39dd7fd6
commit https://github.com/vim/vim/commit/ebf7dfa6f121c82f97d2adca3d45fbaba9ad8f7e
Christian Brabandt <cb@256bit.org>
parents:
8796
diff
changeset
|
72 let v:testing = 1 |
ed0b39dd7fd6
commit https://github.com/vim/vim/commit/ebf7dfa6f121c82f97d2adca3d45fbaba9ad8f7e
Christian Brabandt <cb@256bit.org>
parents:
8796
diff
changeset
|
73 |
7545
4c922651fd78
commit https://github.com/vim/vim/commit/28fb79db6b52d1154e8dc63d227673648c2fce15
Christian Brabandt <cb@256bit.org>
parents:
7540
diff
changeset
|
74 " Support function: get the alloc ID by name. |
4c922651fd78
commit https://github.com/vim/vim/commit/28fb79db6b52d1154e8dc63d227673648c2fce15
Christian Brabandt <cb@256bit.org>
parents:
7540
diff
changeset
|
75 function GetAllocId(name) |
4c922651fd78
commit https://github.com/vim/vim/commit/28fb79db6b52d1154e8dc63d227673648c2fce15
Christian Brabandt <cb@256bit.org>
parents:
7540
diff
changeset
|
76 exe 'split ' . s:srcdir . '/alloc.h' |
7595
99e93f72ff91
commit https://github.com/vim/vim/commit/065ee9aebf9abe08ae8c0dba7d05cbdcc423c8e0
Christian Brabandt <cb@256bit.org>
parents:
7545
diff
changeset
|
77 let top = search('typedef enum') |
99e93f72ff91
commit https://github.com/vim/vim/commit/065ee9aebf9abe08ae8c0dba7d05cbdcc423c8e0
Christian Brabandt <cb@256bit.org>
parents:
7545
diff
changeset
|
78 if top == 0 |
99e93f72ff91
commit https://github.com/vim/vim/commit/065ee9aebf9abe08ae8c0dba7d05cbdcc423c8e0
Christian Brabandt <cb@256bit.org>
parents:
7545
diff
changeset
|
79 call add(v:errors, 'typedef not found in alloc.h') |
99e93f72ff91
commit https://github.com/vim/vim/commit/065ee9aebf9abe08ae8c0dba7d05cbdcc423c8e0
Christian Brabandt <cb@256bit.org>
parents:
7545
diff
changeset
|
80 endif |
7545
4c922651fd78
commit https://github.com/vim/vim/commit/28fb79db6b52d1154e8dc63d227673648c2fce15
Christian Brabandt <cb@256bit.org>
parents:
7540
diff
changeset
|
81 let lnum = search('aid_' . a:name . ',') |
4c922651fd78
commit https://github.com/vim/vim/commit/28fb79db6b52d1154e8dc63d227673648c2fce15
Christian Brabandt <cb@256bit.org>
parents:
7540
diff
changeset
|
82 if lnum == 0 |
4c922651fd78
commit https://github.com/vim/vim/commit/28fb79db6b52d1154e8dc63d227673648c2fce15
Christian Brabandt <cb@256bit.org>
parents:
7540
diff
changeset
|
83 call add(v:errors, 'Alloc ID ' . a:name . ' not defined') |
4c922651fd78
commit https://github.com/vim/vim/commit/28fb79db6b52d1154e8dc63d227673648c2fce15
Christian Brabandt <cb@256bit.org>
parents:
7540
diff
changeset
|
84 endif |
4c922651fd78
commit https://github.com/vim/vim/commit/28fb79db6b52d1154e8dc63d227673648c2fce15
Christian Brabandt <cb@256bit.org>
parents:
7540
diff
changeset
|
85 close |
7595
99e93f72ff91
commit https://github.com/vim/vim/commit/065ee9aebf9abe08ae8c0dba7d05cbdcc423c8e0
Christian Brabandt <cb@256bit.org>
parents:
7545
diff
changeset
|
86 return lnum - top - 1 |
7545
4c922651fd78
commit https://github.com/vim/vim/commit/28fb79db6b52d1154e8dc63d227673648c2fce15
Christian Brabandt <cb@256bit.org>
parents:
7540
diff
changeset
|
87 endfunc |
4c922651fd78
commit https://github.com/vim/vim/commit/28fb79db6b52d1154e8dc63d227673648c2fce15
Christian Brabandt <cb@256bit.org>
parents:
7540
diff
changeset
|
88 |
8370
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
89 function RunTheTest(test) |
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
90 echo 'Executing ' . a:test |
10807
82c43bca568e
patch 8.0.0293: some tests have a one or three second wait
Christian Brabandt <cb@256bit.org>
parents:
10797
diff
changeset
|
91 |
82c43bca568e
patch 8.0.0293: some tests have a one or three second wait
Christian Brabandt <cb@256bit.org>
parents:
10797
diff
changeset
|
92 " Avoid stopping at the "hit enter" prompt |
82c43bca568e
patch 8.0.0293: some tests have a one or three second wait
Christian Brabandt <cb@256bit.org>
parents:
10797
diff
changeset
|
93 set nomore |
82c43bca568e
patch 8.0.0293: some tests have a one or three second wait
Christian Brabandt <cb@256bit.org>
parents:
10797
diff
changeset
|
94 |
82c43bca568e
patch 8.0.0293: some tests have a one or three second wait
Christian Brabandt <cb@256bit.org>
parents:
10797
diff
changeset
|
95 " Avoid a three second wait when a message is about to be overwritten by the |
82c43bca568e
patch 8.0.0293: some tests have a one or three second wait
Christian Brabandt <cb@256bit.org>
parents:
10797
diff
changeset
|
96 " mode message. |
82c43bca568e
patch 8.0.0293: some tests have a one or three second wait
Christian Brabandt <cb@256bit.org>
parents:
10797
diff
changeset
|
97 set noshowmode |
82c43bca568e
patch 8.0.0293: some tests have a one or three second wait
Christian Brabandt <cb@256bit.org>
parents:
10797
diff
changeset
|
98 |
11105
7c7e496e625d
patch 8.0.0440: not enough test coverage in Insert mode
Christian Brabandt <cb@256bit.org>
parents:
11056
diff
changeset
|
99 " Clear any overrides. |
7c7e496e625d
patch 8.0.0440: not enough test coverage in Insert mode
Christian Brabandt <cb@256bit.org>
parents:
11056
diff
changeset
|
100 call test_override('ALL', 0) |
7c7e496e625d
patch 8.0.0440: not enough test coverage in Insert mode
Christian Brabandt <cb@256bit.org>
parents:
11056
diff
changeset
|
101 |
8370
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
102 if exists("*SetUp") |
10388
6cdb0226d74a
commit https://github.com/vim/vim/commit/cc28e2d05d05552d8b72a520be8a193f3d9822d4
Christian Brabandt <cb@256bit.org>
parents:
10229
diff
changeset
|
103 try |
6cdb0226d74a
commit https://github.com/vim/vim/commit/cc28e2d05d05552d8b72a520be8a193f3d9822d4
Christian Brabandt <cb@256bit.org>
parents:
10229
diff
changeset
|
104 call SetUp() |
6cdb0226d74a
commit https://github.com/vim/vim/commit/cc28e2d05d05552d8b72a520be8a193f3d9822d4
Christian Brabandt <cb@256bit.org>
parents:
10229
diff
changeset
|
105 catch |
6cdb0226d74a
commit https://github.com/vim/vim/commit/cc28e2d05d05552d8b72a520be8a193f3d9822d4
Christian Brabandt <cb@256bit.org>
parents:
10229
diff
changeset
|
106 call add(v:errors, 'Caught exception in SetUp() before ' . a:test . ': ' . v:exception . ' @ ' . v:throwpoint) |
6cdb0226d74a
commit https://github.com/vim/vim/commit/cc28e2d05d05552d8b72a520be8a193f3d9822d4
Christian Brabandt <cb@256bit.org>
parents:
10229
diff
changeset
|
107 endtry |
8370
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
108 endif |
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
109 |
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
110 call add(s:messages, 'Executing ' . a:test) |
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
111 let s:done += 1 |
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
112 try |
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
113 exe 'call ' . a:test |
10100
26441931dad7
commit https://github.com/vim/vim/commit/dac1947bb366ef43cd6da95acc730554e76d8b84
Christian Brabandt <cb@256bit.org>
parents:
9949
diff
changeset
|
114 catch /^\cskipped/ |
26441931dad7
commit https://github.com/vim/vim/commit/dac1947bb366ef43cd6da95acc730554e76d8b84
Christian Brabandt <cb@256bit.org>
parents:
9949
diff
changeset
|
115 call add(s:messages, ' Skipped') |
26441931dad7
commit https://github.com/vim/vim/commit/dac1947bb366ef43cd6da95acc730554e76d8b84
Christian Brabandt <cb@256bit.org>
parents:
9949
diff
changeset
|
116 call add(s:skipped, 'SKIPPED ' . a:test . ': ' . substitute(v:exception, '^\S*\s\+', '', '')) |
8370
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
117 catch |
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
118 call add(v:errors, 'Caught exception in ' . a:test . ': ' . v:exception . ' @ ' . v:throwpoint) |
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
119 endtry |
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
120 |
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
121 if exists("*TearDown") |
10388
6cdb0226d74a
commit https://github.com/vim/vim/commit/cc28e2d05d05552d8b72a520be8a193f3d9822d4
Christian Brabandt <cb@256bit.org>
parents:
10229
diff
changeset
|
122 try |
6cdb0226d74a
commit https://github.com/vim/vim/commit/cc28e2d05d05552d8b72a520be8a193f3d9822d4
Christian Brabandt <cb@256bit.org>
parents:
10229
diff
changeset
|
123 call TearDown() |
6cdb0226d74a
commit https://github.com/vim/vim/commit/cc28e2d05d05552d8b72a520be8a193f3d9822d4
Christian Brabandt <cb@256bit.org>
parents:
10229
diff
changeset
|
124 catch |
6cdb0226d74a
commit https://github.com/vim/vim/commit/cc28e2d05d05552d8b72a520be8a193f3d9822d4
Christian Brabandt <cb@256bit.org>
parents:
10229
diff
changeset
|
125 call add(v:errors, 'Caught exception in TearDown() after ' . a:test . ': ' . v:exception . ' @ ' . v:throwpoint) |
6cdb0226d74a
commit https://github.com/vim/vim/commit/cc28e2d05d05552d8b72a520be8a193f3d9822d4
Christian Brabandt <cb@256bit.org>
parents:
10229
diff
changeset
|
126 endtry |
8370
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
127 endif |
9748
5440f3442841
commit https://github.com/vim/vim/commit/7cba71d7e3576639679b6a3aedeeb1ac07f7f2f5
Christian Brabandt <cb@256bit.org>
parents:
9632
diff
changeset
|
128 |
5440f3442841
commit https://github.com/vim/vim/commit/7cba71d7e3576639679b6a3aedeeb1ac07f7f2f5
Christian Brabandt <cb@256bit.org>
parents:
9632
diff
changeset
|
129 " Close any extra windows and make the current one not modified. |
9949
30be4b26a37e
commit https://github.com/vim/vim/commit/358308dd99abdd56c6540339e505585d8db7bdfe
Christian Brabandt <cb@256bit.org>
parents:
9758
diff
changeset
|
130 while 1 |
30be4b26a37e
commit https://github.com/vim/vim/commit/358308dd99abdd56c6540339e505585d8db7bdfe
Christian Brabandt <cb@256bit.org>
parents:
9758
diff
changeset
|
131 let wincount = winnr('$') |
30be4b26a37e
commit https://github.com/vim/vim/commit/358308dd99abdd56c6540339e505585d8db7bdfe
Christian Brabandt <cb@256bit.org>
parents:
9758
diff
changeset
|
132 if wincount == 1 |
30be4b26a37e
commit https://github.com/vim/vim/commit/358308dd99abdd56c6540339e505585d8db7bdfe
Christian Brabandt <cb@256bit.org>
parents:
9758
diff
changeset
|
133 break |
30be4b26a37e
commit https://github.com/vim/vim/commit/358308dd99abdd56c6540339e505585d8db7bdfe
Christian Brabandt <cb@256bit.org>
parents:
9758
diff
changeset
|
134 endif |
9748
5440f3442841
commit https://github.com/vim/vim/commit/7cba71d7e3576639679b6a3aedeeb1ac07f7f2f5
Christian Brabandt <cb@256bit.org>
parents:
9632
diff
changeset
|
135 bwipe! |
9949
30be4b26a37e
commit https://github.com/vim/vim/commit/358308dd99abdd56c6540339e505585d8db7bdfe
Christian Brabandt <cb@256bit.org>
parents:
9758
diff
changeset
|
136 if wincount == winnr('$') |
30be4b26a37e
commit https://github.com/vim/vim/commit/358308dd99abdd56c6540339e505585d8db7bdfe
Christian Brabandt <cb@256bit.org>
parents:
9758
diff
changeset
|
137 " Did not manage to close a window. |
30be4b26a37e
commit https://github.com/vim/vim/commit/358308dd99abdd56c6540339e505585d8db7bdfe
Christian Brabandt <cb@256bit.org>
parents:
9758
diff
changeset
|
138 only! |
30be4b26a37e
commit https://github.com/vim/vim/commit/358308dd99abdd56c6540339e505585d8db7bdfe
Christian Brabandt <cb@256bit.org>
parents:
9758
diff
changeset
|
139 break |
30be4b26a37e
commit https://github.com/vim/vim/commit/358308dd99abdd56c6540339e505585d8db7bdfe
Christian Brabandt <cb@256bit.org>
parents:
9758
diff
changeset
|
140 endif |
9748
5440f3442841
commit https://github.com/vim/vim/commit/7cba71d7e3576639679b6a3aedeeb1ac07f7f2f5
Christian Brabandt <cb@256bit.org>
parents:
9632
diff
changeset
|
141 endwhile |
5440f3442841
commit https://github.com/vim/vim/commit/7cba71d7e3576639679b6a3aedeeb1ac07f7f2f5
Christian Brabandt <cb@256bit.org>
parents:
9632
diff
changeset
|
142 set nomodified |
8370
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
143 endfunc |
7545
4c922651fd78
commit https://github.com/vim/vim/commit/28fb79db6b52d1154e8dc63d227673648c2fce15
Christian Brabandt <cb@256bit.org>
parents:
7540
diff
changeset
|
144 |
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
145 " Source the test script. First grab the file name, in case the script |
8029
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
146 " navigates away. g:testname can be used by the tests. |
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
147 let g:testname = expand('%') |
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
148 let s:done = 0 |
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
149 let s:fail = 0 |
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
150 let s:errors = [] |
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
151 let s:messages = [] |
10100
26441931dad7
commit https://github.com/vim/vim/commit/dac1947bb366ef43cd6da95acc730554e76d8b84
Christian Brabandt <cb@256bit.org>
parents:
9949
diff
changeset
|
152 let s:skipped = [] |
10942
e05695e59f6d
patch 8.0.0360: sometimes VimL is used instead of "Vim script"
Christian Brabandt <cb@256bit.org>
parents:
10811
diff
changeset
|
153 if expand('%') =~ 'test_vimscript.vim' |
8029
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
154 " this test has intentional s:errors, don't use try/catch. |
7352
ddab7ae8796d
commit https://github.com/vim/vim/commit/4686b323e4bc0f466500b018959f6c8965f010f9
Christian Brabandt <cb@256bit.org>
parents:
7295
diff
changeset
|
155 source % |
7454
4ff843da79fd
commit https://github.com/vim/vim/commit/a2cce8630756769b2cefdc28c7290ae9262cddb1
Christian Brabandt <cb@256bit.org>
parents:
7391
diff
changeset
|
156 else |
4ff843da79fd
commit https://github.com/vim/vim/commit/a2cce8630756769b2cefdc28c7290ae9262cddb1
Christian Brabandt <cb@256bit.org>
parents:
7391
diff
changeset
|
157 try |
4ff843da79fd
commit https://github.com/vim/vim/commit/a2cce8630756769b2cefdc28c7290ae9262cddb1
Christian Brabandt <cb@256bit.org>
parents:
7391
diff
changeset
|
158 source % |
4ff843da79fd
commit https://github.com/vim/vim/commit/a2cce8630756769b2cefdc28c7290ae9262cddb1
Christian Brabandt <cb@256bit.org>
parents:
7391
diff
changeset
|
159 catch |
8029
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
160 let s:fail += 1 |
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
161 call add(s:errors, 'Caught exception: ' . v:exception . ' @ ' . v:throwpoint) |
7454
4ff843da79fd
commit https://github.com/vim/vim/commit/a2cce8630756769b2cefdc28c7290ae9262cddb1
Christian Brabandt <cb@256bit.org>
parents:
7391
diff
changeset
|
162 endtry |
4ff843da79fd
commit https://github.com/vim/vim/commit/a2cce8630756769b2cefdc28c7290ae9262cddb1
Christian Brabandt <cb@256bit.org>
parents:
7391
diff
changeset
|
163 endif |
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
164 |
8370
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
165 " Names of flaky tests. |
10189
2392e065efea
commit https://github.com/vim/vim/commit/e1c8c7a6742be6072290f9aa54ae358060d9c42f
Christian Brabandt <cb@256bit.org>
parents:
10100
diff
changeset
|
166 let s:flaky = [ |
10789
214417c527b5
patch 8.0.0284: collapse buffers test failed once
Christian Brabandt <cb@256bit.org>
parents:
10755
diff
changeset
|
167 \ 'Test_close_and_exit_cb()', |
214417c527b5
patch 8.0.0284: collapse buffers test failed once
Christian Brabandt <cb@256bit.org>
parents:
10755
diff
changeset
|
168 \ 'Test_collapse_buffers()', |
214417c527b5
patch 8.0.0284: collapse buffers test failed once
Christian Brabandt <cb@256bit.org>
parents:
10755
diff
changeset
|
169 \ 'Test_communicate()', |
10189
2392e065efea
commit https://github.com/vim/vim/commit/e1c8c7a6742be6072290f9aa54ae358060d9c42f
Christian Brabandt <cb@256bit.org>
parents:
10100
diff
changeset
|
170 \ 'Test_nb_basic()', |
10990
f18a98681da1
patch 8.0.0384: timer test failed for no apparent reason
Christian Brabandt <cb@256bit.org>
parents:
10942
diff
changeset
|
171 \ 'Test_oneshot()', |
10229
19ced29f773a
commit https://github.com/vim/vim/commit/c79d6aa01d86cd98cffddc80825c1c600e833bbf
Christian Brabandt <cb@256bit.org>
parents:
10223
diff
changeset
|
172 \ 'Test_pipe_through_sort_all()', |
10797
e1bddbed43cc
patch 8.0.0288: errors reported while running tests
Christian Brabandt <cb@256bit.org>
parents:
10789
diff
changeset
|
173 \ 'Test_pipe_through_sort_some()', |
11056
679c12064dbc
patch 8.0.0417: test for the clipboard fails sometimes
Christian Brabandt <cb@256bit.org>
parents:
10990
diff
changeset
|
174 \ 'Test_quoteplus()', |
10789
214417c527b5
patch 8.0.0284: collapse buffers test failed once
Christian Brabandt <cb@256bit.org>
parents:
10755
diff
changeset
|
175 \ 'Test_reltime()', |
10189
2392e065efea
commit https://github.com/vim/vim/commit/e1c8c7a6742be6072290f9aa54ae358060d9c42f
Christian Brabandt <cb@256bit.org>
parents:
10100
diff
changeset
|
176 \ ] |
8370
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
177 |
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
178 " Locate Test_ functions and execute them. |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
179 redir @q |
8116
3c1bdf20c8b9
commit https://github.com/vim/vim/commit/93bf558caef2d507ef6baf56eaf6025b63da1e34
Christian Brabandt <cb@256bit.org>
parents:
8029
diff
changeset
|
180 silent function /^Test_ |
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
181 redir END |
8029
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
182 let s:tests = split(substitute(@q, 'function \(\k*()\)', '\1', 'g')) |
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
183 |
8142
71aabce3142e
commit https://github.com/vim/vim/commit/befb366affa6309c6b4a469ec7f729821e3a36fa
Christian Brabandt <cb@256bit.org>
parents:
8116
diff
changeset
|
184 " If there is an extra argument filter the function names against it. |
71aabce3142e
commit https://github.com/vim/vim/commit/befb366affa6309c6b4a469ec7f729821e3a36fa
Christian Brabandt <cb@256bit.org>
parents:
8116
diff
changeset
|
185 if argc() > 1 |
71aabce3142e
commit https://github.com/vim/vim/commit/befb366affa6309c6b4a469ec7f729821e3a36fa
Christian Brabandt <cb@256bit.org>
parents:
8116
diff
changeset
|
186 let s:tests = filter(s:tests, 'v:val =~ argv(1)') |
71aabce3142e
commit https://github.com/vim/vim/commit/befb366affa6309c6b4a469ec7f729821e3a36fa
Christian Brabandt <cb@256bit.org>
parents:
8116
diff
changeset
|
187 endif |
71aabce3142e
commit https://github.com/vim/vim/commit/befb366affa6309c6b4a469ec7f729821e3a36fa
Christian Brabandt <cb@256bit.org>
parents:
8116
diff
changeset
|
188 |
7540
b910bb01832a
commit https://github.com/vim/vim/commit/cfc0a350a9fa04f1b0cfa1ba31fbd2847376513f
Christian Brabandt <cb@256bit.org>
parents:
7454
diff
changeset
|
189 " Execute the tests in alphabetical order. |
8116
3c1bdf20c8b9
commit https://github.com/vim/vim/commit/93bf558caef2d507ef6baf56eaf6025b63da1e34
Christian Brabandt <cb@256bit.org>
parents:
8029
diff
changeset
|
190 for s:test in sort(s:tests) |
8370
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
191 call RunTheTest(s:test) |
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
192 |
8370
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
193 if len(v:errors) > 0 && index(s:flaky, s:test) >= 0 |
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
194 call add(s:messages, 'Flaky test failed, running it again') |
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
195 let v:errors = [] |
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
196 call RunTheTest(s:test) |
cd7ea16d1300
commit https://github.com/vim/vim/commit/b5760a1ce5b700fc32b8bd11948ee189a847c59e
Christian Brabandt <cb@256bit.org>
parents:
8142
diff
changeset
|
197 endif |
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
198 |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
199 if len(v:errors) > 0 |
8029
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
200 let s:fail += 1 |
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
201 call add(s:errors, 'Found errors in ' . s:test . ':') |
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
202 call extend(s:errors, v:errors) |
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
203 let v:errors = [] |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
204 endif |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
205 endfor |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
206 |
9452
6d5c24b8dc0e
commit https://github.com/vim/vim/commit/fc4ad616073a169badfb2b9906fee2844f76f730
Christian Brabandt <cb@256bit.org>
parents:
9121
diff
changeset
|
207 " Don't write viminfo on exit. |
6d5c24b8dc0e
commit https://github.com/vim/vim/commit/fc4ad616073a169badfb2b9906fee2844f76f730
Christian Brabandt <cb@256bit.org>
parents:
9121
diff
changeset
|
208 set viminfo= |
6d5c24b8dc0e
commit https://github.com/vim/vim/commit/fc4ad616073a169badfb2b9906fee2844f76f730
Christian Brabandt <cb@256bit.org>
parents:
9121
diff
changeset
|
209 |
8029
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
210 if s:fail == 0 |
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
211 " Success, create the .res file so that make knows it's done. |
8029
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
212 exe 'split ' . fnamemodify(g:testname, ':r') . '.res' |
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
213 write |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
214 endif |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
215 |
8029
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
216 if len(s:errors) > 0 |
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
217 " Append errors to test.log |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
218 split test.log |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
219 call append(line('$'), '') |
8029
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
220 call append(line('$'), 'From ' . g:testname . ':') |
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
221 call append(line('$'), s:errors) |
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
222 write |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
223 endif |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
224 |
8029
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
225 let message = 'Executed ' . s:done . (s:done > 1 ? ' tests' : ' test') |
7372
6b057079a836
commit https://github.com/vim/vim/commit/096c8bb40d51b22a4b1d761baf7bb79fb9e55a28
Christian Brabandt <cb@256bit.org>
parents:
7352
diff
changeset
|
226 echo message |
8029
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
227 call add(s:messages, message) |
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
228 if s:fail > 0 |
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
229 let message = s:fail . ' FAILED:' |
7372
6b057079a836
commit https://github.com/vim/vim/commit/096c8bb40d51b22a4b1d761baf7bb79fb9e55a28
Christian Brabandt <cb@256bit.org>
parents:
7352
diff
changeset
|
230 echo message |
8029
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
231 call add(s:messages, message) |
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
232 call extend(s:messages, s:errors) |
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
233 endif |
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
234 |
10100
26441931dad7
commit https://github.com/vim/vim/commit/dac1947bb366ef43cd6da95acc730554e76d8b84
Christian Brabandt <cb@256bit.org>
parents:
9949
diff
changeset
|
235 " Add SKIPPED messages |
26441931dad7
commit https://github.com/vim/vim/commit/dac1947bb366ef43cd6da95acc730554e76d8b84
Christian Brabandt <cb@256bit.org>
parents:
9949
diff
changeset
|
236 call extend(s:messages, s:skipped) |
26441931dad7
commit https://github.com/vim/vim/commit/dac1947bb366ef43cd6da95acc730554e76d8b84
Christian Brabandt <cb@256bit.org>
parents:
9949
diff
changeset
|
237 |
26441931dad7
commit https://github.com/vim/vim/commit/dac1947bb366ef43cd6da95acc730554e76d8b84
Christian Brabandt <cb@256bit.org>
parents:
9949
diff
changeset
|
238 " Append messages to the file "messages" |
7372
6b057079a836
commit https://github.com/vim/vim/commit/096c8bb40d51b22a4b1d761baf7bb79fb9e55a28
Christian Brabandt <cb@256bit.org>
parents:
7352
diff
changeset
|
239 split messages |
6b057079a836
commit https://github.com/vim/vim/commit/096c8bb40d51b22a4b1d761baf7bb79fb9e55a28
Christian Brabandt <cb@256bit.org>
parents:
7352
diff
changeset
|
240 call append(line('$'), '') |
8029
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
241 call append(line('$'), 'From ' . g:testname . ':') |
770dd91ad9f7
commit https://github.com/vim/vim/commit/00af60bbb6cc7e8ccafddb30a1964f891b800bce
Christian Brabandt <cb@256bit.org>
parents:
7637
diff
changeset
|
242 call append(line('$'), s:messages) |
7372
6b057079a836
commit https://github.com/vim/vim/commit/096c8bb40d51b22a4b1d761baf7bb79fb9e55a28
Christian Brabandt <cb@256bit.org>
parents:
7352
diff
changeset
|
243 write |
6b057079a836
commit https://github.com/vim/vim/commit/096c8bb40d51b22a4b1d761baf7bb79fb9e55a28
Christian Brabandt <cb@256bit.org>
parents:
7352
diff
changeset
|
244 |
7277
6600871bb38c
commit https://github.com/vim/vim/commit/43345546ae63710441f066648b8485fb545b3801
Christian Brabandt <cb@256bit.org>
parents:
diff
changeset
|
245 qall! |
10388
6cdb0226d74a
commit https://github.com/vim/vim/commit/cc28e2d05d05552d8b72a520be8a193f3d9822d4
Christian Brabandt <cb@256bit.org>
parents:
10229
diff
changeset
|
246 |
6cdb0226d74a
commit https://github.com/vim/vim/commit/cc28e2d05d05552d8b72a520be8a193f3d9822d4
Christian Brabandt <cb@256bit.org>
parents:
10229
diff
changeset
|
247 " vim: shiftwidth=2 sts=2 expandtab |