summaryrefslogtreecommitdiff
path: root/test/test_c_flag_parsing.vader
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_c_flag_parsing.vader')
-rw-r--r--test/test_c_flag_parsing.vader20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/test_c_flag_parsing.vader b/test/test_c_flag_parsing.vader
index 076be6a1..99722b17 100644
--- a/test/test_c_flag_parsing.vader
+++ b/test/test_c_flag_parsing.vader
@@ -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')