diff options
author | w0rp <devw0rp@gmail.com> | 2019-05-20 22:08:03 +0100 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2019-05-20 22:08:03 +0100 |
commit | 28819eedd39f0746c94a1ec59ca3c089e35971a5 (patch) | |
tree | 2c51801dd80b97202add177d9fa4784eea75ed72 /test | |
parent | 937138dad4910e2746abcf34c9d0dc4ffb5454f3 (diff) | |
download | ale-28819eedd39f0746c94a1ec59ca3c089e35971a5.zip |
Close #2359 - Find compile_commands.json in build dirs for cppcheck
Diffstat (limited to 'test')
3 files changed, 27 insertions, 3 deletions
diff --git a/test/command_callback/cppcheck_paths/with_build_dir/build/compile_commands.json b/test/command_callback/cppcheck_paths/with_build_dir/build/compile_commands.json new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/command_callback/cppcheck_paths/with_build_dir/build/compile_commands.json diff --git a/test/command_callback/test_c_cppcheck_command_callbacks.vader b/test/command_callback/test_c_cppcheck_command_callbacks.vader index 3ae4bdbe..8e11ef2d 100644 --- a/test/command_callback/test_c_cppcheck_command_callbacks.vader +++ b/test/command_callback/test_c_cppcheck_command_callbacks.vader @@ -21,4 +21,16 @@ Execute(cppcheck for C++ should detect compile_commands.json files): AssertLinter 'cppcheck', \ ale#path#CdString(ale#path#Simplify(g:dir . '/cppcheck_paths/one')) \ . ale#Escape('cppcheck') - \ . ' -q --language=c --project=compile_commands.json --enable=style %t' + \ . ' -q --language=c' + \ . ' --project=' . ale#Escape('compile_commands.json') + \ . ' --enable=style %t' + +Execute(cppcheck for C++ should detect compile_commands.json files in build directories): + call ale#test#SetFilename('cppcheck_paths/with_build_dir/foo.cpp') + + AssertLinter 'cppcheck', + \ ale#path#CdString(ale#path#Simplify(g:dir . '/cppcheck_paths/with_build_dir')) + \ . ale#Escape('cppcheck') + \ . ' -q --language=c' + \ . ' --project=' . ale#Escape(ale#path#Simplify('build/compile_commands.json')) + \ . ' --enable=style %t' diff --git a/test/command_callback/test_cpp_cppcheck_command_callbacks.vader b/test/command_callback/test_cpp_cppcheck_command_callbacks.vader index 352c88d5..28e3a0b7 100644 --- a/test/command_callback/test_cpp_cppcheck_command_callbacks.vader +++ b/test/command_callback/test_cpp_cppcheck_command_callbacks.vader @@ -17,6 +17,18 @@ Execute(cppcheck for C++ should detect compile_commands.json files): call ale#test#SetFilename('cppcheck_paths/one/foo.cpp') AssertLinter 'cppcheck', - \ ale#path#CdString(ale#path#Simplify(g:dir . '/cppcheck_paths/one')) + \ ale#path#CdString(ale#path#Simplify(g:dir . '/cppcheck_paths/one')) \ . ale#Escape('cppcheck') - \ . ' -q --language=c++ --project=compile_commands.json --enable=style %t' + \ . ' -q --language=c++' + \ . ' --project=' . ale#Escape('compile_commands.json') + \ . ' --enable=style %t' + +Execute(cppcheck for C++ should detect compile_commands.json files in build directories): + call ale#test#SetFilename('cppcheck_paths/with_build_dir/foo.cpp') + + AssertLinter 'cppcheck', + \ ale#path#CdString(ale#path#Simplify(g:dir . '/cppcheck_paths/with_build_dir')) + \ . ale#Escape('cppcheck') + \ . ' -q --language=c++' + \ . ' --project=' . ale#Escape('build/compile_commands.json') + \ . ' --enable=style %t' |