All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 " Author: Ye Jingchen <ye.jingchen@gmail.com>, Ben Falconer <ben@falconers.me.uk>
2 " Description: A language server for C++
5 call ale#assert#SetUpLinterTest('cpp', 'ccls')
7 Save b:ale_c_build_dir_names
8 Save b:ale_cpp_ccls_executable
9 Save b:ale_cpp_ccls_init_options
12 call ale#assert#TearDownLinterTest()
14 Execute(The project root should be detected correctly using compile_commands.json file):
15 call ale#test#SetFilename(tempname() . '/dummy.cpp')
19 call ale#test#SetFilename('../test-files/ccls/with_compile_commands_json/dummy.cpp')
21 AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/ccls/with_compile_commands_json')
23 Execute(The project root should be detected correctly using .ccls file):
24 call ale#test#SetFilename(tempname() . '/dummy.cpp')
28 call ale#test#SetFilename('../test-files/ccls/with_ccls/dummy.cpp')
30 AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/ccls/with_ccls')
32 Execute(The project root should be detected correctly using .ccls-root file):
33 call ale#test#SetFilename(tempname() . '/dummy.cpp')
37 call ale#test#SetFilename('../test-files/ccls/with_ccls-root/dummy.cpp')
39 AssertLSPProject ale#path#Simplify(g:dir . '/../test-files/ccls/with_ccls-root')
41 Execute(The executable should be configurable):
42 AssertLinter 'ccls', ale#Escape('ccls')
44 let b:ale_cpp_ccls_executable = 'foobar'
46 AssertLinter 'foobar', ale#Escape('foobar')
48 Execute(The initialization options should be configurable):
51 let b:ale_cpp_ccls_init_options = { 'cacheDirectory': '/tmp/ccls' }
53 AssertLSPOptions { 'cacheDirectory': '/tmp/ccls' }
55 Execute(The compile command database should be detected correctly):
56 call ale#test#SetFilename('../test-files/ccls/with_ccls/dummy.c')
60 call ale#test#SetFilename('../test-files/ccls/with_compile_commands_json/dummy.c')
62 AssertLSPOptions { 'compilationDatabaseDirectory':
63 \ ale#path#Simplify(g:dir . '/../test-files/ccls/with_compile_commands_json') }
65 call ale#test#SetFilename('../test-files/ccls/with_build_dir/dummy.c')
66 let b:ale_c_build_dir_names = ['unusual_build_dir_name']
68 AssertLSPOptions { 'compilationDatabaseDirectory':
69 \ ale#path#Simplify(g:dir . '/../test-files/ccls/with_build_dir/unusual_build_dir_name') }