summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/command_callback/cppcheck_paths/with_build_dir/build/compile_commands.json0
-rw-r--r--test/command_callback/test_c_cppcheck_command_callbacks.vader14
-rw-r--r--test/command_callback/test_cpp_cppcheck_command_callbacks.vader16
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'