From 4053b5adac83bf35d820653d8889a40e1faa5fcd Mon Sep 17 00:00:00 2001 From: chrox Date: Tue, 3 Mar 2015 18:00:38 +0800 Subject: [PATCH] fix unit test with latest busted --- .travis.yml | 5 ++--- Makefile | 4 ++-- base | 2 +- spec/unit/document_spec.lua | 2 ++ 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 496f62688..bdacbd4b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,14 +14,13 @@ before_install: install: - sudo apt-get install libsdl1.2-dev luarocks nasm - - 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 busted 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: diff --git a/Makefile b/Makefile index 55f7f669b..8ad990ab8 100644 --- a/Makefile +++ b/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 -l ./luajit + cd $(INSTALL_DIR)/koreader && busted test: $(MAKE) -C $(KOR_BASE) test $(MAKE) testfront 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 cd $(INSTALL_DIR)/koreader && tail -n \ +$$(($$(grep -nm1 Summary luacov.report.out|cut -d: -f1)-1)) \ diff --git a/base b/base index 8d31203c7..702583005 160000 --- a/base +++ b/base @@ -1 +1 @@ -Subproject commit 8d31203c7f3667ba75744ec50c8201f01ebc5286 +Subproject commit 7025830053c47496db413802375236300eaf4e6e diff --git a/spec/unit/document_spec.lua b/spec/unit/document_spec.lua index 4338b7a91..69bdb9356 100644 --- a/spec/unit/document_spec.lua +++ b/spec/unit/document_spec.lua @@ -3,6 +3,7 @@ local DocumentRegistry = require("document/documentregistry") describe("PDF document module", function() local sample_pdf = "spec/front/unit/data/tall.pdf" + local doc it("should open document", function() doc = DocumentRegistry:openDocument(sample_pdf) assert.truthy(doc) @@ -38,6 +39,7 @@ end) describe("EPUB document module", function() local sample_epub = "spec/front/unit/data/leaves.epub" + local doc it("should open document", function() doc = DocumentRegistry:openDocument(sample_epub) assert.truthy(doc)