X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=to-be-integrated%2Fthird-party%2Fcodemirror-3.15%2Ftest%2Frun.js;fp=to-be-integrated%2Fthird-party%2Fcodemirror-3.15%2Ftest%2Frun.js;h=52221be5a2701634851d39650516bf7de82d482e;hb=31540dd504798e0aca69e10d8144fbedc5b16af8;hp=0000000000000000000000000000000000000000;hpb=937653fd70bbf7d95bcf870e7f2b46b4a8fec486;p=myslice.git diff --git a/to-be-integrated/third-party/codemirror-3.15/test/run.js b/to-be-integrated/third-party/codemirror-3.15/test/run.js new file mode 100755 index 00000000..52221be5 --- /dev/null +++ b/to-be-integrated/third-party/codemirror-3.15/test/run.js @@ -0,0 +1,34 @@ +#!/usr/bin/env node + +var lint = require("./lint/lint"); + +lint.checkDir("mode"); +lint.checkDir("lib"); +lint.checkDir("addon"); +lint.checkDir("keymap"); + +var ok = lint.success(); + +var files = new (require('node-static').Server)('.'); + +var server = require('http').createServer(function (req, res) { + req.addListener('end', function () { + files.serve(req, res); + }); +}).addListener('error', function (err) { + throw err; +}).listen(3000, function () { + var child_process = require('child_process'); + child_process.exec("which phantomjs", function (err) { + if (err) { + console.error("PhantomJS is not installed. Download from http://phantomjs.org"); + process.exit(1); + } + var cmd = 'phantomjs test/phantom_driver.js'; + child_process.exec(cmd, function (err, stdout) { + server.close(); + console.log(stdout); + process.exit(err || !ok ? 1 : 0); + }); + }); +});