cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From drk...@apache.org
Subject git commit: fix testrunner to stop correctly
Date Tue, 28 Jan 2014 16:40:24 GMT
Updated Branches:
  refs/heads/master 0d2d62e82 -> d6b2611db


fix testrunner to stop correctly


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

Branch: refs/heads/master
Commit: d6b2611db8f4d62bbb67035174273dcbb1f1bed0
Parents: 0d2d62e
Author: David Kemp <drkemp@chromium.org>
Authored: Tue Jan 28 11:39:43 2014 -0500
Committer: David Kemp <drkemp@chromium.org>
Committed: Tue Jan 28 11:39:43 2014 -0500

----------------------------------------------------------------------
 runner/runchrome.sh  |  2 +-
 runner/testrunner.js | 10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-medic/blob/d6b2611d/runner/runchrome.sh
----------------------------------------------------------------------
diff --git a/runner/runchrome.sh b/runner/runchrome.sh
index 29333ec..516f52c 100755
--- a/runner/runchrome.sh
+++ b/runner/runchrome.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
 # loads and runs the chrome-apps test
 #
-/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --load-and-launch-app=$1 
--no-startup-window
+exec /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --load-and-launch-app=$1
 --no-startup-window
 

http://git-wip-us.apache.org/repos/asf/cordova-medic/blob/d6b2611d/runner/testrunner.js
----------------------------------------------------------------------
diff --git a/runner/testrunner.js b/runner/testrunner.js
index 5291248..6e23542 100644
--- a/runner/testrunner.js
+++ b/runner/testrunner.js
@@ -16,6 +16,8 @@ if(argv.path) testpath=argv.path;
 var cmdpath = "./runtest.sh";
 if(argv.cmd) cmdpath=argv.cmd;
 
+if(argv.port) logport=argv.port;
+
 function writejson(port,cfgpath){
   var cfgobj = {logurl:"http://127.0.0.1:"+port};
   if(!fs.existsSync(cfgpath)) fs.mkdirSync(cfgpath);
@@ -24,7 +26,7 @@ function writejson(port,cfgpath){
 
 function startTest(){
   console.log("starting test "+cmdpath);
-  testprocess=cp.spawn(cmdpath,[testpath]);
+  testprocess=cp.execFile(cmdpath,[testpath]);
   if(testprocess){
     console.log("started test: "+testprocess.pid);
   } else {
@@ -33,10 +35,10 @@ function startTest(){
 }
 
 function endTest(resultcode){
-  console.log("ending test.");
+  console.log("ending test - process ",testprocess.pid);
   server.close();
   if(testprocess){
-    process.kill(testprocess);
+    process.kill(testprocess.pid);
     console.log("killed test.");
   } else {
     console.log("cant kill test.");
@@ -56,7 +58,7 @@ var server = http.createServer(function (req, res) {
         var resultcode=0;
         try{
           var r = JSON.parse(body);
-          if(r.failures >0) resultcode=1;
+          if(r.mobilespec.failures >0) resultcode=1;
         } catch(err) {
           resultcode=2;
         }


Mime
View raw message