2019-07-02 07:11:10 +00:00
|
|
|
Before:
|
2020-08-20 00:46:29 +00:00
|
|
|
Save g:ale_c_build_dir
|
2019-07-02 07:11:10 +00:00
|
|
|
Save g:ale_c_clangtidy_executable
|
2020-08-20 00:46:29 +00:00
|
|
|
Save g:ale_c_clangtidy_checks
|
|
|
|
Save g:ale_c_clangtidy_extra_options
|
|
|
|
Save g:ale_cpp_clangtidy_executable
|
|
|
|
Save g:ale_cpp_clangtidy_checks
|
|
|
|
Save g:ale_cpp_clangtidy_extra_options
|
2019-07-02 07:11:10 +00:00
|
|
|
|
|
|
|
" Use an invalid global executable, so we don't match it.
|
|
|
|
let g:ale_c_clangtidy_executable = 'xxxinvalid'
|
2020-08-20 00:46:29 +00:00
|
|
|
let g:ale_c_clangtidy_checks = []
|
|
|
|
let g:ale_c_clangtidy_extra_options = ''
|
|
|
|
let g:ale_cpp_clangtidy_executable = 'xxxinvalidpp'
|
|
|
|
let g:ale_cpp_clangtidy_checks = []
|
|
|
|
let g:ale_cpp_clangtidy_extra_options = ''
|
2019-07-02 07:11:10 +00:00
|
|
|
let g:ale_c_build_dir = ''
|
|
|
|
|
|
|
|
call ale#test#SetDirectory('/testplugin/test/fixers')
|
|
|
|
|
|
|
|
After:
|
|
|
|
Restore
|
|
|
|
|
|
|
|
call ale#test#RestoreDirectory()
|
|
|
|
|
|
|
|
Execute(The clangtidy callback should return the correct default values):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/c/dummy.c')
|
2019-07-02 07:11:10 +00:00
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ {
|
|
|
|
\ 'read_temporary_file': 1,
|
|
|
|
\ 'command': ale#Escape(g:ale_c_clangtidy_executable)
|
|
|
|
\ . ' -fix -fix-errors %t'
|
|
|
|
\ },
|
|
|
|
\ ale#fixers#clangtidy#Fix(bufnr(''))
|
|
|
|
|
|
|
|
Execute(The clangtidy callback should include any additional options):
|
2021-03-20 22:11:22 +00:00
|
|
|
call ale#test#SetFilename('../test-files/c/dummy.c')
|
2019-07-02 07:11:10 +00:00
|
|
|
let g:ale_c_clangtidy_extra_options = '--some-option'
|
|
|
|
|
|
|
|
AssertEqual
|
|
|
|
\ {
|
|
|
|
\ 'read_temporary_file': 1,
|
|
|
|
\ 'command': ale#Escape(g:ale_c_clangtidy_executable)
|
|
|
|
\ . ' -fix -fix-errors --some-option %t',
|
|
|
|
\ },
|
|
|
|
\ ale#fixers#clangtidy#Fix(bufnr(''))
|