All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
2 Save g:ale_c_parse_makefile
3 Save g:ale_c_always_make
4 Save b:ale_c_always_make
6 call ale#test#SetDirectory('/testplugin/test')
8 let g:ale_c_parse_makefile = 1
9 let g:ale_c_always_make = 1
10 let b:ale_c_always_make = 1
12 function SplitAndParse(path_prefix, command) abort
13 let l:args = ale#c#ShellSplit(a:command)
15 return ale#c#ParseCFlags(a:path_prefix, 0, l:args)
19 delfunction SplitAndParse
23 call ale#test#RestoreDirectory()
25 Execute(The make command should be correct):
26 call ale#test#SetFilename('test-files/c/makefile_project/subdir/file.c')
30 \ ale#path#Simplify(g:dir. '/test-files/c/makefile_project'),
31 \ 'make -n --always-make',
33 \ ale#c#GetMakeCommand(bufnr(''))
35 " You should be able to disable --always-make for a buffer.
36 let b:ale_c_always_make = 0
40 \ ale#path#Simplify(g:dir. '/test-files/c/makefile_project'),
43 \ ale#c#GetMakeCommand(bufnr(''))
45 Execute(Should recognize GNUmakefile as a makefile):
46 call ale#test#SetFilename('test-files/c/gnumakefile_project/file.c')
50 \ ale#path#Simplify(g:dir. '/test-files/c/gnumakefile_project'),
51 \ 'make -n --always-make',
53 \ ale#c#GetMakeCommand(bufnr(''))
55 Execute(The CFlags parser should be able to parse include directives):
56 call ale#test#SetFilename('test-files/c/makefile_project/subdir/file.c')
59 \ '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/subdir')),
60 \ ale#c#ParseCFlagsFromMakeOutput(bufnr(''), ['gcc -Isubdir -c file.c'])
63 \ '-isystem ' . ale#Escape('/usr/include/dir'),
64 \ ale#c#ParseCFlagsFromMakeOutput(bufnr(''), ['gcc -isystem /usr/include/dir -c file.c'])
66 Execute(ParseCFlags should ignore -c and -o):
67 call ale#test#SetFilename('test-files/c/makefile_project/subdir/file.c')
70 \ '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/subdir')),
71 \ ale#c#ParseCFlagsFromMakeOutput(bufnr(''), ['gcc -Isubdir -c file.c -o a.out'])
73 Execute(The CFlags parser should be able to parse macro directives):
74 call ale#test#SetFilename('test-files/c/makefile_project/subdir/file.c')
77 \ '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/subdir'))
79 \ ale#c#ParseCFlagsFromMakeOutput(bufnr(''), ['gcc -Isubdir -DTEST=1 -c file.c'])
81 Execute(The CFlags parser should be able to parse macro directives with spaces):
82 call ale#test#SetFilename('test-files/c/makefile_project/subdir/file.c')
85 \ '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/subdir'))
86 \ . ' -DTEST=$(( 2 * 4 ))',
87 \ ale#c#ParseCFlagsFromMakeOutput(bufnr(''), ['gcc -Isubdir -DTEST=$(( 2 * 4 )) -c file.c'])
89 Execute(The CFlags parser should be able to parse shell directives with spaces):
90 call ale#test#SetFilename('test-files/c/makefile_project/subdir/file.c')
93 \ '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/subdir'))
94 \ . ' -DTEST=`date +%s`',
95 \ ale#c#ParseCFlagsFromMakeOutput(bufnr(''), ['gcc -Isubdir -DTEST=`date +%s` -c file.c'])
97 Execute(ParseCFlags should be able to parse flags with relative paths):
99 \ '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/subdir'))
100 \ . ' ' . '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/kernel/include'))
101 \ . ' -DTEST=`date +%s`',
103 \ ale#path#Simplify(g:dir. '/test-files/c/makefile_project'),
105 \ . '-I'. ale#path#Simplify('kernel/include')
106 \ . ' -DTEST=`date +%s` -c file.c'
109 Execute(We should handle paths with spaces in double quotes):
112 \ . ' ' . '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/subdir'))
113 \ . ' ' . '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/dir with spaces'))
114 \ . ' ' . '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/kernel/include'))
115 \ . ' -DTEST=`date +%s`',
117 \ ale#path#Simplify(g:dir. '/test-files/c/makefile_project'),
118 \ 'gcc -Dgoal=9 -Tlinkerfile.ld blabla -Isubdir '
119 \ . '-I"dir with spaces"' . ' -I'. ale#path#Simplify('kernel/include')
120 \ . ' -DTEST=`date +%s` -c file.c'
123 Execute(ParseCFlags should handle paths with spaces in single quotes):
126 \ . ' ' . '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/subdir'))
127 \ . ' ' . '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/dir with spaces'))
128 \ . ' ' . '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/kernel/include'))
129 \ . ' -DTEST=`date +%s`',
131 \ ale#path#Simplify(g:dir. '/test-files/c/makefile_project'),
132 \ 'gcc -Dgoal=9 -Tlinkerfile.ld blabla -Isubdir '
133 \ . '-I''dir with spaces''' . ' -I'. ale#path#Simplify('kernel/include')
134 \ . ' -DTEST=`date +%s` -c file.c'
137 Execute(ParseCFlags should handle paths with minuses):
140 \ . ' ' . '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/subdir'))
141 \ . ' ' . '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/dir with spaces'))
142 \ . ' ' . '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/dir-with-dash'))
143 \ . ' ' . '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/kernel/include'))
144 \ . ' -DTEST=`date +%s`',
146 \ ale#path#Simplify(g:dir. '/test-files/c/makefile_project'),
147 \ 'gcc -Dgoal=9 -Tlinkerfile.ld blabla -Isubdir '
148 \ . '-I''dir with spaces''' . ' -Idir-with-dash'
149 \ . ' -I'. ale#path#Simplify('kernel/include')
150 \ . ' -DTEST=`date +%s` -c file.c'
153 Execute(We should handle -D with minuses):
156 \ . ' ' . '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/subdir'))
157 \ . ' -Dmacro-with-dash'
158 \ . ' ' . '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/dir with spaces'))
159 \ . ' ' . '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/dir-with-dash'))
160 \ . ' ' . '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/kernel/include'))
161 \ . ' -DTEST=`date +%s`',
163 \ ale#path#Simplify(g:dir. '/test-files/c/makefile_project'),
164 \ 'gcc -Dgoal=9 -Tlinkerfile.ld blabla -Isubdir '
165 \ . '-Dmacro-with-dash '
166 \ . '-I''dir with spaces''' . ' -Idir-with-dash'
167 \ . ' -I'. ale#path#Simplify('kernel/include')
168 \ . ' -DTEST=`date +%s` -c file.c'
171 Execute(We should handle flags at the end of the line):
174 \ . ' ' . '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/subdir'))
175 \ . ' -Dmacro-with-dash'
176 \ . ' ' . '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/dir with spaces'))
177 \ . ' ' . '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/dir-with-dash'))
178 \ . ' ' . '-I' . ' ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/kernel/include')),
180 \ ale#path#Simplify(g:dir. '/test-files/c/makefile_project'),
181 \ 'gcc -Dgoal=9 -Tlinkerfile.ld blabla -Isubdir '
182 \ . '-Dmacro-with-dash '
183 \ . '-I''dir with spaces''' . ' -Idir-with-dash'
184 \ . ' -I'. ale#path#Simplify('kernel/include')
187 Execute(FlagsFromCompileCommands should tolerate empty values):
188 AssertEqual '', ale#c#FlagsFromCompileCommands(bufnr(''), '')
190 Execute(ParseCompileCommandsFlags should tolerate empty values):
191 AssertEqual '', ale#c#ParseCompileCommandsFlags(bufnr(''), {}, {})
193 Execute(ParseCompileCommandsFlags should parse some basic flags):
194 silent noautocmd execute 'file! ' . fnameescape(ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.c'))
196 " We should read the absolute path filename entry, not the other ones.
198 \ '-I ' . ale#Escape(ale#path#Simplify('/usr/include/xmms2')),
199 \ ale#c#ParseCompileCommandsFlags(
202 \ ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.c'): [
204 \ 'directory': ale#path#Simplify('/foo/bar/xmms2-mpris'),
205 \ 'command': '/usr/bin/cc -I' . ale#path#Simplify('/usr/include/xmms2')
206 \ . ' -o CMakeFiles/xmms2-mpris.dir/src/xmms2-mpris.c.o'
207 \ . ' -c ' . ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.c'),
208 \ 'file': ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.c'),
213 \ 'directory': ale#path#Simplify('/foo/bar/xmms2-mpris'),
214 \ 'command': '/usr/bin/cc -I' . ale#path#Simplify('/usr/include/ignoreme')
215 \ . ' -o CMakeFiles/xmms2-mpris.dir/src/xmms2-mpris.c.o'
216 \ . ' -c ' . ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.c'),
217 \ 'file': ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.c'),
222 \ ale#path#Simplify('/foo/bar/xmms2-mpris/src'): [
224 \ 'directory': ale#path#Simplify('/foo/bar/xmms2-mpris/src'),
225 \ 'command': '/usr/bin/cc -I' . ale#path#Simplify('/usr/include/ignoreme')
226 \ . ' -o CMakeFiles/xmms2-mpris.dir/src/xmms2-mpris.c.o'
227 \ . ' -c ' . ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.c'),
233 \ 'directory': ale#path#Simplify('/foo/bar/xmms2-mpris'),
234 \ 'command': '/usr/bin/cc -I' . ale#path#Simplify('/usr/include/ignoreme')
235 \ . ' -o CMakeFiles/xmms2-mpris.dir/src/xmms2-mpris.c.o'
236 \ . ' -c ' . ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.c'),
237 \ 'file': ale#path#Simplify((has('win32') ? 'C:' : '') . '/foo/bar/xmms2-mpris/src/xmms2-other.c'),
243 Execute(ParseCompileCommandsFlags should fall back to files with the same name):
244 silent noautocmd execute 'file! ' . fnameescape(ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.c'))
246 " We should prefer the basename file flags, not the base dirname flags.
248 \ '-I ' . ale#Escape(ale#path#Simplify('/usr/include/xmms2')),
249 \ ale#c#ParseCompileCommandsFlags(
254 \ 'directory': ale#path#Simplify('/foo/bar/xmms2-mpris'),
255 \ 'command': '/usr/bin/cc -I' . ale#path#Simplify('/usr/include/xmms2')
256 \ . ' -o CMakeFiles/xmms2-mpris.dir/src/xmms2-mpris.c.o'
257 \ . ' -c ' . ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.c'),
258 \ 'file': ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.c'),
265 \ 'directory': ale#path#Simplify('/foo/bar/xmms2-mpris'),
266 \ 'command': '/usr/bin/cc -I' . ale#path#Simplify('/usr/include/ignoreme')
267 \ . ' -o CMakeFiles/xmms2-mpris.dir/src/xmms2-mpris.c.o'
268 \ . ' -c ' . ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.c'),
269 \ 'file': ale#path#Simplify((has('win32') ? 'C:' : '') . '/foo/bar/xmms2-mpris/src/xmms2-other.c'),
275 Execute(ParseCompileCommandsFlags should parse flags for exact directory matches):
276 silent noautocmd execute 'file! ' . fnameescape(ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.c'))
278 " We should ues the exact directory flags, not the file basename flags.
280 \ '-I ' . ale#Escape(ale#path#Simplify('/usr/include/xmms2')),
281 \ ale#c#ParseCompileCommandsFlags(
286 \ 'directory': ale#path#Simplify('/foo/bar/xmms2-mpris'),
287 \ 'command': '/usr/bin/cc -I' . ale#path#Simplify('/usr/include/ignoreme')
288 \ . ' -o CMakeFiles/xmms2-mpris.dir/src/xmms2-mpris.c.o'
289 \ . ' -c ' . ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.c'),
290 \ 'file': ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.c'),
295 \ ale#path#Simplify('/foo/bar/xmms2-mpris/src'): [
297 \ 'directory': ale#path#Simplify('/foo/bar/xmms2-mpris/src'),
298 \ 'command': '/usr/bin/cc -I' . ale#path#Simplify('/usr/include/xmms2')
299 \ . ' -o CMakeFiles/xmms2-mpris.dir/src/xmms2-mpris.c.o'
300 \ . ' -c ' . ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.c'),
306 \ 'directory': ale#path#Simplify('/foo/bar/xmms2-mpris'),
307 \ 'command': '/usr/bin/cc -I' . ale#path#Simplify('/usr/include/ignoreme')
308 \ . ' -o CMakeFiles/xmms2-mpris.dir/src/xmms2-mpris.c.o'
309 \ . ' -c ' . ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.c'),
310 \ 'file': ale#path#Simplify((has('win32') ? 'C:' : '') . '/foo/bar/xmms2-mpris/src/xmms2-other.c'),
316 Execute(ParseCompileCommandsFlags should fall back to files in the same directory):
317 silent noautocmd execute 'file! ' . fnameescape(ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.c'))
320 \ '-I ' . ale#Escape(ale#path#Simplify('/usr/include/xmms2')),
321 \ ale#c#ParseCompileCommandsFlags(
327 \ 'directory': ale#path#Simplify('/foo/bar/xmms2-mpris'),
328 \ 'command': '/usr/bin/cc -I' . ale#path#Simplify('/usr/include/xmms2')
329 \ . ' -o CMakeFiles/xmms2-mpris.dir/src/xmms2-mpris.c.o'
330 \ . ' -c ' . ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.c'),
331 \ 'file': ale#path#Simplify((has('win32') ? 'C:' : '') . '/foo/bar/xmms2-mpris/src/xmms2-other.c'),
337 Execute(ParseCompileCommandsFlags should tolerate items without commands):
338 silent noautocmd execute 'file! ' . fnameescape(ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.c'))
342 \ ale#c#ParseCompileCommandsFlags(
347 \ 'directory': '/foo/bar/xmms2-mpris',
348 \ 'file': '/foo/bar/xmms2-mpris/src/xmms2-mpris.c',
355 Execute(ParseCompileCommandsFlags should take commands from matching .c files for .h files):
356 silent noautocmd execute 'file! ' . fnameescape(ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.h'))
359 \ '-I ' . ale#Escape('/usr/include/xmms2'),
360 \ ale#c#ParseCompileCommandsFlags(
365 \ 'directory': '/foo/bar/xmms2-mpris',
366 \ 'file': (has('win32') ? 'C:' : '') . '/foo/bar/xmms2-mpris/src/xmms2-mpris.c',
367 \ 'command': '/usr/bin/cc -I' . '/usr/include/xmms2'
368 \ . ' -o CMakeFiles/xmms2-mpris.dir/src/xmms2-mpris.c.o'
369 \ . ' -c ' . '/foo/bar/xmms2-mpris/src/xmms2-mpris.c',
376 Execute(ParseCompileCommandsFlags should take commands from matching .cpp files for .hpp files):
377 silent noautocmd execute 'file! ' . fnameescape(ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.hpp'))
380 \ '-I ' . ale#Escape('/usr/include/xmms2'),
381 \ ale#c#ParseCompileCommandsFlags(
384 \ 'xmms2-mpris.cpp': [
386 \ 'directory': '/foo/bar/xmms2-mpris',
387 \ 'file': (has('win32') ? 'C:' : '') . '/foo/bar/xmms2-mpris/src/xmms2-mpris.cpp',
388 \ 'command': '/usr/bin/cc -I' . '/usr/include/xmms2'
389 \ . ' -o CMakeFiles/xmms2-mpris.dir/src/xmms2-mpris.c.o'
390 \ . ' -c ' . '/foo/bar/xmms2-mpris/src/xmms2-mpris.cpp',
398 Execute(ParseCompileCommandsFlags should take commands from matching .cpp files for .h files):
399 silent noautocmd execute 'file! ' . fnameescape(ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.h'))
402 \ '-I ' . ale#Escape('/usr/include/xmms2'),
403 \ ale#c#ParseCompileCommandsFlags(
406 \ 'xmms2-mpris.cpp': [
408 \ 'directory': '/foo/bar/xmms2-mpris',
409 \ 'file': (has('win32') ? 'C:' : '') . '/foo/bar/xmms2-mpris/src/xmms2-mpris.cpp',
410 \ 'command': '/usr/bin/cc -I' . '/usr/include/xmms2'
411 \ . ' -o CMakeFiles/xmms2-mpris.dir/src/xmms2-mpris.c.o'
412 \ . ' -c ' . '/foo/bar/xmms2-mpris/src/xmms2-mpris.cpp',
420 Execute(ParseCompileCommandsFlags should not take commands from .c files for .h files with different names):
421 silent noautocmd execute 'file! ' . fnameescape(ale#path#Simplify('/foo/bar/xmms2-mpris/src/other.h'))
425 \ ale#c#ParseCompileCommandsFlags(
430 \ 'directory': '/foo/bar/xmms2-mpris',
431 \ 'file': (has('win32') ? 'C:' : '') . '/foo/bar/xmms2-mpris/src/xmms2-mpris.c',
432 \ 'command': '/usr/bin/cc -I' . '/usr/include/xmms2'
433 \ . ' -o CMakeFiles/xmms2-mpris.dir/src/xmms2-mpris.c.o'
434 \ . ' -c ' . '/foo/bar/xmms2-mpris/src/xmms2-mpris.c',
442 Execute(ShellSplit should not merge flags):
450 \ 'subdir/somedep1.o',
451 \ 'subdir/somedep2.o',
452 \ '-I''dir with spaces''',
454 \ 'subdir/somedep3.o',
455 \ 'subdir/somedep4.o',
456 \ '-I' . ale#path#Simplify('kernel/include'),
457 \ 'subdir/somedep5.o',
458 \ 'subdir/somedep6.o',
461 \ 'gcc -Dgoal=9 -Tlinkerfile.ld blabla -Isubdir '
462 \ . 'subdir/somedep1.o ' . 'subdir/somedep2.o '
463 \ . '-I''dir with spaces''' . ' -Idir-with-dash '
464 \ . 'subdir/somedep3.o ' . 'subdir/somedep4.o '
465 \ . ' -I'. ale#path#Simplify('kernel/include') . ' '
466 \ . 'subdir/somedep5.o ' . 'subdir/somedep6.o'
469 Execute(ShellSplit should handle parenthesis and quotes):
476 \ '-Dtest1="('' '')"',
478 \ '-Dtest2=''(` `)''',
484 \ 'gcc -Dgoal=9 -Tlinkerfile.ld blabla '
485 \ . '-Dtest1="('' '')" file1.o '
486 \ . '-Dtest2=''(` `)'' file2.o '
487 \ . '-Dtest3=`(" ")` file3.o'
490 Execute(We should include several important flags):
492 \ '-I ' . ale#Escape(ale#path#Simplify(g:dir . '/test-files/c/makefile_project/inc'))
493 \ . ' -I ' . ale#Escape(ale#path#Simplify(g:dir . '/test-files/c/makefile_project/include'))
494 \ . ' -iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test-files/c/makefile_project/incquote'))
495 \ . ' -isystem ' . ale#Escape(ale#path#Simplify(g:dir . '/test-files/c/makefile_project/incsystem'))
496 \ . ' -idirafter ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/incafter'))
497 \ . ' -iframework ' . ale#Escape(ale#path#Simplify(g:dir . '/test-files/c/makefile_project/incframework'))
498 \ . ' -include file.h'
499 \ . ' -imacros macros.h'
500 \ . ' -Dmacro="value"'
503 \ . ' -D macro3="value"'
506 \ . ' -iprefix prefix -iwithprefix prefix2 -iwithprefixbefore prefix3'
507 \ . ' -isysroot sysroot --sysroot=test --no-sysroot-suffix -imultilib multidir'
508 \ . ' -Wsome-warning -std=c89 -pedantic -pedantic-errors -ansi'
509 \ . ' -foption -O2 -C -CC -trigraphs -nostdinc -nostdinc++'
510 \ . ' -iplugindir=dir -march=native -w',
512 \ ale#path#Simplify(g:dir. '/test-files/c/makefile_project'),
544 \ '-iwithprefixbefore',
549 \ '--no-sysroot-suffix',
555 \ '-pedantic-errors',
570 Execute(We should quote the flags we need to quote):
572 \ '-I ' . ale#Escape(ale#path#Simplify(g:dir . '/test-files/c/makefile_project/inc'))
573 \ . ' -I ' . ale#Escape(ale#path#Simplify(g:dir . '/test-files/c/makefile_project/include'))
574 \ . ' -iquote ' . ale#Escape(ale#path#Simplify(g:dir . '/test-files/c/makefile_project/incquote'))
575 \ . ' -isystem ' . ale#Escape(ale#path#Simplify(g:dir . '/test-files/c/makefile_project/incsystem'))
576 \ . ' -idirafter ' . ale#Escape(ale#path#Simplify(g:dir. '/test-files/c/makefile_project/incafter'))
577 \ . ' -iframework ' . ale#Escape(ale#path#Simplify(g:dir . '/test-files/c/makefile_project/incframework'))
578 \ . ' -include file.h'
579 \ . ' -imacros macros.h'
580 \ . ' ' . ale#Escape('-Dmacro="value"')
583 \ . ' -D ' . ale#Escape('macro3="value"')
586 \ . ' -iprefix prefix -iwithprefix prefix2 -iwithprefixbefore prefix3'
587 \ . ' -isysroot sysroot --sysroot=test'
588 \ . ' ' . ale#Escape('--sysroot="quoted"')
589 \ . ' ' . ale#Escape('--sysroot=foo bar')
590 \ . ' --no-sysroot-suffix -imultilib multidir'
591 \ . ' -Wsome-warning -std=c89 -pedantic -pedantic-errors -ansi'
592 \ . ' -foption -O2 -C -CC -trigraphs -nostdinc -nostdinc++'
593 \ . ' -iplugindir=dir -march=native -w',
595 \ ale#path#Simplify(g:dir. '/test-files/c/makefile_project'),
627 \ '-iwithprefixbefore',
632 \ '--sysroot="quoted"',
633 \ '--sysroot=foo bar',
634 \ '--no-sysroot-suffix',
640 \ '-pedantic-errors',
655 Execute(We should exclude other flags that cause problems):
659 \ ale#path#Simplify(g:dir. '/test-files/c/makefile_project'),
669 \ '-fdump-file=name',
670 \ '-fdiagnostics-arg',
671 \ '-fno-show-column',
677 Execute(We should expand @file in CFlags):
679 \ '-DARGS1 -DARGS2 -O2',
681 \ ale#path#Simplify(g:dir. '/test-files/c/makefile_project'),