diff options
author | Ye Jingchen <ye.jingchen@gmail.com> | 2018-09-26 22:50:43 +0800 |
---|---|---|
committer | Ye Jingchen <ye.jingchen@gmail.com> | 2018-09-26 22:50:43 +0800 |
commit | 626e47f5c9c3c86fef56020bedae996e8b026a9f (patch) | |
tree | 6a4de28361f6bf3e6e2f5a76fee881cafef2d7e0 /test/command_callback | |
parent | 56658fd3ada284a373afffb49b0ec2d66ad00445 (diff) | |
download | ale-626e47f5c9c3c86fef56020bedae996e8b026a9f.zip |
Add ccls tests
Diffstat (limited to 'test/command_callback')
4 files changed, 126 insertions, 0 deletions
diff --git a/test/command_callback/ccls_paths/with_compile_commands_json/compile_commands.json b/test/command_callback/ccls_paths/with_compile_commands_json/compile_commands.json new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/test/command_callback/ccls_paths/with_compile_commands_json/compile_commands.json diff --git a/test/command_callback/test_c_ccls_command_callbacks.vader b/test/command_callback/test_c_ccls_command_callbacks.vader new file mode 100644 index 00000000..b8f3ab5b --- /dev/null +++ b/test/command_callback/test_c_ccls_command_callbacks.vader @@ -0,0 +1,43 @@ +" Author: Ye Jingchen <ye.jingchen@gmail.com>, Ben Falconer <ben@falconers.me.uk> +" Description: A language server for C + +Before: + call ale#assert#SetUpLinterTest('c', 'ccls') + +After: + call ale#assert#TearDownLinterTest() + +Execute(The project root should be detected correctly using compile_commands.json file): + AssertLSPProject '' + + call ale#test#SetFilename('ccls_paths/with_compile_commands_json/dummy.c') + + AssertLSPProject ale#path#Simplify(g:dir . '/ccls_paths/with_compile_commands_json') + +Execute(The project root should be detected correctly using .ccls file): + AssertLSPProject '' + + call ale#test#SetFilename('ccls_paths/with_ccls/dummy.c') + + AssertLSPProject ale#path#Simplify(g:dir . '/ccls_paths/with_ccls') + +Execute(The project root should be detected correctly using .ccls-root file): + AssertLSPProject '' + + call ale#test#SetFilename('ccls_paths/with_ccls-root/dummy.c') + + AssertLSPProject ale#path#Simplify(g:dir . '/ccls_paths/with_ccls-root') + +Execute(The executable should be configurable): + AssertLinter 'ccls', ale#Escape('ccls') + + let b:ale_c_ccls_executable = 'foobar' + + AssertLinter 'foobar', ale#Escape('foobar') + +Execute(The initialization options should be configurable): + AssertLSPOptions {} + + let b:ale_c_ccls_init_options = { 'cacheDirectory': '/tmp/ccls' } + + AssertLSPOptions { 'cacheDirectory': '/tmp/ccls' } diff --git a/test/command_callback/test_cpp_ccls_command_callbacks.vader b/test/command_callback/test_cpp_ccls_command_callbacks.vader new file mode 100644 index 00000000..38947acf --- /dev/null +++ b/test/command_callback/test_cpp_ccls_command_callbacks.vader @@ -0,0 +1,43 @@ +" Author: Ye Jingchen <ye.jingchen@gmail.com>, Ben Falconer <ben@falconers.me.uk> +" Description: A language server for C++ + +Before: + call ale#assert#SetUpLinterTest('cpp', 'ccls') + +After: + call ale#assert#TearDownLinterTest() + +Execute(The project root should be detected correctly using compile_commands.json file): + AssertLSPProject '' + + call ale#test#SetFilename('ccls_paths/with_compile_commands_json/dummy.cpp') + + AssertLSPProject ale#path#Simplify(g:dir . '/ccls_paths/with_compile_commands_json') + +Execute(The project root should be detected correctly using .ccls file): + AssertLSPProject '' + + call ale#test#SetFilename('ccls_paths/with_ccls/dummy.cpp') + + AssertLSPProject ale#path#Simplify(g:dir . '/ccls_paths/with_ccls') + +Execute(The project root should be detected correctly using .ccls-root file): + AssertLSPProject '' + + call ale#test#SetFilename('ccls_paths/with_ccls-root/dummy.cpp') + + AssertLSPProject ale#path#Simplify(g:dir . '/ccls_paths/with_ccls-root') + +Execute(The executable should be configurable): + AssertLinter 'ccls', ale#Escape('ccls') + + let b:ale_cpp_ccls_executable = 'foobar' + + AssertLinter 'foobar', ale#Escape('foobar') + +Execute(The initialization options should be configurable): + AssertLSPOptions {} + + let b:ale_cpp_ccls_init_options = { 'cacheDirectory': '/tmp/ccls' } + + AssertLSPOptions { 'cacheDirectory': '/tmp/ccls' } diff --git a/test/command_callback/test_objc_ccls_command_callbacks.vader b/test/command_callback/test_objc_ccls_command_callbacks.vader new file mode 100644 index 00000000..9d0c7690 --- /dev/null +++ b/test/command_callback/test_objc_ccls_command_callbacks.vader @@ -0,0 +1,40 @@ +Before: + call ale#assert#SetUpLinterTest('objc', 'ccls') + +After: + call ale#assert#TearDownLinterTest() + +Execute(The project root should be detected correctly using compile_commands.json file): + AssertLSPProject '' + + call ale#test#SetFilename('ccls_paths/with_compile_commands_json/dummy.m') + + AssertLSPProject ale#path#Simplify(g:dir . '/ccls_paths/with_compile_commands_json') + +Execute(The project root should be detected correctly using .ccls file): + AssertLSPProject '' + + call ale#test#SetFilename('ccls_paths/with_ccls/dummy.m') + + AssertLSPProject ale#path#Simplify(g:dir . '/ccls_paths/with_ccls') + +Execute(The project root should be detected correctly using .ccls-root file): + AssertLSPProject '' + + call ale#test#SetFilename('ccls_paths/with_ccls-root/dummy.m') + + AssertLSPProject ale#path#Simplify(g:dir . '/ccls_paths/with_ccls-root') + +Execute(The executable should be configurable): + AssertLinter 'ccls', ale#Escape('ccls') + + let b:ale_objc_ccls_executable = 'foobar' + + AssertLinter 'foobar', ale#Escape('foobar') + +Execute(The initialization options should be configurable): + AssertLSPOptions {} + + let b:ale_objc_ccls_init_options = { 'cacheDirectory': '/tmp/ccls' } + + AssertLSPOptions { 'cacheDirectory': '/tmp/ccls' } |