fix unit test with latest busted

pull/1442/head
chrox 9 years ago
parent e74d1fa557
commit 4053b5adac

@ -14,14 +14,13 @@ before_install:
install: install:
- sudo apt-get install libsdl1.2-dev luarocks nasm - sudo apt-get install libsdl1.2-dev luarocks nasm
- git clone https://github.com/Olivine-Labs/busted/ - sudo luarocks install busted luacov
- 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 - sudo luarocks install luacov-coveralls --server=http://rocks.moonscript.org/dev
script: script:
- make fetchthirdparty all - make fetchthirdparty all
- sudo cp base/build/*/luajit /usr/bin/ - sudo cp base/build/*/luajit /usr/bin/
- sudo ln -sf /usr/bin/luajit /usr/bin/lua
- make testfront - make testfront
after_success: after_success:

@ -93,14 +93,14 @@ $(INSTALL_DIR)/koreader/.luacov:
ln -sf ../../.luacov $(INSTALL_DIR)/koreader ln -sf ../../.luacov $(INSTALL_DIR)/koreader
testfront: $(INSTALL_DIR)/koreader/.busted testfront: $(INSTALL_DIR)/koreader/.busted
cd $(INSTALL_DIR)/koreader && busted -l ./luajit cd $(INSTALL_DIR)/koreader && busted
test: test:
$(MAKE) -C $(KOR_BASE) test $(MAKE) -C $(KOR_BASE) test
$(MAKE) testfront $(MAKE) testfront
coverage: $(INSTALL_DIR)/koreader/.luacov coverage: $(INSTALL_DIR)/koreader/.luacov
cd $(INSTALL_DIR)/koreader && busted -c -l ./luajit --exclude-tags=nocov cd $(INSTALL_DIR)/koreader && busted -c --exclude-tags=nocov
# coverage report summary # coverage report summary
cd $(INSTALL_DIR)/koreader && tail -n \ cd $(INSTALL_DIR)/koreader && tail -n \
+$$(($$(grep -nm1 Summary luacov.report.out|cut -d: -f1)-1)) \ +$$(($$(grep -nm1 Summary luacov.report.out|cut -d: -f1)-1)) \

@ -1 +1 @@
Subproject commit 8d31203c7f3667ba75744ec50c8201f01ebc5286 Subproject commit 7025830053c47496db413802375236300eaf4e6e

@ -3,6 +3,7 @@ local DocumentRegistry = require("document/documentregistry")
describe("PDF document module", function() describe("PDF document module", function()
local sample_pdf = "spec/front/unit/data/tall.pdf" local sample_pdf = "spec/front/unit/data/tall.pdf"
local doc
it("should open document", function() it("should open document", function()
doc = DocumentRegistry:openDocument(sample_pdf) doc = DocumentRegistry:openDocument(sample_pdf)
assert.truthy(doc) assert.truthy(doc)
@ -38,6 +39,7 @@ end)
describe("EPUB document module", function() describe("EPUB document module", function()
local sample_epub = "spec/front/unit/data/leaves.epub" local sample_epub = "spec/front/unit/data/leaves.epub"
local doc
it("should open document", function() it("should open document", function()
doc = DocumentRegistry:openDocument(sample_epub) doc = DocumentRegistry:openDocument(sample_epub)
assert.truthy(doc) assert.truthy(doc)

Loading…
Cancel
Save