Skip to content

Commit

Permalink
Added SIGCONT signalling to start the tests after entering --no-run mode
Browse files Browse the repository at this point in the history
  • Loading branch information
davglass committed Sep 11, 2012
1 parent e2b8c6d commit bbef0ad
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,13 @@ This will create a URL like:

http://127.0.0.1:5000/tests/foo.html?filter=coverage

You can add `--no-run` to have `grover` fire up the server and prep everything, but not execute the tests.
This way you can access the `grover` server from another location (browser). If you want to continue
running the tests after launching this way, simply send the process a `SIGCONT` signal (`kill -s SIGCONT [PID]`)
and `grover` will start executing the tests like it normally would. This is handy if you have CLI tests that you
want to execute against the server before you want the Phantom tests to execute.


YUITest Coverage
----------------

Expand Down
23 changes: 15 additions & 8 deletions bin/grover.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,16 @@ if (!options.paths.length) {
}

check(function(version) {
var i = 0;
var i = 0,
runTests = function () {
if (options.concurrent) {
for (i = 1; i < options.concurrent; i++) {
run();
}
} else {
run();
}
};
if (!version) {
console.error('Please install the phantomjs binary in your path!');
process.exit(1);
Expand All @@ -212,15 +221,13 @@ check(function(version) {
util.log('--will exit on first test error');
}
if (options.run){
if (options.concurrent) {
for (i = 1; i < options.concurrent; i++) {
run();
}
} else {
run();
}
runTests();
} else {
util.log('not running tests, just serving them.');
process.on('SIGCONT', function() {
util.log('Received SIGCONT, continuing test execution');
runTests();
});
}
});

0 comments on commit bbef0ad

Please sign in to comment.