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
2
.github/workflows/build.yaml
vendored
2
.github/workflows/build.yaml
vendored
|
|
@ -86,7 +86,7 @@ jobs:
|
||||||
- run: |
|
- run: |
|
||||||
brew update-reset
|
brew update-reset
|
||||||
brew doctor || true
|
brew doctor || true
|
||||||
for p in macvim tcl-tk llvm; do
|
for p in macvim tcl-tk llvm lua luajit love; do
|
||||||
brew install $p
|
brew install $p
|
||||||
brew outdated $p || brew upgrade $p
|
brew outdated $p || brew upgrade $p
|
||||||
done
|
done
|
||||||
|
|
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -6,6 +6,7 @@ tests/*.res
|
||||||
tests/messages
|
tests/messages
|
||||||
tests/debuglog
|
tests/debuglog
|
||||||
test.log
|
test.log
|
||||||
|
*.testlog
|
||||||
gadgets/
|
gadgets/
|
||||||
package/
|
package/
|
||||||
*.pyc
|
*.pyc
|
||||||
|
|
|
||||||
|
|
@ -141,10 +141,10 @@ runtime dependencies). They are categorised by their level of support:
|
||||||
| Go | Tested | `--enable-go` | vscode-go | Go, [Delve][] |
|
| Go | Tested | `--enable-go` | vscode-go | Go, [Delve][] |
|
||||||
| TCL | Supported | `--all` or `--enable-tcl` | tclpro | TCL 8.5 |
|
| TCL | Supported | `--all` or `--enable-tcl` | tclpro | TCL 8.5 |
|
||||||
| Bourne Shell | Supported | `--all` or `--enable-bash` | vscode-bash-debug | Bash v?? |
|
| Bourne Shell | Supported | `--all` or `--enable-bash` | vscode-bash-debug | Bash v?? |
|
||||||
|
| Lua | Supported | `--all` or `--enable-lua` | local-lua-debugger-vscode | Node >=12.13.0, Npm, Lua interpreter |
|
||||||
| Node.js | Supported | `--force-enable-node` | vscode-node-debug2 | 6 < Node < 12, Npm |
|
| Node.js | Supported | `--force-enable-node` | vscode-node-debug2 | 6 < Node < 12, Npm |
|
||||||
| Javascript | Supported | `--force-enable-chrome` | debugger-for-chrome | Chrome |
|
| Javascript | Supported | `--force-enable-chrome` | debugger-for-chrome | Chrome |
|
||||||
| Java | Supported | `--force-enable-java ` | vscode-java-debug | Compatible LSP plugin (see [later](#java)) |
|
| Java | Supported | `--force-enable-java ` | vscode-java-debug | Compatible LSP plugin (see [later](#java)) |
|
||||||
| Lua | Supported | `--force-enable-lua` | local-lua-debugger-vscode | Node, Npm, Lua interpreter |
|
|
||||||
| C# (dotnet core) | Experimental | `--force-enable-csharp` | netcoredbg | DotNet core |
|
| C# (dotnet core) | Experimental | `--force-enable-csharp` | netcoredbg | DotNet core |
|
||||||
| C# (mono) | Experimental | `--force-enable-csharp` | vscode-mono-debug | Mono |
|
| C# (mono) | Experimental | `--force-enable-csharp` | vscode-mono-debug | Mono |
|
||||||
| Python.legacy | Legacy | `--force-enable-python.legacy` | vscode-python | Node 10, Python 2.7 or Python 3 |
|
| Python.legacy | Legacy | `--force-enable-python.legacy` | vscode-python | Node 10, Python 2.7 or Python 3 |
|
||||||
|
|
@ -1419,7 +1419,7 @@ Lua is supported through
|
||||||
This debugger uses stdio to communicate with the running process, so calls to
|
This debugger uses stdio to communicate with the running process, so calls to
|
||||||
`io.read` will cause problems.
|
`io.read` will cause problems.
|
||||||
|
|
||||||
* `./install_gadget.py --force-enable-lua` or `:VimspectorInstall local-lua-debugger-vscode`
|
* `./install_gadget.py --enable-lua` or `:VimspectorInstall local-lua-debugger-vscode`
|
||||||
* Examples: `support/test/lua/simple` and `support/test/lua/love`
|
* Examples: `support/test/lua/simple` and `support/test/lua/love`
|
||||||
|
|
||||||
```json
|
```json
|
||||||
|
|
|
||||||
|
|
@ -497,10 +497,10 @@ GADGETS = {
|
||||||
},
|
},
|
||||||
'local-lua-debugger-vscode': {
|
'local-lua-debugger-vscode': {
|
||||||
'language': 'lua',
|
'language': 'lua',
|
||||||
'enabled': False,
|
'enabled': True,
|
||||||
'repo': {
|
'repo': {
|
||||||
'url': 'https://github.com/tomblind/local-lua-debugger-vscode.git',
|
'url': 'https://github.com/tomblind/local-lua-debugger-vscode.git',
|
||||||
'ref': 'release-0.2.0'
|
'ref': 'release-${version}'
|
||||||
},
|
},
|
||||||
'all': {
|
'all': {
|
||||||
'version': '0.2.0',
|
'version': '0.2.0',
|
||||||
|
|
|
||||||
17
support/test/lua/love-headless/.vimspector.json
Normal file
17
support/test/lua/love-headless/.vimspector.json
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://puremourning.github.io/vimspector/schema/vimspector.schema.json#",
|
||||||
|
"configurations": {
|
||||||
|
"love": {
|
||||||
|
"adapter": "lua-local",
|
||||||
|
"configuration": {
|
||||||
|
"request": "launch",
|
||||||
|
"type": "lua-local",
|
||||||
|
"cwd": "${workspaceFolder}",
|
||||||
|
"program": {
|
||||||
|
"command": "love"
|
||||||
|
},
|
||||||
|
"args": ["${workspaceFolder}"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
12
support/test/lua/love-headless/conf.lua
Normal file
12
support/test/lua/love-headless/conf.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
function love.conf(t)
|
||||||
|
t.modules.audio = false
|
||||||
|
t.modules.font = false
|
||||||
|
t.modules.graphics = false
|
||||||
|
t.modules.image = false
|
||||||
|
t.modules.mouse = false
|
||||||
|
t.modules.physics = false
|
||||||
|
t.modules.sound = false
|
||||||
|
t.modules.touch = false
|
||||||
|
t.modules.video = false
|
||||||
|
t.modules.window = false
|
||||||
|
end
|
||||||
10
support/test/lua/love-headless/main.lua
Normal file
10
support/test/lua/love-headless/main.lua
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
if pcall(require, 'lldebugger') then
|
||||||
|
require('lldebugger').start()
|
||||||
|
end
|
||||||
|
|
||||||
|
local time = 0
|
||||||
|
|
||||||
|
function love.update(dt)
|
||||||
|
time = time + dt
|
||||||
|
love.event.quit()
|
||||||
|
end
|
||||||
|
|
@ -4,6 +4,11 @@ ENV DEBIAN_FRONTEND=noninteractive
|
||||||
ENV LC_ALL C.UTF-8
|
ENV LC_ALL C.UTF-8
|
||||||
|
|
||||||
RUN apt-get update && \
|
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 dist-upgrade && \
|
||||||
apt-get -y install python3-dev \
|
apt-get -y install python3-dev \
|
||||||
python3-pip \
|
python3-pip \
|
||||||
|
|
@ -17,9 +22,10 @@ RUN apt-get update && \
|
||||||
tcllib \
|
tcllib \
|
||||||
gdb \
|
gdb \
|
||||||
lldb \
|
lldb \
|
||||||
curl \
|
|
||||||
nodejs \
|
nodejs \
|
||||||
npm && \
|
lua5.1 \
|
||||||
|
luajit \
|
||||||
|
love && \
|
||||||
apt-get -y autoremove
|
apt-get -y autoremove
|
||||||
|
|
||||||
RUN ln -fs /usr/share/zoneinfo/Europe/London /etc/localtime && \
|
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