ale/test/command_callback/test_glslang_command_callback.vader
Sven-Hendrik Haase ff28836616 Add GLSL linter using glslang (#914)
* Add a glslang linter for GLSL
2017-09-08 11:06:47 +01:00

43 lines
1.1 KiB
Plaintext

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(''))