mirror of
https://github.com/koreader/koreader.git
synced 2025-12-13 20:36:53 +01:00
verbose unit test log so that we have a clue when there is segfault
This commit is contained in:
@@ -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
|
||||
|
||||
2
Makefile
2
Makefile
@@ -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
|
||||
|
||||
22
spec/unit/verbose_print.lua
Normal file
22
spec/unit/verbose_print.lua
Normal file
@@ -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
|
||||
Reference in New Issue
Block a user