Add a --time-limit option to test-build.js so travis-ci can complete its test runs.

Former-commit-id: 742b17208d6c9316efea33c106e7689b9290f48d
This commit is contained in:
John-David Dalton
2013-01-28 23:34:27 -08:00
parent ac4c075d32
commit 904921d8c4
2 changed files with 11 additions and 1 deletions

View File

@@ -14,6 +14,11 @@
var QUnit = global.QUnit = require('../vendor/qunit/qunit/qunit.js');
require('../vendor/qunit-clib/qunit-clib.js');
/** The time limit for the tests to run (minutes) */
var timeLimit = process.argv.reduce(function(result, value, index) {
return (/--time-limit/.test(value) && parseFloat(process.argv[index + 1])) || result;
}, Infinity);
/** Used to associate aliases with their real names */
var aliasToRealMap = {
'all': 'every',
@@ -1178,4 +1183,9 @@
});
}());
/*--------------------------------------------------------------------------*/
if (isFinite(timeLimit)) {
setTimeout(process.exit, timeLimit * 6e4);
}
}());