mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Add cpplint to test suite
This commit is contained in:
47
test/unit/cpplint.js
Executable file
47
test/unit/cpplint.js
Executable file
@@ -0,0 +1,47 @@
|
||||
'use strict';
|
||||
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
var assert = require('assert');
|
||||
|
||||
var cpplint = require('node-cpplint/lib/');
|
||||
|
||||
describe('cpplint', function() {
|
||||
|
||||
// List C++ source files
|
||||
fs.readdirSync(path.join(__dirname, '..', '..', 'src')).forEach(function (source) {
|
||||
var file = path.join('src', source);
|
||||
it(file, function(done) {
|
||||
// Lint each source file
|
||||
cpplint({
|
||||
files: [file],
|
||||
linelength: 140,
|
||||
filters: {
|
||||
legal: {
|
||||
copyright: false
|
||||
},
|
||||
build: {
|
||||
include: false,
|
||||
include_order: false,
|
||||
namespaces: false
|
||||
},
|
||||
whitespace: {
|
||||
blank_line: false,
|
||||
comments: false,
|
||||
parens: false
|
||||
}
|
||||
}
|
||||
}, function(err, report) {
|
||||
if (err) {
|
||||
throw err;
|
||||
}
|
||||
var expected = {};
|
||||
expected[file] = [];
|
||||
assert.deepEqual(expected, report);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
Reference in New Issue
Block a user