summaryrefslogtreecommitdiff
path: root/test/command_callback/test_glslang_command_callback.vader
blob: 9d406834fc7d849659a19a6d8f5078fe09384190 (plain)
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
35
36
37
38
39
40
41
42
Before:
  Save g:ale_glsl_glslang_executable
  Save g:ale_glsl_glslang_options

  unlet! g:ale_glsl_glslang_executable
  unlet! g:ale_glsl_glslang_options

  runtime ale_linters/glsl/glslang.vim
  call ale#test#SetDirectory('/testplugin/test/command_callback')

After:
  Restore
  unlet! g:ale_cuda_nvcc_executable
  unlet! g:ale_cuda_nvcc_options
  call ale#linter#Reset()

Execute(Executable should default to glslangValidator):
  AssertEqual
  \ 'glslangValidator',
  \ ale_linters#glsl#glslang#GetExecutable(bufnr(''))

Execute(Executable should be configurable):
  let g:ale_glsl_glslang_executable = 'foobar'
  AssertEqual
  \ 'foobar',
  \ ale_linters#glsl#glslang#GetExecutable(bufnr(''))

Execute(Command should use executable):
  AssertEqual
  \ 'glslangValidator  -C %t',
  \ ale_linters#glsl#glslang#GetCommand(bufnr(''))

  let g:ale_glsl_glslang_executable = 'foobar'
  AssertEqual
  \ 'foobar  -C %t',
  \ ale_linters#glsl#glslang#GetCommand(bufnr(''))

Execute(Options should work):
  let g:ale_glsl_glslang_options = '--test'
  AssertEqual
  \ 'glslangValidator --test -C %t',
  \ ale_linters#glsl#glslang#GetCommand(bufnr(''))