Add regression tests for lua support
Change Dockerfile to install lua, luajit and love and also to install nodejs 12 needed to build the lua debug adapter. Create the love-headless test in support/test/lua to test love without an x server.
This commit is contained in:
parent
7be6d852c6
commit
85865e0012
9 changed files with 137 additions and 7 deletions
|
|
@ -4,6 +4,11 @@ ENV DEBIAN_FRONTEND=noninteractive
|
|||
ENV LC_ALL C.UTF-8
|
||||
|
||||
RUN apt-get update && \
|
||||
apt install -y curl dirmngr apt-transport-https lsb-release ca-certificates \
|
||||
software-properties-common && \
|
||||
curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
|
||||
add-apt-repository ppa:bartbes/love-stable -y && \
|
||||
apt-get update && \
|
||||
apt-get -y dist-upgrade && \
|
||||
apt-get -y install python3-dev \
|
||||
python3-pip \
|
||||
|
|
@ -17,9 +22,10 @@ RUN apt-get update && \
|
|||
tcllib \
|
||||
gdb \
|
||||
lldb \
|
||||
curl \
|
||||
nodejs \
|
||||
npm && \
|
||||
lua5.1 \
|
||||
luajit \
|
||||
love && \
|
||||
apt-get -y autoremove
|
||||
|
||||
RUN ln -fs /usr/share/zoneinfo/Europe/London /etc/localtime && \
|
||||
|
|
|
|||
84
tests/language_lua.test.vim
Normal file
84
tests/language_lua.test.vim
Normal file
|
|
@ -0,0 +1,84 @@
|
|||
function! SetUp()
|
||||
let g:vimspector_enable_mappings = 'HUMAN'
|
||||
call vimspector#test#setup#SetUpWithMappings( v:none )
|
||||
endfunction
|
||||
|
||||
function! ClearDown()
|
||||
call vimspector#test#setup#ClearDown()
|
||||
endfunction
|
||||
|
||||
|
||||
function! BaseTest( configuration )
|
||||
let fn='simple.lua'
|
||||
lcd ../support/test/lua/simple
|
||||
exe 'edit ' . fn
|
||||
|
||||
call vimspector#SetLineBreakpoint( fn, 9 )
|
||||
call vimspector#LaunchWithSettings( { 'configuration': a:configuration } )
|
||||
|
||||
" This debugger is ignoring stopOnEntry when not running a custom executable
|
||||
" and always stopping on the first line after setting the hook. This first
|
||||
" check assumes that behavior.
|
||||
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 5, 1 )
|
||||
call WaitForAssert( {->
|
||||
\ vimspector#test#signs#AssertPCIsAtLineInBuffer( fn, 5 )
|
||||
\ } )
|
||||
" Continue
|
||||
call feedkeys( "\<F5>", 'xt' )
|
||||
|
||||
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 9, 1 )
|
||||
call WaitForAssert( {->
|
||||
\ vimspector#test#signs#AssertPCIsAtLineInBuffer( fn, 9 )
|
||||
\ } )
|
||||
|
||||
" Step
|
||||
call feedkeys( "\<F10>", 'xt' )
|
||||
|
||||
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 10, 1 )
|
||||
call WaitForAssert( {->
|
||||
\ vimspector#test#signs#AssertPCIsAtLineInBuffer( fn, 10 )
|
||||
\ } )
|
||||
|
||||
call vimspector#test#setup#Reset()
|
||||
|
||||
lcd -
|
||||
%bwipeout!
|
||||
endfunction
|
||||
|
||||
|
||||
function! Test_Lua_Simple()
|
||||
call BaseTest( 'lua' )
|
||||
endfunction
|
||||
|
||||
|
||||
function! Test_Lua_Luajit()
|
||||
call BaseTest( 'luajit' )
|
||||
endfunction
|
||||
|
||||
|
||||
function! Test_Lua_Love()
|
||||
let fn='main.lua'
|
||||
lcd ../support/test/lua/love-headless
|
||||
exe 'edit ' . fn
|
||||
|
||||
call vimspector#SetLineBreakpoint( fn, 8 )
|
||||
call vimspector#LaunchWithSettings( { 'configuration': 'love' } )
|
||||
|
||||
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 8, 1 )
|
||||
call WaitForAssert( {->
|
||||
\ vimspector#test#signs#AssertPCIsAtLineInBuffer( fn, 8 )
|
||||
\ } )
|
||||
|
||||
" Step
|
||||
call feedkeys( "\<F10>", 'xt' )
|
||||
|
||||
call vimspector#test#signs#AssertCursorIsAtLineInBuffer( fn, 9, 1 )
|
||||
call WaitForAssert( {->
|
||||
\ vimspector#test#signs#AssertPCIsAtLineInBuffer( fn, 9 )
|
||||
\ } )
|
||||
|
||||
call vimspector#test#setup#Reset()
|
||||
|
||||
lcd -
|
||||
%bwipeout!
|
||||
endfunction
|
||||
Loading…
Add table
Add a link
Reference in a new issue