mirror of
https://github.com/neovim/neovim.git
synced 2025-01-01 17:23:36 -07:00
dbe719317c
This is a variant of the utfTerminal output handler that will: - Output the file name before each suite is executed - Output the test name before each test is executed This will make it simpler to identify crashing/hanging tests.
23 lines
707 B
Lua
23 lines
707 B
Lua
-- busted output handler that immediately prints file and test names before
|
|
-- tests are executed. It simplifies identifying which tests are
|
|
-- hanging/crashing
|
|
local ansicolors = require 'ansicolors'
|
|
|
|
return function(options, busted)
|
|
local handler = require 'busted.outputHandlers.utfTerminal'(options, busted)
|
|
|
|
handler.fileStart = function(name)
|
|
io.write('\n' .. ansicolors('%{cyan}' .. name) .. ':')
|
|
end
|
|
|
|
handler.testStart = function(element, parent, status, debug)
|
|
io.write('\n ' .. handler.getFullName(element) .. ' ... ')
|
|
io.flush()
|
|
end
|
|
|
|
busted.subscribe({ 'file', 'start' }, handler.fileStart)
|
|
busted.subscribe({ 'test', 'start' }, handler.testStart)
|
|
|
|
return handler
|
|
end
|