diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2015-03-15 09:13:26 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2015-03-15 09:13:26 -0300 |
commit | dbe719317cf71dd1951d8d478256b8735db12db0 (patch) | |
tree | 13a6695070538944af5e1b314e59e4f4623b6d73 /third-party/utfTerminalDetailed.lua | |
parent | 70b7ba0ccbd8ce05c689eb1f571bbe51b7e90bdb (diff) | |
download | rneovim-dbe719317cf71dd1951d8d478256b8735db12db0.tar.gz rneovim-dbe719317cf71dd1951d8d478256b8735db12db0.tar.bz2 rneovim-dbe719317cf71dd1951d8d478256b8735db12db0.zip |
deps: Add utfTerminalDetailed busted output handler
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.
Diffstat (limited to 'third-party/utfTerminalDetailed.lua')
-rw-r--r-- | third-party/utfTerminalDetailed.lua | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/third-party/utfTerminalDetailed.lua b/third-party/utfTerminalDetailed.lua new file mode 100644 index 0000000000..4d7a7c1d6f --- /dev/null +++ b/third-party/utfTerminalDetailed.lua @@ -0,0 +1,22 @@ +-- 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 |