diff options
author | Mathias Fussenegger <f.mathias@zignar.net> | 2024-12-23 12:37:01 +0100 |
---|---|---|
committer | Mathias Fußenegger <mfussenegger@users.noreply.github.com> | 2024-12-24 12:29:39 +0100 |
commit | 34cd94812d42bb6b9ddd54229eb497f660736b4d (patch) | |
tree | 4444af23e471203875f326737814ea2531133e39 /test/functional/testnvim.lua | |
parent | 14ee1de7e58276be4b80bc262cd0435eb9eeb01c (diff) | |
download | rneovim-34cd94812d42bb6b9ddd54229eb497f660736b4d.tar.gz rneovim-34cd94812d42bb6b9ddd54229eb497f660736b4d.tar.bz2 rneovim-34cd94812d42bb6b9ddd54229eb497f660736b4d.zip |
feat(test): support and document lua test case debugging
Similar to how there is a `GDB` environment variable to let the nvim
test instances to be run under `gdbserver` this adds a `OSV_PORT`
variable to start nvim test instances with `osv` in blocking mode to let
a debug client attach to it for debugging of `exec_lua` code blocks.
Diffstat (limited to 'test/functional/testnvim.lua')
-rw-r--r-- | test/functional/testnvim.lua | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/functional/testnvim.lua b/test/functional/testnvim.lua index 43c38d18c0..675ad9e3d7 100644 --- a/test/functional/testnvim.lua +++ b/test/functional/testnvim.lua @@ -48,6 +48,16 @@ M.nvim_argv = { 'unlet g:colors_name', '--embed', } +if os.getenv('OSV_PORT') then + table.insert(M.nvim_argv, '--cmd') + table.insert( + M.nvim_argv, + string.format( + "lua require('osv').launch({ port = %s, blocking = true })", + os.getenv('OSV_PORT') + ) + ) +end -- Directory containing nvim. M.nvim_dir = M.nvim_prog:gsub('[/\\][^/\\]+$', '') |