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.
2 " Make sure the c.vim file is loaded first.
3 call ale#c#FindProjectRoot(bufnr(''))
5 Save g:ale_c_parse_compile_commands
6 Save g:ale_c_parse_makefile
7 Save g:__ale_c_project_filenames
9 let g:original_project_filenames = g:__ale_c_project_filenames
10 let g:executable_map = {}
12 " Remove the .git/HEAD dir for C import paths for these tests.
13 " The tests run inside of a git repo.
14 let g:__ale_c_project_filenames = filter(
15 \ copy(g:__ale_c_project_filenames),
16 \ 'v:val isnot# ''.git/HEAD'''
19 let g:ale_c_parse_compile_commands = 0
20 let g:ale_c_parse_makefile = 0
22 runtime autoload/ale/engine.vim
24 function! ale#engine#IsExecutable(buffer, executable) abort
25 return has_key(g:executable_map, a:executable)
31 unlet! g:original_project_filenames
32 unlet! g:executable_map
34 runtime autoload/ale/engine.vim
36 call ale#assert#TearDownLinterTest()
38 Execute(The C cc linter should include 'include' directories for projects with a Makefile):
39 call ale#assert#SetUpLinterTest('c', 'cc')
40 call ale#test#SetFilename('../test-files/c/makefile_project/subdir/file.c')
41 let g:ale_c_cc_options = ''
45 \ . ' -S -x c -o ' . (has('win32') ? 'nul': '/dev/null')
47 \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/c/makefile_project/include'))
50 Execute(The C cc linter should include 'include' directories for projects with a configure file):
51 call ale#assert#SetUpLinterTest('c', 'cc')
52 call ale#test#SetFilename('../test-files/c/configure_project/subdir/file.c')
53 let g:ale_c_cc_options = ''
57 \ . ' -S -x c -o ' . (has('win32') ? 'nul': '/dev/null')
59 \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/c/configure_project/include'))
62 Execute(The C cc linter should include root directories for projects with .h files in them):
63 call ale#assert#SetUpLinterTest('c', 'cc')
64 call ale#test#SetFilename('../test-files/c/h_file_project/subdir/file.c')
65 let g:ale_c_cc_options = ''
69 \ . ' -S -x c -o ' . (has('win32') ? 'nul': '/dev/null')
71 \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/c/h_file_project'))
74 Execute(The C cc linter should include root directories for projects with .hpp files in them):
75 call ale#assert#SetUpLinterTest('c', 'cc')
76 call ale#test#SetFilename('../test-files/c/hpp_file_project/subdir/file.c')
77 let g:ale_c_cc_options = ''
81 \ . ' -S -x c -o ' . (has('win32') ? 'nul': '/dev/null')
83 \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/c/hpp_file_project'))
86 Execute(The C ClangTidy handler should include 'include' directories for projects with a Makefile):
87 call ale#assert#SetUpLinterTest('c', 'clangtidy')
88 call ale#test#SetFilename('../test-files/c/makefile_project/subdir/file.cpp')
89 let g:ale_c_clangtidy_options = ''
91 AssertLinter 'clang-tidy',
92 \ ale#Escape('clang-tidy')
94 \ . '-- -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/c/makefile_project/include'))
96 Execute(The C++ cc linter should include 'include' directories for projects with a Makefile):
97 call ale#assert#SetUpLinterTest('cpp', 'cc')
98 call ale#test#SetFilename('../test-files/c/makefile_project/subdir/file.cpp')
99 let g:ale_cpp_cc_options = ''
103 \ . ' -S -x c++ -o ' . (has('win32') ? 'nul': '/dev/null')
105 \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/c/makefile_project/include'))
108 Execute(The C++ cc linter should include 'include' directories for projects with a configure file):
109 call ale#assert#SetUpLinterTest('cpp', 'cc')
110 call ale#test#SetFilename('../test-files/c/configure_project/subdir/file.cpp')
111 let g:ale_cpp_cc_options = ''
115 \ . ' -S -x c++ -o ' . (has('win32') ? 'nul': '/dev/null')
117 \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/c/configure_project/include'))
120 Execute(The C++ cc linter should include root directories for projects with .h files in them):
121 call ale#assert#SetUpLinterTest('cpp', 'cc')
122 call ale#test#SetFilename('../test-files/c/h_file_project/subdir/file.cpp')
123 let g:ale_cpp_cc_options = ''
127 \ . ' -S -x c++ -o ' . (has('win32') ? 'nul': '/dev/null')
129 \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/c/h_file_project'))
132 Execute(The C++ cc linter should include root directories for projects with .hpp files in them):
133 call ale#assert#SetUpLinterTest('cpp', 'cc')
134 call ale#test#SetFilename('../test-files/c/hpp_file_project/subdir/file.cpp')
135 let g:ale_cpp_cc_options = ''
139 \ . ' -S -x c++ -o ' . (has('win32') ? 'nul': '/dev/null')
141 \ . ' -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/c/hpp_file_project'))
144 Execute(The C++ ClangTidy handler should include json folders for projects with suitable build directory in them):
145 call ale#assert#SetUpLinterTest('cpp', 'clangtidy')
146 call ale#test#SetFilename('../test-files/c/json_project/subdir/file.cpp')
148 AssertLinter 'clang-tidy',
149 \ ale#Escape('clang-tidy')
151 \ . '-p ' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/c/json_project/build'))
153 Execute(The C++ ClangTidy handler should include 'include' directories for projects with a Makefile):
154 call ale#assert#SetUpLinterTest('cpp', 'clangtidy')
155 call ale#test#SetFilename('../test-files/c/makefile_project/subdir/file.cpp')
156 let g:ale_cpp_clangtidy_options = ''
158 AssertLinter 'clang-tidy',
159 \ ale#Escape('clang-tidy')
161 \ . '-- -I' . ale#Escape(ale#path#Simplify(g:dir . '/../test-files/c/makefile_project/include'))