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 call ale#assert#SetUpLinterTest('c', 'cppcheck')
3 let b:command_tail = ' -q --language=c --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}') . ' --enable=style -I' . ale#Escape(ale#path#Simplify(g:dir)) .' %t'
8 call ale#assert#TearDownLinterTest()
10 Execute(The executable should be configurable):
11 AssertLinter 'cppcheck', ale#Escape('cppcheck') . b:command_tail
13 let b:ale_c_cppcheck_executable = 'foobar'
16 AssertLinter 'foobar', ale#Escape('foobar') . b:command_tail
18 Execute(cppcheck for C should detect compile_commands.json files):
19 let b:rel_file_path = '../test-files/cppcheck/one/foo.c'
20 call ale#test#SetFilename(b:rel_file_path)
22 AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/cppcheck/one')
23 AssertLinter 'cppcheck', ale#Escape('cppcheck')
24 \ . ' -q --language=c'
25 \ . ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
26 \ . ' --project=' . ale#Escape('compile_commands.json')
27 \ . ' --file-filter=' . ale#Escape(ale#test#GetFilename(b:rel_file_path))
28 \ . ' --enable=style %t'
30 Execute(cppcheck for C should detect compile_commands.json files in build directories):
31 let b:rel_file_path = '../test-files/cppcheck/with_build_dir/foo.c'
32 call ale#test#SetFilename(b:rel_file_path)
34 AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/cppcheck/with_build_dir')
35 AssertLinter 'cppcheck', ale#Escape('cppcheck')
36 \ . ' -q --language=c'
37 \ . ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
38 \ . ' --project=' . ale#Escape(ale#path#Simplify('build/compile_commands.json'))
39 \ . ' --file-filter=' . ale#Escape(ale#test#GetFilename(b:rel_file_path))
40 \ . ' --enable=style %t'
42 Execute(cppcheck for C should include file dir if compile_commands.json file is not found):
43 call ale#test#SetFilename('../test-files/cppcheck/foo.c')
45 AssertLinter 'cppcheck',
46 \ ale#Escape('cppcheck')
47 \ . ' -q --language=c'
48 \ . ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
50 \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/cppcheck'))
53 Execute(cppcheck for C header should include file dir and not use compile_commands.json):
54 call ale#test#SetFilename('../test-files/cppcheck/one/foo.h')
56 AssertLinter 'cppcheck',
57 \ ale#Escape('cppcheck')
58 \ . ' -q --language=c'
59 \ . ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
60 \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/cppcheck/one'))
61 \ . ' --suppress=unusedStructMember'