2017-05-02 16:18:17 -04:00
|
|
|
Before:
|
|
|
|
silent! cd /testplugin/test/command_callback
|
|
|
|
let b:dir = getcwd()
|
|
|
|
|
|
|
|
After:
|
|
|
|
silent execute 'cd ' . fnameescape(b:dir)
|
|
|
|
unlet! b:dir
|
2017-06-21 17:33:34 -04:00
|
|
|
|
2017-05-02 16:18:17 -04:00
|
|
|
call ale#linter#Reset()
|
|
|
|
|
|
|
|
Execute(The default C cppcheck command should be correct):
|
|
|
|
runtime ale_linters/c/cppcheck.vim
|
|
|
|
|
2017-06-21 17:33:34 -04:00
|
|
|
call ale#test#SetFilename('cppcheck_paths/two/foo.cpp')
|
|
|
|
|
2017-05-02 16:18:17 -04:00
|
|
|
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
|
2017-06-21 17:33:34 -04:00
|
|
|
|
|
|
|
call ale#test#SetFilename('cppcheck_paths/one/foo.cpp')
|
2017-05-02 16:18:17 -04:00
|
|
|
|
|
|
|
AssertEqual
|
2017-06-21 17:33:34 -04:00
|
|
|
\ 'cd ' . ale#Escape(b:dir . '/cppcheck_paths/one') . ' && '
|
2017-05-02 16:18:17 -04:00
|
|
|
\ . '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
|
|
|
|
|
2017-06-21 17:33:34 -04:00
|
|
|
call ale#test#SetFilename('cppcheck_paths/two/foo.cpp')
|
|
|
|
|
2017-05-02 16:18:17 -04:00
|
|
|
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
|
2017-06-21 17:33:34 -04:00
|
|
|
|
|
|
|
call ale#test#SetFilename('cppcheck_paths/one/foo.cpp')
|
2017-05-02 16:18:17 -04:00
|
|
|
|
|
|
|
AssertEqual
|
2017-06-21 17:33:34 -04:00
|
|
|
\ 'cd ' . ale#Escape(b:dir . '/cppcheck_paths/one') . ' && '
|
2017-05-02 16:18:17 -04:00
|
|
|
\ . 'cppcheck -q --language=c++ --project=compile_commands.json --enable=style %t',
|
|
|
|
\ ale_linters#cpp#cppcheck#GetCommand(bufnr(''))
|