cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From drk...@apache.org
Subject git commit: fixing support for external ips
Date Mon, 03 Feb 2014 14:56:27 GMT
Updated Branches:
  refs/heads/master d7d104f73 -> c7077a59e


fixing support for external ips


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

Branch: refs/heads/master
Commit: c7077a59e883d2894ac7c25b543218d23960e13a
Parents: d7d104f
Author: David Kemp <drkemp@chromium.org>
Authored: Mon Feb 3 09:56:04 2014 -0500
Committer: David Kemp <drkemp@chromium.org>
Committed: Mon Feb 3 09:56:04 2014 -0500

----------------------------------------------------------------------
 runner/testrunner.js | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-medic/blob/c7077a59/runner/testrunner.js
----------------------------------------------------------------------
diff --git a/runner/testrunner.js b/runner/testrunner.js
index 0ba2d1b..70a4c01 100644
--- a/runner/testrunner.js
+++ b/runner/testrunner.js
@@ -7,7 +7,7 @@ var argv = require('optimist').argv;
 var url=require('url');
 
 var logport =0;
-var logurl='http://127.0.0.1';
+var logip='127.0.0.1';
 var testprocess;
 
 var cmdargs;
@@ -20,9 +20,12 @@ var cmdpath = "./runtest.sh";
 if(argv.cmd) cmdpath=argv.cmd;
 
 if(argv.port) logport=argv.port;
+if(argv.ip) logip=argv.ip;
+
+var logurl = "http://"+logip;
 
 function writejson(port,cfgpath){
-  var cfgobj = {logurl:"http://127.0.0.1:"+port};
+  var cfgobj = {logurl:logurl+':'+port};
   if(!fs.existsSync(cfgpath)) fs.mkdirSync(cfgpath);
   fs.writeFileSync(path.join(cfgpath,'medic.json'), JSON.stringify(cfgobj));
 }
@@ -45,8 +48,12 @@ function endTest(resultcode){
   console.log("ending test - process ",testprocess.pid);
   server.close();
   if(testprocess){
-    process.kill(testprocess.pid);
-    console.log("killed test.");
+    try {
+      process.kill(testprocess.pid);
+      console.log("killed test.");
+    } catch (err) {
+      console.log("kill test threw error: ",err);
+    }
   } else {
     console.log("cant kill test.");
   }
@@ -76,7 +83,7 @@ var server = http.createServer(function (req, res) {
     res.end('Got that\n');
   }
 });
-server.listen(logport, '127.0.0.1',511,function(){
+server.listen(logport,logip,511,function(){
   logport = server.address().port;
   console.log('Server running at '+logurl+':'+logport);
   writejson(logport,testpath);


Mime
View raw message