diff --git a/run-all-tests.js b/run-all-tests.js index 4ba66ab..37e55c2 100644 --- a/run-all-tests.js +++ b/run-all-tests.js @@ -10,7 +10,16 @@ var path = require('path'); require('json5/lib/require'); -module.exports = function (mpPath, beforeRunningAnyTests, eachTestSuite, done){ +module.exports = function (mpPath, singleMachineToTest, beforeRunningAnyTests, eachTestSuite, done){ + // Support optional singleMachineToTest + if (arguments.length < 4) { + singleMachineToTest = false; + done = arguments[3]; + eachTestSuite = arguments[2]; + beforeRunningAnyTests = arguments[1]; + } else { + console.warn('Testing single machine:', singleMachineToTest); + } // Use provided machinepack path var mainPath = path.resolve(mpPath); @@ -39,6 +48,14 @@ module.exports = function (mpPath, beforeRunningAnyTests, eachTestSuite, done){ return done(new Error(util.format('Encountered error loading or parsing pack\'s package.json file (located at `%s`). Details:\n',packageJsonPath, e))); } + if (singleMachineToTest) { + if (machineIdentities.indexOf(singleMachineToTest) == -1) { + return done(new Error(util.format('Unknown machine "%s"', singleMachineToTest))); + } + + machineIdentities = [singleMachineToTest]; + } + var missingSuites = []; async.map(machineIdentities, function (machineIdentity, next_machineSuite){