aboutsummaryrefslogtreecommitdiff
path: root/.vim/autoload/neomake/makers/ft/neomake_tests.vim
blob: 4d06e7aa4fa85eec9d356bace15b7eb096d029ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
if !exists('g:neomake_test_messages')
    " Only use it during tests.
    finish
endif

function! neomake#makers#ft#neomake_tests#EnabledMakers() abort
    return get(b:, 'neomake_test_enabledmakers',
                \ get(g:, 'neomake_test_enabledmakers',
                \ ['maker_without_exe', 'nonexisting']))
endfunction

function! neomake#makers#ft#neomake_tests#maker_without_exe() abort
    return {}
endfunction

function! neomake#makers#ft#neomake_tests#maker_with_nonstring_exe() abort
    return {'exe': function('tr')}
endfunction

function! neomake#makers#ft#neomake_tests#echo_maker() abort
    return {
        \ 'exe': 'printf',
        \ 'args': 'neomake_tests_echo_maker',
        \ 'errorformat': '%m',
        \ 'append_file': 0,
        \ }
endfunction

function! neomake#makers#ft#neomake_tests#echo_args() abort
    return {
        \ 'exe': 'echo',
        \ 'errorformat': '%m',
        \ }
endfunction

function! neomake#makers#ft#neomake_tests#true() abort
    return {}
endfunction

function! neomake#makers#ft#neomake_tests#error_maker() abort
    return {
        \ 'exe': 'printf',
        \ 'args': ['%s:1:error_msg_1'],
        \ 'errorformat': '%E%f:%l:%m',
        \ 'append_file': 1,
        \ 'short_name': 'errmkr',
        \ }
endfunction

function! neomake#makers#ft#neomake_tests#process_output_error() abort
    let maker = {'exe': 'echo', 'args': 'output', 'append_file': 0}

    function! maker.process_output(...) abort
        return [{'valid': 1, 'text': 'error', 'lnum': 1, 'bufnr': bufnr('%')}]
    endfunction
    return maker
endfunction
" vim: ts=4 sw=4 et