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('cpp', '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'
6 " Remove a test file we might open for some tests.
7 if &buftype != 'nofile'
12 unlet! b:rel_file_path
14 call ale#assert#TearDownLinterTest()
16 Execute(The executable should be configurable):
17 AssertLinter 'cppcheck', ale#Escape('cppcheck') . b:command_tail
19 let b:ale_cpp_cppcheck_executable = 'foobar'
22 AssertLinter 'foobar', ale#Escape('foobar') . b:command_tail
24 Execute(cppcheck for C++ should detect compile_commands.json files):
25 let b:rel_file_path = '../test-files/cppcheck/one/foo.cpp'
26 call ale#test#SetFilename(b:rel_file_path)
28 AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/cppcheck/one')
29 AssertLinter 'cppcheck', ale#Escape('cppcheck')
30 \ . ' -q --language=c++'
31 \ . ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
32 \ . ' --project=' . ale#Escape('compile_commands.json')
33 \ . ' --file-filter=' . ale#Escape(ale#test#GetFilename(b:rel_file_path))
34 \ . ' --enable=style %t'
36 Execute(cppcheck for C++ should detect compile_commands.json files in build directories):
37 let b:rel_file_path = '../test-files/cppcheck/with_build_dir/foo.cpp'
38 call ale#test#SetFilename(b:rel_file_path)
40 AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/cppcheck/with_build_dir')
41 AssertLinter 'cppcheck', ale#Escape('cppcheck')
42 \ . ' -q --language=c++'
43 \ . ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
44 \ . ' --project=' . ale#Escape(ale#path#Simplify('build/compile_commands.json'))
45 \ . ' --file-filter=' . ale#Escape(ale#test#GetFilename(b:rel_file_path))
46 \ . ' --enable=style %t'
48 Execute(cppcheck for C++ should include file dir if compile_commands.json file is not found):
49 call ale#test#SetFilename('../test-files/cppcheck/foo.cpp')
51 AssertLinter 'cppcheck',
52 \ ale#Escape('cppcheck')
53 \ . ' -q --language=c++'
54 \ . ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
56 \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/cppcheck'))
59 Execute(cppcheck for C++ header should include file dir and not use compile_commands.json):
60 call ale#test#SetFilename('../test-files/cppcheck/one/foo.hpp')
62 AssertLinter 'cppcheck',
63 \ ale#Escape('cppcheck')
64 \ . ' -q --language=c++'
65 \ . ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
66 \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/cppcheck/one'))
67 \ . ' --suppress=unusedStructMember'
71 Execute(cppcheck for C++ should ignore compile_commands.json file if buffer is modified):
72 call ale#test#SetFilename('../test-files/cppcheck/one/foo.cpp')
77 AssertLinterCwd ale#path#Simplify(g:dir . '/../test-files/cppcheck/one')
78 AssertLinter 'cppcheck', ale#Escape('cppcheck')
79 \ . ' -q --language=c++'
80 \ . ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
82 \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/cppcheck/one'))