aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/test/test_c_find_compile_commands.vader
blob: 204f81f782db49567b01497934101d8b219ea3ea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
Before:
  runtime autoload/ale/c.vim
  Save g:ale_c_build_dir_names

  call ale#test#SetDirectory('/testplugin/test')

After:
  Restore

  call ale#test#RestoreDirectory()

Execute(FindCompileCommands should find compile_commands.json with relative build dir names):
  call ale#test#SetFilename('test-files/c/json_project/subdir/dummy')

  let g:ale_c_build_dir_names = ['build']

  AssertEqual
  \ [
  \   ale#path#Simplify(g:dir . '/test-files/c/json_project'),
  \   ale#path#Simplify(g:dir . '/test-files/c/json_project/build/compile_commands.json'),
  \ ],
  \ ale#c#FindCompileCommands(bufnr(''))

Execute(FindCompileCommands should find compile_commands.json with absolute build dir names):
  call ale#test#SetFilename('test-files/c/json_project/subdir/dummy')

  let g:ale_c_build_dir_names = [ale#path#Simplify(g:dir . '/test-files/c/json_project/build')]

  AssertEqual
  \ [
  \   ale#path#Simplify(g:dir . '/test-files/c/json_project'),
  \   ale#path#Simplify(g:dir . '/test-files/c/json_project/build/compile_commands.json'),
  \ ],
  \ ale#c#FindCompileCommands(bufnr(''))