summaryrefslogtreecommitdiff
path: root/test/command_callback/test_ada_gcc_command_callbacks.vader
blob: de6e355e5201e358557407a6090fb2d556be46df (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
Before:
  call ale#assert#SetUpLinterTest('ada', 'gcc')
  call ale#test#SetFilename('dummy.adb')

  function! GetOutputDir(command) abort
    let l:split_command = split(a:command)
    let l:index = index(l:split_command, '-o')
    return l:split_command[l:index + 1]
  endfunction

  let b:out_file = GetOutputDir(ale_linters#ada#gcc#GetCommand(bufnr('')))

After:
  delfunction GetOutputDir

  unlet! b:out_file

  call ale#assert#TearDownLinterTest()

Execute(The executable should be configurable):

  AssertLinter 'gcc',
  \ ale#Escape('gcc') . ' -x ada -c -gnatc'
  \ . ' -o ' . b:out_file
  \ . ' -I ' . ale#Escape(getcwd())
  \ . ' -gnatwa -gnatq %t'

  let b:ale_ada_gcc_executable = 'foo'

  AssertLinter 'foo',
  \ ale#Escape('foo') . ' -x ada -c -gnatc'
  \ . ' -o ' . b:out_file
  \ . ' -I ' . ale#Escape(getcwd())
  \ . ' -gnatwa -gnatq %t'

Execute(The options should be configurable):

  let g:ale_ada_gcc_options = '--foo --bar'

  AssertLinter 'gcc',
  \ ale#Escape('gcc') . ' -x ada -c -gnatc'
  \ . ' -o ' . b:out_file
  \ . ' -I ' . ale#Escape(getcwd())
  \ . ' --foo --bar %t'