Skip to content

Commit

Permalink
Parallel CLI option. For #68
Browse files Browse the repository at this point in the history
  • Loading branch information
Eran Hammer committed Mar 30, 2014
1 parent a9e1f79 commit 0947f25
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -22,6 +22,7 @@ keep the execution engine as simple as possible, and not try to build an extensi
- `-l` - disables global variable leak detection.
- `-m` - individual tests timeout in milliseconds, defaults to 2 seconds.
- `-o` - file to save the report to (`html` only), otherwise sent to stdout.
- `-p` - sets parallel execution as default test option. Defaults to serial execution.
- `-r` - the reporter used to generate the test results. Defaults to `console`. Options are:
- `console` - simple text output to console.
- `html` - HTML code coverage report (sets `-c`).
Expand Down
10 changes: 9 additions & 1 deletion lib/execute.js
Expand Up @@ -63,6 +63,11 @@ exports.execute = function (skipTraverse) {
.alias('o', 'output')
.describe('o', 'file path to write test results')

.alias('p', 'parallel')
.default('p', false)
.describe('p', 'parallel test execution within each experiment')
.boolean('p')

.alias('r', 'reporter')
.default('r', 'console')
.describe('r', 'reporter module [console, html, json, spec, summary, tap]')
Expand Down Expand Up @@ -95,6 +100,7 @@ exports.execute = function (skipTraverse) {

process.env.NODE_ENV = argv.e || 'test';
internals.timeout = argv.m;
internals.parallel = argv.p;

// Load tests

Expand Down Expand Up @@ -296,7 +302,9 @@ internals.executeTests = function (experiment, state, callback) {

for (var i = 0, il = experiment.tests.length; i < il; ++i) {
var test = experiment.tests[i];
if (test.options.parallel) {
if (test.options.parallel ||
(test.options.parallel === undefined && internals.parallel)) {

parallel.push(test);
}
else {
Expand Down

0 comments on commit 0947f25

Please sign in to comment.