mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
make coverage target for code coverage for the unit test
so that we can easily find which module needs unit test In order to run 'make coverage' `luacov` need to be installed with 'sudo luarocks install luacov'.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
require "defaults"
|
||||
package.path = "?.lua;common/?.lua;frontend/?.lua"
|
||||
package.cpath = "?.so;common/?.so;/usr/lib/lua/?.so"
|
||||
package.path = "?.lua;common/?.lua;frontend/?.lua;" .. package.path
|
||||
package.cpath = "?.so;common/?.so;/usr/lib/lua/?.so;" .. package.cpath
|
||||
|
||||
require "libs/libkoreader-lfs"
|
||||
-- global einkfb for Screen
|
||||
@@ -26,22 +26,23 @@ describe("Cache module", function()
|
||||
it("should clear cache", function()
|
||||
Cache:clear()
|
||||
end)
|
||||
local max_page = 1
|
||||
it("should serialize blitbuffer", function()
|
||||
for pageno = 1, math.min(10, doc.info.number_of_pages) do
|
||||
for pageno = 1, math.min(max_page, doc.info.number_of_pages) do
|
||||
doc:renderPage(pageno, nil, 1, 0, 1.0, 0)
|
||||
Cache:serialize()
|
||||
end
|
||||
Cache:clear()
|
||||
end)
|
||||
it("should deserialize blitbuffer", function()
|
||||
for pageno = 1, math.min(10, doc.info.number_of_pages) do
|
||||
for pageno = 1, math.min(max_page, doc.info.number_of_pages) do
|
||||
doc:hintPage(pageno, 1, 0, 1.0, 0)
|
||||
end
|
||||
Cache:clear()
|
||||
end)
|
||||
it("should serialize koptcontext", function()
|
||||
doc.configurable.text_wrap = 1
|
||||
for pageno = 1, math.min(10, doc.info.number_of_pages) do
|
||||
for pageno = 1, math.min(max_page, doc.info.number_of_pages) do
|
||||
doc:renderPage(pageno, nil, 1, 0, 1.0, 0)
|
||||
doc:getPageDimensions(pageno)
|
||||
Cache:serialize()
|
||||
@@ -49,7 +50,7 @@ describe("Cache module", function()
|
||||
Cache:clear()
|
||||
end)
|
||||
it("should deserialize koptcontext", function()
|
||||
for pageno = 1, math.min(10, doc.info.number_of_pages) do
|
||||
for pageno = 1, math.min(max_page, doc.info.number_of_pages) do
|
||||
doc:renderPage(pageno, nil, 1, 0, 1.0, 0)
|
||||
end
|
||||
Cache:clear()
|
||||
|
||||
Reference in New Issue
Block a user