verbose unit test log so that we have a clue when there is segfault

pull/1667/head
chrox 9 years ago
parent 1e4ac8c3b5
commit 429eeed372

@ -46,6 +46,7 @@ install:
- cp /etc/luarocks/config.lua $HOME/.luarocks/config.lua
- echo "wrap_bin_scripts = false" >> $HOME/.luarocks/config.lua
- travis_retry luarocks --local install lua_cliargs
- travis_retry luarocks --local install ansicolors
- travis_retry luarocks --local install busted
#- travis_retry luarocks --local install busted 1.11.1-1
#- mv -f $HOME/.luarocks/bin/busted_bootstrap $HOME/.luarocks/bin/busted

@ -102,7 +102,7 @@ $(INSTALL_DIR)/koreader/.luacov:
ln -sf ../../.luacov $(INSTALL_DIR)/koreader
testfront: $(INSTALL_DIR)/koreader/.busted
cd $(INSTALL_DIR)/koreader && ./luajit $(shell which busted) --exclude-tags=notest
cd $(INSTALL_DIR)/koreader && ./luajit $(shell which busted) -o verbose_print --exclude-tags=notest
test:
$(MAKE) -C $(KOR_BASE) test

@ -0,0 +1,22 @@
-- from Mashape/kong/spec/busted-print.lua
local ansicolors = require 'ansicolors'
return function(options)
local handler = require 'busted.outputHandlers.utfTerminal'(options)
handler.fileStart = function(file)
io.write('\n' .. ansicolors('%{cyan}' .. file.name) .. ':')
end
handler.testStart = function(element, parent, status, debug)
io.write('\n ' .. handler.getFullName(element) .. ' ... ')
io.flush()
end
local busted = require 'busted'
busted.subscribe({ 'file', 'start' }, handler.fileStart)
busted.subscribe({ 'test', 'start' }, handler.testStart)
return handler
end
Loading…
Cancel
Save