Commit ec4ba203 by Adeel

Build: Use grep to filter test cases.

* Uses different strategy to test binary.
* Test two cases and declare the binary OK.
Issue URL: #611.
parent 04f87276
...@@ -115,10 +115,6 @@ function testBinary(options) { ...@@ -115,10 +115,6 @@ function testBinary(options) {
return build(options); return build(options);
} }
if (process.env.SKIP_NODE_SASS_TESTS) {
return;
}
fs.stat(path.join(__dirname, '..', 'vendor', options.bin, 'binding.node'), function (err) { fs.stat(path.join(__dirname, '..', 'vendor', options.bin, 'binding.node'), function (err) {
if (err) { if (err) {
return build(options); return build(options);
...@@ -126,22 +122,17 @@ function testBinary(options) { ...@@ -126,22 +122,17 @@ function testBinary(options) {
console.log('`' + options.bin + '` exists; testing'); console.log('`' + options.bin + '` exists; testing');
var total;
var failures;
var mocha = new Mocha({ var mocha = new Mocha({
ui: 'bdd', ui: 'bdd',
timeout: 999999, timeout: 999999,
reporter: function(stats) { reporter: function() {}
total = stats.total;
failures = stats.failures;
}
}); });
mocha.addFile(path.resolve(__dirname, '..', 'test', 'api.js')); mocha.addFile(path.resolve(__dirname, '..', 'test', 'api.js'));
mocha.run(function () { mocha.grep(/should compile sass to css with file/).run(function (done) {
if ((total - failures) * 100 / total < 90) { if (done !== 0) {
console.log([ console.log([
'Problem with the binary: ' + failures + ' of ' + total + ' tests are failing.', 'Problem with the binary.',
'Manual build incoming.', 'Manual build incoming.',
'Please consider contributing the release binary to https://github.com/sass/node-sass-binaries for npm distribution.' 'Please consider contributing the release binary to https://github.com/sass/node-sass-binaries for npm distribution.'
].join('\n')); ].join('\n'));
......
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