Skip to content
Browse files

Added SIGCONT signalling to start the tests after entering --no-run mode

  • Loading branch information...
1 parent e2b8c6d commit bbef0ade9685fdc20a48e4f6e3df6171fb59328f @davglass committed Sep 11, 2012
Showing with 22 additions and 8 deletions.
  1. +7 −0 README.md
  2. +15 −8 bin/grover.js
View
7 README.md
@@ -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
----------------
View
23 bin/grover.js
@@ -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);
@@ -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.
Something went wrong with that request. Please try again.