summaryrefslogtreecommitdiff
path: root/test/command_callback/test_javac_command_callback.vader
diff options
context:
space:
mode:
authorw0rp <devw0rp@gmail.com>2018-04-08 20:35:06 +0100
committerw0rp <devw0rp@gmail.com>2018-04-08 20:35:06 +0100
commit2f2dcb84444f440ceb4b35010b861738216525f6 (patch)
tree84846332d36a0fac6beb3ede5117933d3ce954c6 /test/command_callback/test_javac_command_callback.vader
parent7cf3ddf6c4354db406a19104f352565d42a827d2 (diff)
downloadale-2f2dcb84444f440ceb4b35010b861738216525f6.zip
Close #1476 - Make the javac executable configurable
Diffstat (limited to 'test/command_callback/test_javac_command_callback.vader')
-rw-r--r--test/command_callback/test_javac_command_callback.vader24
1 files changed, 19 insertions, 5 deletions
diff --git a/test/command_callback/test_javac_command_callback.vader b/test/command_callback/test_javac_command_callback.vader
index 7823d030..b0d0e7c7 100644
--- a/test/command_callback/test_javac_command_callback.vader
+++ b/test/command_callback/test_javac_command_callback.vader
@@ -1,9 +1,11 @@
Before:
call ale#test#SetDirectory('/testplugin/test/command_callback')
+ Save g:ale_java_javac_executable
Save g:ale_java_javac_options
Save g:ale_java_javac_classpath
+ unlet! g:ale_java_javac_executable
unlet! g:ale_java_javac_options
unlet! g:ale_java_javac_classpath
@@ -28,7 +30,8 @@ Before:
call ale#test#SetFilename('dummy.java')
- let g:prefix = 'cd ' . ale#Escape(expand('%:p:h')) . ' && javac -Xlint'
+ let g:prefix = 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
+ \ . ale#Escape('javac') . ' -Xlint'
After:
call ale#test#RestoreDirectory()
@@ -57,6 +60,17 @@ Execute(The javac callback should use g:ale_java_javac_classpath correctly):
\ . ' -d TEMP %t',
\ GetCommand([])
+Execute(The executable should be configurable):
+ let g:ale_java_javac_executable = 'foobar'
+
+ AssertEqual 'foobar', ale_linters#java#javac#GetExecutable(bufnr(''))
+
+ AssertEqual
+ \ 'cd ' . ale#Escape(expand('%:p:h')) . ' && '
+ \ . ale#Escape('foobar') . ' -Xlint'
+ \ . ' -d TEMP %t',
+ \ GetCommand([])
+
Execute(The javac callback should include discovered classpaths):
AssertEqual
\ g:prefix
@@ -120,7 +134,7 @@ Execute(The javac callback should detect source directories):
call ale#engine#InitBufferInfo(bufnr(''))
AssertEqual
- \ 'cd ' . ale#Escape(expand('%:p:h')) . ' && javac -Xlint'
+ \ 'cd ' . ale#Escape(expand('%:p:h')) . ' && ' . ale#Escape('javac') . ' -Xlint'
\ . ' -sourcepath ' . ale#Escape(
\ ale#path#Simplify(g:dir . '/java_paths/src/main/java/')
\ )
@@ -133,7 +147,7 @@ Execute(The javac callback should combine detected source directories and classp
call ale#engine#InitBufferInfo(bufnr(''))
AssertEqual
- \ 'cd ' . ale#Escape(expand('%:p:h')) . ' && javac -Xlint'
+ \ 'cd ' . ale#Escape(expand('%:p:h')) . ' && ' . ale#Escape('javac') . ' -Xlint'
\ . ' -cp ' . ale#Escape(join(['/foo/bar.jar', '/xyz/abc.jar'], g:cp_sep))
\ . ' -sourcepath ' . ale#Escape(
\ ale#path#Simplify(g:dir . '/java_paths/src/main/java/')
@@ -164,7 +178,7 @@ Execute(The javac callback should include src/test/java for test paths):
call ale#engine#InitBufferInfo(bufnr(''))
AssertEqual
- \ 'cd ' . ale#Escape(expand('%:p:h')) . ' && javac -Xlint'
+ \ 'cd ' . ale#Escape(expand('%:p:h')) . ' && ' . ale#Escape('javac') . ' -Xlint'
\ . ' -sourcepath ' . ale#Escape(join([
\ ale#path#Simplify(g:dir . '/java_paths/src/main/java/'),
\ ale#path#Simplify(g:dir . '/java_paths/src/test/java/'),
@@ -178,7 +192,7 @@ Execute(The javac callback should include src/main/jaxb when available):
call ale#engine#InitBufferInfo(bufnr(''))
AssertEqual
- \ 'cd ' . ale#Escape(expand('%:p:h')) . ' && javac -Xlint'
+ \ 'cd ' . ale#Escape(expand('%:p:h')) . ' && ' . ale#Escape('javac') . ' -Xlint'
\ . ' -sourcepath ' . ale#Escape(join([
\ ale#path#Simplify(g:dir . '/java_paths_with_jaxb/src/main/java/'),
\ ale#path#Simplify(g:dir . '/java_paths_with_jaxb/src/main/jaxb/'),