summaryrefslogtreecommitdiff
path: root/test/command_callback/test_cppcheck_command_callbacks.vader
blob: 63958643bc977206a2671f5f52b3464eefdae1b2 (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
Before:
  silent! cd /testplugin/test/command_callback
  let b:dir = getcwd()

After:
  silent execute 'cd ' . fnameescape(b:dir)
  unlet! b:dir
  call ale#linter#Reset()

Execute(The default C cppcheck command should be correct):
  runtime ale_linters/c/cppcheck.vim

  AssertEqual
  \ 'cppcheck -q --language=c --enable=style %t',
  \ ale_linters#c#cppcheck#GetCommand(bufnr(''))

Execute(cppcheck for C should detect compile_commands.json files):
  runtime ale_linters/c/cppcheck.vim
  cd cppcheck_paths/one

  AssertEqual
  \ 'cd ' . shellescape(b:dir . '/cppcheck_paths/one') . ' && '
  \ . 'cppcheck -q --language=c --project=compile_commands.json --enable=style %t',
  \ ale_linters#c#cppcheck#GetCommand(bufnr(''))

Execute(The default C++ cppcheck command should be correct):
  runtime ale_linters/cpp/cppcheck.vim

  AssertEqual
  \ 'cppcheck -q --language=c++ --enable=style %t',
  \ ale_linters#cpp#cppcheck#GetCommand(bufnr(''))

Execute(cppcheck for C++ should detect compile_commands.json files):
  runtime ale_linters/cpp/cppcheck.vim
  cd cppcheck_paths/one

  AssertEqual
  \ 'cd ' . shellescape(b:dir . '/cppcheck_paths/one') . ' && '
  \ . 'cppcheck -q --language=c++ --project=compile_commands.json --enable=style %t',
  \ ale_linters#cpp#cppcheck#GetCommand(bufnr(''))