mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 11:27:50 +00:00
Make travis-ci tests go right up to the max run time.
Former-commit-id: 15124a63d530c416ad1974898b7c1e3ee53c58a6
This commit is contained in:
@@ -5,7 +5,7 @@ node_js:
|
|||||||
env:
|
env:
|
||||||
- TEST_COMMAND="node ./test/test.js"
|
- TEST_COMMAND="node ./test/test.js"
|
||||||
- TEST_COMMAND="node ./test/test.js ./lodash.min.js"
|
- TEST_COMMAND="node ./test/test.js ./lodash.min.js"
|
||||||
- TEST_COMMAND="node ./test/test-build.js --time-limit 45"
|
- TEST_COMMAND="node ./test/test-build.js --time-limit 49m45s"
|
||||||
git:
|
git:
|
||||||
depth: 1
|
depth: 1
|
||||||
branches:
|
branches:
|
||||||
|
|||||||
@@ -19,10 +19,17 @@
|
|||||||
global.QUnit
|
global.QUnit
|
||||||
);
|
);
|
||||||
|
|
||||||
/** The time limit for the tests to run (minutes) */
|
/** The time limit for the tests to run (milliseconds) */
|
||||||
var timeLimit = process.argv.reduce(function(result, value, index) {
|
var timeLimit = process.argv.reduce(function(result, value, index) {
|
||||||
return (/--time-limit/.test(value) && parseFloat(process.argv[index + 1])) || result;
|
if (/--time-limit/.test(value)) {
|
||||||
}, Infinity);
|
return parseInt(process.argv[index + 1].replace(/(\d+h)?(\d+m)?(\d+s)?/, function(match, h, m, s) {
|
||||||
|
return ((parseInt(h) || 0) * 3600000) +
|
||||||
|
((parseInt(m) || 0) * 60000) +
|
||||||
|
((parseInt(s) || 0) * 1000);
|
||||||
|
})) || result;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}, 0);
|
||||||
|
|
||||||
/** Used to associate aliases with their real names */
|
/** Used to associate aliases with their real names */
|
||||||
var aliasToRealMap = {
|
var aliasToRealMap = {
|
||||||
@@ -1213,10 +1220,10 @@
|
|||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
if (isFinite(timeLimit)) {
|
if (timeLimit > 0) {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
process.exit(QUnit.config.stats.bad ? 1 : 0);
|
process.exit(QUnit.config.stats.bad ? 1 : 0);
|
||||||
}, timeLimit * 6e4);
|
}, timeLimit);
|
||||||
}
|
}
|
||||||
// explicitly call `QUnit.start()` for Narwhal, Node.js, Rhino, and RingoJS
|
// explicitly call `QUnit.start()` for Narwhal, Node.js, Rhino, and RingoJS
|
||||||
if (!global.document) {
|
if (!global.document) {
|
||||||
|
|||||||
Reference in New Issue
Block a user