You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by dr...@apache.org on 2014/01/27 21:40:37 UTC

git commit: handling exitcode

Updated Branches:
  refs/heads/master eee9d1dae -> 0d2d62e82


handling exitcode


Project: http://git-wip-us.apache.org/repos/asf/cordova-medic/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-medic/commit/0d2d62e8
Tree: http://git-wip-us.apache.org/repos/asf/cordova-medic/tree/0d2d62e8
Diff: http://git-wip-us.apache.org/repos/asf/cordova-medic/diff/0d2d62e8

Branch: refs/heads/master
Commit: 0d2d62e8298bf529e3ad0055dc9a5b05c6e36159
Parents: eee9d1d
Author: David Kemp <dr...@google.com>
Authored: Mon Jan 27 15:40:09 2014 -0500
Committer: David Kemp <dr...@google.com>
Committed: Mon Jan 27 15:40:09 2014 -0500

----------------------------------------------------------------------
 runner/testrunner.js | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-medic/blob/0d2d62e8/runner/testrunner.js
----------------------------------------------------------------------
diff --git a/runner/testrunner.js b/runner/testrunner.js
index ea498f7..5291248 100644
--- a/runner/testrunner.js
+++ b/runner/testrunner.js
@@ -32,7 +32,7 @@ function startTest(){
   }
 }
 
-function endTest(){
+function endTest(resultcode){
   console.log("ending test.");
   server.close();
   if(testprocess){
@@ -41,7 +41,7 @@ function endTest(){
   } else {
     console.log("cant kill test.");
   }
-//  process.exit(0);
+  process.exit(resultcode);
 }
 
 var server = http.createServer(function (req, res) {
@@ -53,7 +53,14 @@ var server = http.createServer(function (req, res) {
     req.on('end',function(){
       console.log(body);
       if(route == '/result'){
-        endTest();
+        var resultcode=0;
+        try{
+          var r = JSON.parse(body);
+          if(r.failures >0) resultcode=1;
+        } catch(err) {
+          resultcode=2;
+        }
+        endTest(resultcode);
       }
     });    
     res.writeHead(200, {'Content-Type': 'text/plain', 'Access-Control-Allow-Origin':'*'});