Skip to content

Commit

Permalink
support coveralls
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 committed Jun 24, 2013
1 parent 8bbbe76 commit 48bc9e7
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 17 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
@@ -1,4 +1,6 @@
language: node_js
node_js:
- 0.6
- 0.8
- 0.11
- '0.10'
- 0.8
script: make test-coveralls
25 changes: 15 additions & 10 deletions Makefile
@@ -1,24 +1,29 @@
TESTS = test/*.test.js
REPORTER = spec
TIMEOUT = 2000
JSCOVERAGE = ./node_modules/jscover/bin/jscover
MOCHA = ./node_modules/mocha/bin/mocha
MOCHA_OPTS =

install:
@npm install

test: install
@NODE_ENV=test $(MOCHA) \
@NODE_ENV=test ./node_modules/mocha/bin/mocha \
--reporter $(REPORTER) \
--timeout $(TIMEOUT) \
$(MOCHA_OPTS) \
$(TESTS)

test-cov: install lib-cov
@LOGSTREAM_COV=1 $(MAKE) test REPORTER=dot
@LOGSTREAM_COV=1 $(MAKE) test REPORTER=html-cov > coverage.html
test-cov:
@rm -f coverage.html
@$(MAKE) test MOCHA_OPTS='--require blanket' REPORTER=html-cov > coverage.html
@$(MAKE) test MOCHA_OPTS='--require blanket' REPORTER=travis-cov
@ls -lh coverage.html

lib-cov:
@rm -rf ./lib-cov
@$(JSCOVERAGE) lib $@
test-coveralls:
@$(MAKE) test
@echo TRAVIS_JOB_ID $(TRAVIS_JOB_ID)
@$(MAKE) test MOCHA_OPTS='--require blanket' REPORTER=mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js

.PHONY: test-cov test lib-cov
test-all: test test-cov

.PHONY: test test-cov test-all test-coveralls
6 changes: 3 additions & 3 deletions README.md
@@ -1,4 +1,4 @@
logfilestream [![Build Status](https://secure.travis-ci.org/fengmk2/logstream.png)](http://travis-ci.org/fengmk2/logstream)
logfilestream [![Build Status](https://secure.travis-ci.org/fengmk2/logstream.png)](http://travis-ci.org/fengmk2/logstream) [![Coverage Status](https://coveralls.io/repos/fengmk2/logstream/badge.png)](https://coveralls.io/r/fengmk2/logstream)
=========

![logo](https://raw.github.com/fengmk2/logstream/master/logo.png)
Expand Down Expand Up @@ -28,7 +28,7 @@ $ npm install logfilestream

(The MIT License)

Copyright (c) 2012 fengmk2 <fengmk2@gmail.com>.
Copyright (c) 2012 - 2013 fengmk2 <fengmk2@gmail.com>.

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
Expand All @@ -47,4 +47,4 @@ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
9 changes: 7 additions & 2 deletions package.json
Expand Up @@ -4,7 +4,9 @@
"description": "Log file stream, including auto rolling feature, support multiprocess `append` write at the same time. ",
"main": "index.js",
"scripts": {
"test": "make test"
"test": "make test-all",
"blanket": { "pattern": "logstream/lib" },
"travis-cov": { "threshold": 98 }
},
"repository": {
"type": "git",
Expand All @@ -30,7 +32,10 @@
"devDependencies": {
"mocha": "*",
"mkdirp": "*",
"jscover": "*",
"blanket": "*",
"travis-cov": "*",
"coveralls": "*",
"mocha-lcov-reporter": "*",
"should": "*"
},
"license": "MIT"
Expand Down

0 comments on commit 48bc9e7

Please sign in to comment.