Fix #3247 - Use --always-make for make -n by default

This commit is contained in:
w0rp
2020-08-29 16:05:49 +01:00
parent bc3a843e10
commit 7e0cdb53ec
4 changed files with 43 additions and 1 deletions

View File

@@ -1,9 +1,13 @@
Before:
Save g:ale_c_parse_makefile
Save g:ale_c_always_make
Save b:ale_c_always_make
call ale#test#SetDirectory('/testplugin/test')
let g:ale_c_parse_makefile = 1
let g:ale_c_always_make = 1
let b:ale_c_always_make = 1
function SplitAndParse(path_prefix, command) abort
let l:args = ale#c#ShellSplit(a:command)
@@ -18,6 +22,22 @@ After:
call ale#test#RestoreDirectory()
Execute(The make command should be correct):
call ale#test#SetFilename('test_c_projects/makefile_project/subdir/file.c')
AssertEqual
\ ale#path#CdString(ale#path#Simplify(g:dir. '/test_c_projects/makefile_project'))
\ . 'make -n --always-make',
\ ale#c#GetMakeCommand(bufnr(''))
" You should be able to disable --always-make for a buffer.
let b:ale_c_always_make = 0
AssertEqual
\ ale#path#CdString(ale#path#Simplify(g:dir. '/test_c_projects/makefile_project'))
\ . 'make -n',
\ ale#c#GetMakeCommand(bufnr(''))
Execute(The CFlags parser should be able to parse include directives):
call ale#test#SetFilename('test_c_projects/makefile_project/subdir/file.c')