mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
revert busted to v1.10.0 to avoid segmentation fault in testing
This commit is contained in:
@@ -13,15 +13,19 @@ before_install:
|
||||
- sudo apt-get update
|
||||
|
||||
install:
|
||||
# nasm for building libpng
|
||||
- sudo apt-get install libsdl1.2-dev luarocks nasm
|
||||
- sudo luarocks install busted
|
||||
# install an older version of lua_cliargs for busted v1.10.0
|
||||
- sudo luarocks install lua_cliargs 2.1-2
|
||||
# recent versions of busted may cause some weird segmentation faults
|
||||
- git clone https://github.com/Olivine-Labs/busted/
|
||||
- cd busted && git checkout v1.10.0 && sudo luarocks make && cd ..
|
||||
- sudo luarocks install luacov
|
||||
- sudo luarocks install luacov-coveralls --server=http://rocks.moonscript.org/dev
|
||||
|
||||
script:
|
||||
- make fetchthirdparty all
|
||||
- sudo cp base/build/*/luajit /usr/bin/
|
||||
- sudo ln -sf /usr/bin/luajit /usr/bin/lua
|
||||
- make testfront
|
||||
|
||||
after_success:
|
||||
|
||||
4
Makefile
4
Makefile
@@ -93,14 +93,14 @@ $(INSTALL_DIR)/koreader/.luacov:
|
||||
ln -sf ../../.luacov $(INSTALL_DIR)/koreader
|
||||
|
||||
testfront: $(INSTALL_DIR)/koreader/.busted
|
||||
cd $(INSTALL_DIR)/koreader && busted
|
||||
cd $(INSTALL_DIR)/koreader && busted -l ./luajit
|
||||
|
||||
test:
|
||||
$(MAKE) -C $(KOR_BASE) test
|
||||
$(MAKE) testfront
|
||||
|
||||
coverage: $(INSTALL_DIR)/koreader/.luacov
|
||||
cd $(INSTALL_DIR)/koreader && busted -c --exclude-tags=nocov
|
||||
cd $(INSTALL_DIR)/koreader && busted -c -l ./luajit --exclude-tags=nocov
|
||||
# coverage report summary
|
||||
cd $(INSTALL_DIR)/koreader && tail -n \
|
||||
+$$(($$(grep -nm1 Summary luacov.report.out|cut -d: -f1)-1)) \
|
||||
|
||||
2
base
2
base
Submodule base updated: 7025830053...897906d91a
@@ -36,6 +36,7 @@ function HTTPClient:request(request, response_callback, error_callback)
|
||||
UIManager.INPUT_TIMEOUT = self.INPUT_TIMEOUT
|
||||
self.input_timeouts = self.input_timeouts + 1
|
||||
local turbo = require("turbo")
|
||||
turbo.log.categories.success = false
|
||||
local res = coroutine.yield(
|
||||
turbo.async.HTTPClient():fetch(request.url, request))
|
||||
-- reset INPUT_TIMEOUT to nil when all HTTP requests are fullfilled.
|
||||
|
||||
@@ -21,25 +21,3 @@ Input.dummy = true
|
||||
-- turn on debug
|
||||
local DEBUG = require("dbg")
|
||||
--DEBUG:turnOn()
|
||||
|
||||
-- remove debug hooks in wrapped function for better luacov performance
|
||||
if LUACOV then
|
||||
local function hook_free_call(callback)
|
||||
local hook, mask, count = debug.gethook()
|
||||
debug.sethook()
|
||||
local res = callback()
|
||||
debug.sethook(hook, mask)
|
||||
return res
|
||||
end
|
||||
|
||||
local UIManager = require("ui/uimanager")
|
||||
local uimanager_run = UIManager.run
|
||||
function UIManager:run()
|
||||
hook_free_call(function() return uimanager_run(UIManager) end)
|
||||
end
|
||||
|
||||
local screen_shot = Screen.shot
|
||||
function Screen:shot(filename)
|
||||
hook_free_call(function() return screen_shot(Screen, filename) end)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -22,8 +22,6 @@ describe("HTTP client module", function()
|
||||
local urls = {
|
||||
"http://www.example.com",
|
||||
"http://www.example.org",
|
||||
"https://www.example.com",
|
||||
"https://www.example.org",
|
||||
}
|
||||
requests = #urls
|
||||
for _, url in ipairs(urls) do
|
||||
|
||||
Reference in New Issue
Block a user