diff options
author | w0rp <w0rp@users.noreply.github.com> | 2018-11-19 19:36:32 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-19 19:36:32 +0000 |
commit | 4b4b09593b2b090282981d69a9647a3c91d1f8b9 (patch) | |
tree | 931d50082b2eef3affd7a5d9fafa7dbe02a5459a /test/command_callback | |
parent | f538bb440a8d9e5f607fe7a8d54f7862537586d9 (diff) | |
parent | d90673ab5b40ec1ef79ab9e3eb0b1b7012425701 (diff) | |
download | ale-4b4b09593b2b090282981d69a9647a3c91d1f8b9.zip |
Merge pull request #2087 from m-pilia/ada
Add GCC linter for Ada
Diffstat (limited to 'test/command_callback')
-rw-r--r-- | test/command_callback/test_ada_gcc_command_callbacks.vader | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/test/command_callback/test_ada_gcc_command_callbacks.vader b/test/command_callback/test_ada_gcc_command_callbacks.vader new file mode 100644 index 00000000..de6e355e --- /dev/null +++ b/test/command_callback/test_ada_gcc_command_callbacks.vader @@ -0,0 +1,44 @@ +Before: + call ale#assert#SetUpLinterTest('ada', 'gcc') + call ale#test#SetFilename('dummy.adb') + + function! GetOutputDir(command) abort + let l:split_command = split(a:command) + let l:index = index(l:split_command, '-o') + return l:split_command[l:index + 1] + endfunction + + let b:out_file = GetOutputDir(ale_linters#ada#gcc#GetCommand(bufnr(''))) + +After: + delfunction GetOutputDir + + unlet! b:out_file + + call ale#assert#TearDownLinterTest() + +Execute(The executable should be configurable): + + AssertLinter 'gcc', + \ ale#Escape('gcc') . ' -x ada -c -gnatc' + \ . ' -o ' . b:out_file + \ . ' -I ' . ale#Escape(getcwd()) + \ . ' -gnatwa -gnatq %t' + + let b:ale_ada_gcc_executable = 'foo' + + AssertLinter 'foo', + \ ale#Escape('foo') . ' -x ada -c -gnatc' + \ . ' -o ' . b:out_file + \ . ' -I ' . ale#Escape(getcwd()) + \ . ' -gnatwa -gnatq %t' + +Execute(The options should be configurable): + + let g:ale_ada_gcc_options = '--foo --bar' + + AssertLinter 'gcc', + \ ale#Escape('gcc') . ' -x ada -c -gnatc' + \ . ' -o ' . b:out_file + \ . ' -I ' . ale#Escape(getcwd()) + \ . ' --foo --bar %t' |