Commit 17e11ae6 by Kevin Martensson

Move coverage script to Makefile

Also includes some cleanup of unnecessary files in .gitignore which should belong
in a global .gitignore.
parent 3619c1f9
......@@ -10,3 +10,6 @@ trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
[Makefile]
indent_style = tab
lib-cov
*.seed
*.log
*.csv
*.dat
*.out
*.pid
*.gz
pids
logs
results
node_modules
npm-debug.log
build
vagrant
.lock-wscript
.DS_Store
.sass-cache
bin/*-v8-*
lib-coverage/
sass-coverage.js
**/fixtures/**/build.*
bin
!bin/node-sass
build
lib-cov
node_modules
BIN = ./node_modules/.bin
REPORTER = spec
clean:
@rm -rf lib-cov test/fixtures/*/build.css
lint:
@$(BIN)/jshint bin lib test
node_modules: package.json
@npm install
@touch node_modules
test: clean lint node_modules
@$(BIN)/_mocha \
--reporter $(REPORTER)
test-cov: clean lint node_modules
@$(BIN)/jscoverage lib lib-cov
@NODESASS_COV=1 $(BIN)/_mocha \
--reporter mocha-lcov-reporter | $(BIN)/coveralls
.PHONY: test clean
......@@ -19,7 +19,7 @@
},
"gypfile": true,
"scripts": {
"coverage": "node scripts/coverage",
"coverage": "make test-cov",
"install": "node lib/build.js",
"prepublish": "node scripts/prepublish",
"pretest": "node_modules/.bin/jshint bin lib test",
......
#!/usr/bin/env node
/*jshint shelljs:true */
"use strict";
require("shelljs/make");
var path = require("path");
var JSCOVERAGE_BIN = ["node_modules", ".bin", "jscoverage"].join(path.sep);
var COVERALLS_BIN = ["node_modules", ".bin", "coveralls"].join(path.sep);
var MOCHA_BIN = ["node_modules", ".bin", "mocha"].join(path.sep);
echo("Creating coverage files");
exec(JSCOVERAGE_BIN + " lib lib-coverage");
echo("Piping mocha to coveralls");
env["NODESASS_COVERAGE"] = 1;
exec(MOCHA_BIN + " test -R mocha-lcov-reporter | " + COVERALLS_BIN, {async: false}, function(code, output) {
console.log('Exit code:', code);
console.log('Program output:', output);
echo("Cleanup coverage files");
rm("-R", "lib-coverage");
});
......@@ -2,7 +2,7 @@ var assert = require('assert'),
fs = require('fs'),
path = require('path'),
read = fs.readFileSync,
sass = require('../lib'),
sass = process.env.NODESASS_COV ? require('../lib-cov') : require('../lib'),
fixture = path.join.bind(null, __dirname, 'fixtures'),
resolveFixture = path.resolve.bind(null, __dirname, 'fixtures');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment