2013-06-05 10:24:52 +02:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
|
|
|
/**!
|
2013-07-07 17:27:56 +02:00
|
|
|
* Cppcheck - A tool for static C/C++ code analysis
|
|
|
|
* Copyright (C) 2013 XhmikosR and Cppcheck team.
|
2013-06-05 10:24:52 +02:00
|
|
|
*
|
2013-07-07 17:27:56 +02:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
2013-06-05 10:24:52 +02:00
|
|
|
*
|
2013-07-07 17:27:56 +02:00
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2013-06-05 10:24:52 +02:00
|
|
|
*/
|
|
|
|
|
2013-07-28 10:20:59 +02:00
|
|
|
require("shelljs/global");
|
2013-06-05 10:24:52 +02:00
|
|
|
|
|
|
|
cd(__dirname);
|
|
|
|
|
|
|
|
//
|
|
|
|
// JSHint
|
|
|
|
//
|
2013-07-28 10:20:59 +02:00
|
|
|
var jshintBin = "./node_modules/jshint/bin/jshint";
|
2013-06-05 10:24:52 +02:00
|
|
|
|
2013-07-28 10:20:59 +02:00
|
|
|
if (!test("-f", jshintBin)) {
|
|
|
|
echo("JSHint not found. Run `npm install` in the root dir first.");
|
2013-06-05 10:24:52 +02:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
2013-07-28 10:20:59 +02:00
|
|
|
if (exec("node" + " " + jshintBin + " " + "make.js run-tests.js js/github.js").code !== 0) {
|
|
|
|
echo("*** JSHint failed! (return code != 0)");
|
2013-06-05 10:24:52 +02:00
|
|
|
echo();
|
|
|
|
} else {
|
2013-07-28 10:20:59 +02:00
|
|
|
echo("JSHint completed successfully");
|
2013-06-05 10:24:52 +02:00
|
|
|
echo();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
// csslint
|
|
|
|
//
|
2013-07-28 10:20:59 +02:00
|
|
|
var csslintBin = "./node_modules/csslint/cli.js";
|
2013-06-05 10:24:52 +02:00
|
|
|
|
2013-07-28 10:20:59 +02:00
|
|
|
if (!test("-f", csslintBin)) {
|
|
|
|
echo("csslint not found. Run `npm install` in the root dir first.");
|
2013-06-05 10:24:52 +02:00
|
|
|
exit(1);
|
|
|
|
}
|
|
|
|
|
2013-07-28 10:20:59 +02:00
|
|
|
// csslint doesn't return proper error codes...
|
|
|
|
/*if (exec("node" + " " + csslintBin + " " + "css/all.css").code !== 0) {
|
|
|
|
echo("*** csslint failed! (return code != 0)");
|
2013-06-05 10:24:52 +02:00
|
|
|
echo();
|
2013-07-28 10:20:59 +02:00
|
|
|
}*/
|
|
|
|
exec("node" + " " + csslintBin + " " + "css/all.css");
|