summaryrefslogtreecommitdiff
path: root/test/command_callback
diff options
context:
space:
mode:
authorSven-Hendrik Haase <svenstaro@gmail.com>2017-09-08 19:06:47 +0900
committerw0rp <w0rp@users.noreply.github.com>2017-09-08 11:06:47 +0100
commitff288366165804e8956013cca8c1291536cf9707 (patch)
tree1e8957d04b4b3da3680f6b77478acab39018782b /test/command_callback
parent73d031d7eacba95c68287eddb52fb0b73947ba05 (diff)
downloadale-ff288366165804e8956013cca8c1291536cf9707.zip
Add GLSL linter using glslang (#914)
* Add a glslang linter for GLSL
Diffstat (limited to 'test/command_callback')
-rw-r--r--test/command_callback/test_glslang_command_callback.vader42
1 files changed, 42 insertions, 0 deletions
diff --git a/test/command_callback/test_glslang_command_callback.vader b/test/command_callback/test_glslang_command_callback.vader
new file mode 100644
index 00000000..9d406834
--- /dev/null
+++ b/test/command_callback/test_glslang_command_callback.vader
@@ -0,0 +1,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(''))