summaryrefslogtreecommitdiff
path: root/test/linter/test_cpp_cppcheck.vader
diff options
context:
space:
mode:
Diffstat (limited to 'test/linter/test_cpp_cppcheck.vader')
-rw-r--r--test/linter/test_cpp_cppcheck.vader14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/linter/test_cpp_cppcheck.vader b/test/linter/test_cpp_cppcheck.vader
index 62195803..2cde1da4 100644
--- a/test/linter/test_cpp_cppcheck.vader
+++ b/test/linter/test_cpp_cppcheck.vader
@@ -28,6 +28,7 @@ Execute(cppcheck for C++ should detect compile_commands.json files):
\ . ' -q --language=c++'
\ . ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
\ . ' --project=' . ale#Escape('compile_commands.json')
+ \ . ' --file-filter=' . ale#Escape('foo.cpp')
\ . ' --enable=style %t'
Execute(cppcheck for C++ should detect compile_commands.json files in build directories):
@@ -38,6 +39,7 @@ Execute(cppcheck for C++ should detect compile_commands.json files in build dire
\ . ' -q --language=c++'
\ . ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
\ . ' --project=' . ale#Escape(ale#path#Simplify('build/compile_commands.json'))
+ \ . ' --file-filter=' . ale#Escape('foo.cpp')
\ . ' --enable=style %t'
Execute(cppcheck for C++ should include file dir if compile_commands.json file is not found):
@@ -51,6 +53,18 @@ Execute(cppcheck for C++ should include file dir if compile_commands.json file i
\ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/cppcheck'))
\ . ' %t'
+Execute(cppcheck for C++ header should include file dir and not use compile_commands.json):
+ call ale#test#SetFilename('../test-files/cppcheck/one/foo.hpp')
+
+ AssertLinter 'cppcheck',
+ \ ale#Escape('cppcheck')
+ \ . ' -q --language=c++'
+ \ . ' --template=' . ale#Escape('{file}:{line}:{column}: {severity}:{inconclusive:inconclusive:} {message} [{id}]\\n{code}')
+ \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/cppcheck/one'))
+ \ . ' --suppress=unusedStructMember'
+ \ . ' --enable=style'
+ \ . ' %t'
+
Execute(cppcheck for C++ should ignore compile_commands.json file if buffer is modified):
call ale#test#SetFilename('../test-files/cppcheck/one/foo.cpp')