From ea771ac559054c138cda58e68daeb286f5c80e80 Mon Sep 17 00:00:00 2001 From: Thiago de Arruda Date: Tue, 13 Jan 2015 18:05:57 -0300 Subject: [PATCH] test: Add Screen.debug for inspecting screens of hanging tests --- test/functional/ui/screen.lua | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index 7e8811fe2f..4163d8011a 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -83,6 +83,21 @@ local eq, dedent = helpers.eq, helpers.dedent local Screen = {} Screen.__index = Screen +local debug_screen + + +function Screen.debug(command) + if not command then + command = 'pynvim -n -g -c ' + end + command = command .. request('vim_eval', '$NVIM_LISTEN_ADDRESS') + if debug_screen then + debug_screen:close() + end + debug_screen = io.popen(command, 'r') + debug_screen:read() +end + function Screen.new(width, height) if not width then width = 53