summaryrefslogtreecommitdiff
path: root/test/command_callback/test_cppcheck_command_callbacks.vader
diff options
context:
space:
mode:
Diffstat (limited to 'test/command_callback/test_cppcheck_command_callbacks.vader')
-rw-r--r--test/command_callback/test_cppcheck_command_callbacks.vader40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/command_callback/test_cppcheck_command_callbacks.vader b/test/command_callback/test_cppcheck_command_callbacks.vader
new file mode 100644
index 00000000..665b4f13
--- /dev/null
+++ b/test/command_callback/test_cppcheck_command_callbacks.vader
@@ -0,0 +1,40 @@
+Before:
+ silent! cd /testplugin/test/command_callback
+ let b:dir = getcwd()
+
+After:
+ silent execute 'cd ' . fnameescape(b:dir)
+ unlet! b:dir
+ call ale#linter#Reset()
+
+Execute(The default C cppcheck command should be correct):
+ runtime ale_linters/c/cppcheck.vim
+
+ AssertEqual
+ \ 'cppcheck -q --language=c --enable=style %t',
+ \ ale_linters#c#cppcheck#GetCommand(bufnr(''))
+
+Execute(cppcheck for C should detect compile_commands.json files):
+ runtime ale_linters/c/cppcheck.vim
+ cd cppcheck_paths/one
+
+ AssertEqual
+ \ 'cd ' . fnameescape(b:dir . '/cppcheck_paths/one') . ' && '
+ \ . 'cppcheck -q --language=c --project=compile_commands.json --enable=style %t',
+ \ ale_linters#c#cppcheck#GetCommand(bufnr(''))
+
+Execute(The default C++ cppcheck command should be correct):
+ runtime ale_linters/cpp/cppcheck.vim
+
+ AssertEqual
+ \ 'cppcheck -q --language=c++ --enable=style %t',
+ \ ale_linters#cpp#cppcheck#GetCommand(bufnr(''))
+
+Execute(cppcheck for C++ should detect compile_commands.json files):
+ runtime ale_linters/cpp/cppcheck.vim
+ cd cppcheck_paths/one
+
+ AssertEqual
+ \ 'cd ' . fnameescape(b:dir . '/cppcheck_paths/one') . ' && '
+ \ . 'cppcheck -q --language=c++ --project=compile_commands.json --enable=style %t',
+ \ ale_linters#cpp#cppcheck#GetCommand(bufnr(''))