Commit Graph

50 Commits

Author SHA1 Message Date
AdnoC
f6a82c1d4f test: Fix tests failing 2016-05-17 16:31:56 -04:00
Thiago de Arruda
c18d5917e3 Update lua client to 0.0.1-24
The new version of the lua client uses libmpack as a backend, and some test
scripts had to be updated to reflect that.
2016-04-13 09:21:32 -03:00
Marco Hinz
88da85a3cd Tests: fix according to lualint 2016-02-29 13:48:59 +01:00
ZyX
0409cfded5 functests: Improve screen:expect error reporting 2016-02-28 08:15:52 +03:00
Justin M. Keyes
22a928aeac test: change CI_TARGET reference to CI
Travis defines[1] $CI for its builds, whereas $CI_TARGET is
a Neovim-specific env var from 6483a198e4
that lost prominence in d2eb4a9346.

[1] https://docs.travis-ci.com/user/environment-variables/
2016-01-01 23:58:42 -05:00
Marco Hinz
d9fbc1865b test/functional: clean up according to luacheck (part 2) 2015-11-23 13:57:21 +01:00
Marco Hinz
4a69e55f39 test/functional: clean up according to luacheck (part 1) 2015-11-23 13:57:21 +01:00
ZyX
ec1ca54d59 functests: Do not forget about -i argument
Target: make all tests run with chmod -x ~/.config/nvim ~/.local/share/nvim.
2015-10-23 15:56:51 +03:00
Thiago de Arruda
5d185c7772 test: Add basic tests for the TUI
The tests use `termopen` to spawn nvim and verify the TUI.
2015-10-01 15:22:49 -03:00
Björn Linse
c8aaabc09c api: vim_err_write: add tests for multiline handling 2015-09-16 21:42:57 +02:00
Robin Allen
d5b5063622 Notify attached UIs whenever menus change
This adds a redraw notification "update_menu" which is sent whenever
Vim's menus are changed by the :menu command and friends.
2015-08-21 14:23:50 +01:00
Omar Sandoval
f79025b9de tui: Use underline cursor in Replace mode
This is a port of my original contribution to Vim, added in 7.4.687
(https://github.com/vim/vim/commit/v7-4-687). The TUI code has been
heavily refactored (see esp. 25ceadab37),
so this required some translation, but the logic is the same.
2015-07-26 23:45:41 -04:00
Omar Sandoval
fa48fc667a api: Simplify UI API on mode change
Currently, there are two functions in the UI API that are called when
the mode changes: insert_mode() and normal_mode(). These can be folded
into a single mode_change() entrypoint which can do whatever it wants
based on the mode it is passed, limited to INSERT and NORMAL for now.
2015-07-26 23:38:35 -04:00
Thiago de Arruda
e85c9966b8 test: Increase determinism in screen_basic_spec tests 2015-07-16 23:08:09 -03:00
Lucas Hoffmann
7e7d78b2a6 doc: Fix some typos and trailing whitespace. #2875 2015-06-21 00:34:51 -04:00
Björn Linse
1e7624d2a0 tests/ui: warn when the correct state was seen temporarily.
Helped-by: Thiago de Arruda <tpadilha84@gmail.com>
2015-04-03 09:05:04 -03:00
Björn Linse
e5c4c4bca2 test/ui: add redraw debug util 2015-04-03 09:05:04 -03:00
Thiago de Arruda
2aa2513b8e test: Add terminal tests
- Modify tty-test to allow easier control over the terminal
- Add a new directory with various terminal tests/specifications
- Remove a pending job/pty test.
- Flush stdout in Screen:snapshot_util() (avoid waiting for the test to finish)
- Replace libuv sigwinch watcher by a sigaction handler. libuv randomly fails to
  deliver signals on OSX. Might be related to the problem fixed by
  @bbcddc55ee1e5605657592644be0102ed3a5f104 (under the hoods, libuv uses a pipe
  to deliver signals to the main thread, which might be blocking in some
  situations)
2015-03-25 18:57:36 -03:00
Thiago de Arruda
47e90ea1c5 test: Extract code to spawn nvim into the "spawn" helper function
This is can be used for spawning nvim outside a test context. Also refactor
screen.lua to use this function when loading the color map(It is better because
the GDB/VALGRIND environment variables are ignored)
2015-03-24 12:46:15 -03:00
Thiago de Arruda
8b7b71f474 ui: Refactor so that busy state won't be the default
Even though assuming nvim is busy most times is simpler, it has a problem: A lot
of unnecessary busy_start/busy_stop notifications are sent to the UI. That's
because in the majority of scenarios almost no time is spent between
`event_poll` calls.

This restores the normal behavior which is to call busy_start only when nvim is
going to perform some task that can take a significant amount of time. Also
improve the usage of buffering in the TUI when changing the cursor state.
2015-03-18 14:16:23 -03:00
Thiago de Arruda
5199456471 test: Only display cursor marker in screen tests if nvim is not busy 2015-03-16 08:29:57 -03:00
Thiago de Arruda
c546875daf ui: Replace cursor_{on,off} by busy_{stop,start}
Switching cursor off is only necessary in two occasions:

- When redrawing to avoid terminal flickering
- When the editor is busy

The first can now be handled by the TUI, so most calls to ui_cursor_off can be
removed from the core.

So, before this commit it was only necessary to switch the cursor off to notify
the user that nvim was running some long operation. Now the cursor_{on,off}
functions have been replaced by busy_{stop,start} which can be handled in a
UI-specific way(turning the cursor off or showing a busy indicator, for
example).

To make things even more simpler, nvim is always busy except when waiting for
user input or other asynchronous events: It automatically switches to a non-busy
state when the event loop is about to be entered for more than 100 milliseconds.

`ui_busy_start` can be called when its not desired to change the busy state in
the event loop (As its now done by functions that perform blocking shell
invocations).
2015-03-15 10:30:59 -03:00
Björn Linse
a7aeda8c7a tests/ui: Also test character at cursor 2015-03-09 08:01:49 -03:00
Thiago de Arruda
3baba1e7bc refactor: Remove term modules and termcap options
- Removed term.c, term.h and term_defs.h
- Tests for T_* values were removed. screen.c was simplified as a
  consequence(the best strategy for drawing is implemented in the UI layer)
- Redraw functions now call ui.c functions directly. Updates are flushed with
  `ui_flush()`
- Removed all termcap options(they now return empty strings for compatibility)
- &term/&ttybuiltin options return a constant value(nvim)
- &t_Co is still available, but it mirrors t_colors directly
- Remove cursor tracking from screen.c and the `screen_start` function. Now the
  UI is expected to maintain cursor state across any call, and reset it when
  resized.
- Remove unused code
2015-02-21 05:08:21 -03:00
Thiago de Arruda
aed19a7c5f test: Remove -g flag from pynvim call in Screen.debug
The flag is no longer valid(pynvim always starts a GUI)
2015-02-20 20:38:42 -03:00
Thiago de Arruda
98dca8a827 test: Increase default_screen_timeout when running on travis
Some screen tests such as system/ctrl+c(viml_system_spec.lua) can take some time
to respond(default kill timeout is 2 seconds for an interrupted job) and fail
when running under a slow environment such as travis.
2015-02-16 23:17:38 -03:00
Björn Linse
f468fb70cb api/vim: allow guis and tests to retrieve the entire color table 2015-02-02 14:56:58 -03:00
Björn Linse
ae2b747e64 test/ui: update documentation for screen tests 2015-02-02 14:56:58 -03:00
Björn Linse
b78265e9b7 test/ui: enable strict mode by default (and in existing tests) 2015-02-02 14:56:58 -03:00
Björn Linse
97ac9f5c1d test/ui: more informative "unexpected highlight" errors 2015-02-02 14:56:58 -03:00
Thiago de Arruda
cbc23d93b9 test: Make default screen timeout depend on the VALGRIND env var
While running under valgrind, the screen can take significantly longer to
update(especially on travis) so a higher timeout can be required. Also reduce
the timeout when not running on valgrind.
2015-01-23 19:00:45 -03:00
Thiago de Arruda
41225fe4f6 test: Fix hanging test suite after failures
When a test that fails leaves nvim in a 'Press Enter...' state, the whole suite
will hang because the `qa!` command executed before the next test won't be
processed until '<enter>' is sent.

Now the lua client can send a signal with when `Session:exit()` is called, so
the `qa!` request is no longer necessary.

Also:

- Set noswapfile at startup to prevent tests from leaving .s* swap files(should
  also improve test environment determinism)
- Use `assert(false, msg) instead of `error(msg)` to report screen assertion
  failures.
2015-01-23 18:58:19 -03:00
Björn Linse
a9048896b3 tests/ui: strict mode 2015-01-23 07:47:48 -03:00
Björn Linse
5c837f613e tests/ui: snapshot util 2015-01-23 07:47:48 -03:00
Thiago de Arruda
f08fe552f4 test: Fix screen.lua eol_clear method. 2015-01-22 08:54:37 -03:00
Thiago de Arruda
dc18fa256f test: Add more functional test to cover new code
- emulate gui_running and terminal colors
- scrolling/clearing regions
- mouse wheel scrolling
- setting icon/title
- :stop/:suspend
- screen resize
2015-01-15 09:01:25 -03:00
Thiago de Arruda
8596776bf6 ui: Implement set_{title,icon} 2015-01-14 08:31:20 -03:00
Thiago de Arruda
ea771ac559 test: Add Screen.debug for inspecting screens of hanging tests 2015-01-13 21:21:20 -03:00
Thiago de Arruda
29bc6dfabd ui: Add 'rgb' parameter to ui_attach
When set to false, nvim will send cterm color numbers with `highlight_set`.
2015-01-13 11:54:52 -03:00
Thiago de Arruda
926503c84e ui: Fix ui resizing and change some method names 2015-01-13 11:54:28 -03:00
Thiago de Arruda
fc8f768690 ui: Add update_fg/update_bg methods
It is necessary to notify the UI when the default background/foreground colors
change in order to render correctly.
2015-01-13 11:53:27 -03:00
Thiago de Arruda
1ccbd94bee test: Fix clear/eol_clear in screen.lua
These functions need to operate on the current the scroll region.
2015-01-13 11:53:27 -03:00
Justin M. Keyes
d7e18b5c95 Revert "[WIP] "abstract_ui" fixes and improvements" 2015-01-12 10:14:52 -05:00
Thiago de Arruda
d992213678 ui: Reimplement :suspend command for remote UIs.
- Remove suspend method from the UI protocol
- Handle `:suspend` by disconnecting the last channel that sent a request to
  nvim.
2015-01-12 09:47:41 -03:00
Thiago de Arruda
74c247f75b ui: Add 'rgb' parameter to ui_attach
When set to false, nvim will send cterm color numbers with `highlight_set`.
2015-01-12 09:47:41 -03:00
Thiago de Arruda
213c3c3e53 ui: Fix ui resizing and change some method names 2015-01-12 09:47:34 -03:00
Thiago de Arruda
4f5f246a95 ui: Add update_fg/update_bg methods
It is necessary to notify the UI when the default background/foreground colors
change in order to render correctly.
2015-01-10 21:41:31 -03:00
Thiago de Arruda
209b5ed6ba test: Fix eol_clear in screen.lua
It should only clear to the end of the current scroll region(this is the
behavior expected by nvim)
2015-01-10 21:41:31 -03:00
Thiago de Arruda
40977e78a2 input: Recognize mouse events for abstract_ui 2014-12-10 07:51:06 -03:00
Thiago de Arruda
1192fbd08a test: Add screen test facility
- Add screen.lua which implements a remote screen to verify screen state by
  tests under functional/ui
- Add some basic screen/highlight tests
2014-12-09 08:36:16 -03:00