test: add more debuggings tips [ci skip] (#9761)

Mention the common press-enter issue and how to visualize the screen.
This commit is contained in:
Marco Hinz 2019-03-19 17:44:35 +01:00 committed by GitHub
parent 24d7513dc4
commit f282324e1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,10 +88,25 @@ To run a *single* legacy test set `TEST_FILE`, for example:
Debugging tests Debugging tests
--------------- ---------------
You can set `$GDB` to [run tests under gdbserver](https://github.com/neovim/neovim/pull/1527). - You can set `$GDB` to [run tests under gdbserver](https://github.com/neovim/neovim/pull/1527).
And if `$VALGRIND` is set it will pass `--vgdb=yes` to valgrind instead of And if `$VALGRIND` is set it will pass `--vgdb=yes` to valgrind instead of
starting gdbserver directly. starting gdbserver directly.
- Hanging tests often happen due to unexpected `:h press-enter` prompts. The
default screen width is 50 columns. Commands that try to print lines longer
than 50 columns in the command-line, e.g. `:edit very...long...path`, will
trigger the prompt. In this case, a shorter path or `:silent edit` should be
used.
- If you can't figure out what is going on, try to visualize the screen. Put
this at the beginning of your test:
```lua
local Screen = require('test.functional.ui.screen')
local screen = Screen.new()
screen:attach()
```
Afterwards, put `screen:snapshot_util()` at any position in your test. See the
comment at the top of `test/functional/ui/screen.lua` for more.
Filtering Tests Filtering Tests
--------------- ---------------