#!/usr/bin/env node

/**
 * @overview mocha test runner.
 */


var path = require('path');

var timeout = process.argv[2];
process
    .on('message', function (filepaths) {
        var mocha = new (require('mocha'))({
            timeout: timeout
        });
        filepaths.forEach(function (filepath) {
            mocha.addFile(filepath);
        });
        mocha.run(function (failures) {
            process.send(failures);
        });
    });