You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by pu...@apache.org on 2016/03/04 01:35:39 UTC

[01/50] cordova-paramedic git commit: get appveyor to work

Repository: cordova-paramedic
Updated Branches:
  refs/heads/master [created] 7ed83daa0


get appveyor to work


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

Branch: refs/heads/master
Commit: 5f1b0d54dd958e254f5f8951a6f3b5ca82b0f69f
Parents: 3282743
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Feb 5 19:52:48 2015 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Feb 5 19:52:48 2015 -0800

----------------------------------------------------------------------
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/5f1b0d54/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index f9deec4..2e2e12a 100644
--- a/package.json
+++ b/package.json
@@ -16,7 +16,7 @@
     "test-travis":"npm run test-ios",
     "test-android":"cordova-paramedic --platform android --plugin ../spec/testable-plugin/",
     "test-ios": "cordova-paramedic --platform ios --plugin ../spec/testable-plugin/",
-    "test-wp8": "cordova-paramedic --platform wp8 --plugin ../spec/testable-plugin/"
+    "test-wp8": "node ./main.js --platform wp8 --plugin ../spec/testable-plugin/"
 
   },
   "keywords": [


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[24/50] cordova-paramedic git commit: bump version for npm

Posted by pu...@apache.org.
bump version for npm


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

Branch: refs/heads/master
Commit: 54facf29bdd9eda7587309d7408a20a3e35196d0
Parents: 06630ac
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Mar 20 17:41:14 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Mar 20 17:41:40 2015 -0700

----------------------------------------------------------------------
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/54facf29/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 3992e09..29d2c72 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "cordova-paramedic",
-  "version": "0.0.9",
+  "version": "0.0.10",
   "description": "Use medic to test a cordova plugin locally",
   "main": "cordova-paramedic",
   "bin": {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[33/50] cordova-paramedic git commit: split module out so this can be used both as a module and a cli

Posted by pu...@apache.org.
split module out so this can be used both as a module and a cli


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

Branch: refs/heads/master
Commit: bffb14e175ae4439e851544d2a171926a926d173
Parents: 9718efe
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Mon Mar 23 15:40:49 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Mon Mar 23 15:40:49 2015 -0700

----------------------------------------------------------------------
 README.md    |  12 ++-
 main.js      | 285 +++---------------------------------------------------
 package.json |   2 +-
 paramedic.js | 284 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 308 insertions(+), 275 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/bffb14e1/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index c65482c..77d9034 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,8 @@ To install :
 
 Usage :
 
-```cordova-paramedic --platform CORDOVA-PLATFORM --plugin PLUGIN-PATH [--justbuild --timeout MSECS --port PORTNUM]```
+```
+cordova-paramedic --platform CORDOVA-PLATFORM --plugin PLUGIN-PATH [--justbuild --timeout MSECS --port PORTNUM]
 
 	`CORDOVA-PLATFORM` : the platform id, currently only supports 'ios'
 	`PLUGIN-PATH` : the relative or absolute path to a plugin folder
@@ -23,4 +24,13 @@ Usage :
 			  (defaults to 10 minutes)
 	`PORTNUM` : (optional) port to use for posting results from emulator back to paramedic server
 	--justbuild : (optional) just builds the project, without running the tests
+```
+
+You can also use cordova-paramedic as a module directly :
+
+```
+  var paramedic = require('cordova-paramedic');
+  paramedic.run('ios','../cordova-plugin-device',bJustBuild,nPort,msTimeout);
+```
+
 

http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/bffb14e1/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index ee97e65..b0c0c86 100755
--- a/main.js
+++ b/main.js
@@ -1,289 +1,28 @@
 #!/usr/bin/env node
 
-var http = require('http'),
-    localtunnel = require('localtunnel'),
-    parseArgs = require('minimist'),
-    shell = require('shelljs'),
-    fs = require('fs'),
-    request = require('request'),
-    tmp = require('tmp'),
-    path = require('path');
-
-var tunneledUrl = "";
-var PORT = 8008;
-var TIMEOUT = 10 * 60 * 1000; // 10 minutes in msec - this will become a param
-var USAGE = "Error missing args. \n Usage: $cordova-paramedic " +
-            "  --platform CORDOVA-PLATFORM --plugin PLUGIN-PATH [--port PORT]";
-
-var TMP_FOLDER = null;
-var storedCWD = process.cwd();
-
-var JustBuild = false;
+var parseArgs = require('minimist'),
+    paramedic = require('./paramedic');
 
 var plugins,
     platformId;
 
+var USAGE = "Error missing args. \n Usage: $cordova-paramedic " +
+            "  --platform CORDOVA-PLATFORM --plugin PLUGIN-PATH [--port PORT]";    
 
-(function run_main() { // main program here 
-    init();
-    createTempProject();
-    installPlugins();
-    startServer();
-})();
-
-function init() {
-    var argv = parseArgs(process.argv.slice(2));
-
-    if(!argv.platform || !argv.plugin) {
-        console.log(USAGE);
-        process.exit(1);
-    }
-
-    platformId = argv.platform;
-    plugins = argv.plugin;
-    plugins = Array.isArray(plugins) ? plugins : [plugins];
-
-
-    // TODO: validate that port is a number
-    PORT = argv.port || PORT;
-    JustBuild = argv.justbuild || JustBuild; 
-    TIMEOUT = argv.timeout || TIMEOUT;
-
-    var cordovaResult = shell.exec('cordova --version', {silent:true});
-    if(cordovaResult.code) {
-        console.error(cordovaResult.output);
-        process.exit(cordovaResult.code);
-    }
-}
-
-function createTempProject() {
-    TMP_FOLDER = tmp.dirSync();
-    tmp.setGracefulCleanup();
-    
-    console.log("cordova-paramedic :: creating temp project");
-    shell.exec('cordova create ' + TMP_FOLDER.name);
-    shell.cd(TMP_FOLDER.name);
-}
-
-function installSinglePlugin(plugin) {
-    console.log("cordova-paramedic :: installing " + plugin);
-    
-    var pluginPath = path.resolve(storedCWD, plugin);
-
-    var installExitCode = shell.exec('cordova plugin add ' + pluginPath,
-                                     {silent:true}).code;
-    if(installExitCode !== 0) {
-        console.error('Failed to install plugin : ' + plugin);
-        cleanUpAndExitWithCode(1);
-        return;
-    }
-}
-
-
-function installPlugins() {
-
-    for(var n = 0; n < plugins.length; n++) {
-
-        var plugin = plugins[n];
-        installSinglePlugin(plugin);
-
-        if(!JustBuild) {
-            installSinglePlugin(path.join(plugin,"tests"));
-        }
-    }
-
-
-    if(!JustBuild) {
-        console.log("cordova-paramedic :: installing plugin-test-framework");
-        installExitCode = shell.exec('cordova plugin add https://github.com/apache/cordova-plugin-test-framework',
-                                     {silent:true}).code;
-        if(installExitCode !== 0) {
-            console.error('cordova-plugin-test-framework');
-            cleanUpAndExitWithCode(1);
-            return;
-        }
-    }
-}
-
-function addAndRunPlatform() {
-
-    if(JustBuild) {
-        console.log("cordova-paramedic :: adding platform");
-        shell.exec('cordova platform add ' + platformId,{silent:true});
-        shell.exec('cordova prepare',{silent:true});
-        console.log("building ...");
-        shell.exec('cordova build ' + platformId.split("@")[0],
-            {async:true,silent:true},
-            function(code,output){
-                if(code !== 0) {
-                    console.error("Error: cordova build returned error code " + code);
-                    console.log("output: " + output);
-                    cleanUpAndExitWithCode(1);
-                }
-                else {
-                    console.log("lookin' good!");
-                    cleanUpAndExitWithCode(0);
-                }
-            }
-        );
-    }
-    else {
-        setConfigStartPage();
-        console.log("cordova-paramedic :: adding platform");
-        shell.exec('cordova platform add ' + platformId,{silent:true});
-        shell.exec('cordova prepare',{silent:true});
-        // limit runtime to TIMEOUT msecs
-        setTimeout(function(){
-            console.error("This test seems to be blocked :: timeout exceeded. Exiting ...");
-            cleanUpAndExitWithCode(1);
-        },(TIMEOUT));
-
-        shell.exec('cordova emulate ' + platformId.split("@")[0] + " --phone",
-            {async:true,silent:true},
-            function(code,output){
-                if(code !== 0) {
-                    console.error("Error: cordova emulate return error code " + code);
-                    console.log("output: " + output);
-                    cleanUpAndExitWithCode(1);
-                }
-            }
-        );
-    }
-}
-
-function cleanUpAndExitWithCode(exitCode) {
-    shell.cd(storedCWD);
-    // the TMP_FOLDER.removeCallback() call is throwing an exception, so we explicitly delete it here
-    shell.exec('rm -rf ' + TMP_FOLDER.name);
-    
-    process.exit(exitCode);
-}
-
-function writeMedicLogUrl(url) {
-    console.log("cordova-paramedic :: writing medic log url to project");
-    var obj = {logurl:url};
-    fs.writeFileSync(path.join("www","medic.json"),JSON.stringify(obj));
-}
-
-
-function setConfigStartPage() {
-
-    console.log("cordova-paramedic :: setting app start page to test page");
+var argv = parseArgs(process.argv.slice(2));
 
-    var fileName = 'config.xml';
-    var configStr = fs.readFileSync(fileName).toString();
-    if(configStr) {
-        configStr = configStr.replace("src=\"index.html\"","src=\"cdvtests/index.html\"");
-        fs.writeFileSync(fileName, configStr);
-    }
-    else {
-        console.error("Oops, could not find config.xml");
-    }
+if(!argv.platform || !argv.plugin) {
+    console.log(USAGE);
+    process.exit(1);
 }
 
-function startServer() {
+platformId = argv.platform;
+plugins = argv.plugin;
+plugins = Array.isArray(plugins) ? plugins : [plugins];
 
-    if(JustBuild) {
-        addAndRunPlatform();
-        return;
-    }
 
-    console.log("cordova-paramedic :: starting local medic server " + platformId);
-    var server = http.createServer(requestListener);
-    server.listen(PORT, '127.0.0.1',function onServerConnect() {
+paramedic.run(platformId,plugins,argv.justbuild,argv.port,argv.timeout);
 
-        switch(platformId) {
-            case "ios"     :  // intentional fallthrough
-            case "windows" :
-                writeMedicLogUrl("http://127.0.0.1:" + PORT);
-                addAndRunPlatform();
-                break;
-            case "android" :
-                writeMedicLogUrl("http://10.0.2.2:" + PORT);
-                addAndRunPlatform();
-                break;
-            case "wp8" :
-                //localtunnel(PORT, tunnelCallback);
-                request.get('http://google.com/', function(e, res, data) {
-                    if(e) {
-                        console.error("failed to detect ip address");
-                        cleanUpAndExitWithCode(1);
-                    }
-                    else {
-                        console.log("res.req.connection = " + res.req.connection);
-                        var ip = res.req.connection.localAddress ||
-                                 res.req.socket.localAddress;
-                        console.log("Using ip : " + ip);
-                        writeMedicLogUrl("http://" + ip + ":" + PORT);
-                        addAndRunPlatform();
-                    }
-                });
-                break;
-            default :
-                console.log("platform is not supported :: " + platformId);
-                cleanUpAndExitWithCode(1);
-        }
-    });
-}
 
-function requestListener(request, response) {
-    if (request.method == 'PUT' || request.method == 'POST') {
-        var body = '';
-        request.on('data', function (data) {
-            body += data;
-            // Too much POST data, kill the connection!
-            if (body.length > 1e6) {
-                req.connection.destroy();
-            }
-        });
-        request.on('end', function (res) {
-            if(body.indexOf("mobilespec")  == 2){ // {\"mobilespec\":{...}}
-                try {
-                    console.log("body = " + body);
-                    var results = JSON.parse(body);
-                    console.log("Results:: ran " + 
-                        results.mobilespec.specs + 
-                        " specs with " + 
-                        results.mobilespec.failures + 
-                        " failures");
-                    if(results.mobilespec.failures > 0) {
-                        cleanUpAndExitWithCode(1);
-                    }
-                    else {
-                        cleanUpAndExitWithCode(0);
-                    }
-                    
-                }
-                catch(err) {
-                    console.log("parse error :: " + err);
-                    cleanUpAndExitWithCode(1);
-                }
-            }
-            else {
-                console.log("console-log:" + body);
-            }
-        });
-    }
-    else {
-        console.log(request.method);
-        response.writeHead(200, { 'Content-Type': 'text/plain'});
-        response.write("Hello"); // sanity check to make sure server is running
-        response.end();
-    }
-}
 
-function tunnelCallback(err, tunnel) {
-    if (err){
-        console.log("failed to create tunnel url, check your internet connectivity.");
-        cleanUpAndExitWithCode(1);
-    }
-    else {
-        // the assigned public url for your tunnel
-        // i.e. https://abcdefgjhij.localtunnel.me
-        tunneledUrl = tunnel.url;
-        console.log("cordova-paramedic :: tunneledURL = " + tunneledUrl);
-        writeMedicLogUrl(tunneledUrl);
-        addAndRunPlatform();
-    }
-}
 

http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/bffb14e1/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index a8e2b14..156901f 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
   "name": "cordova-paramedic",
   "version": "0.0.11",
   "description": "Use medic to test a cordova plugin locally",
-  "main": "cordova-paramedic",
+  "main": "paramedic.js",
   "bin": {
     "cordova-paramedic": "./main.js"
   },

http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/bffb14e1/paramedic.js
----------------------------------------------------------------------
diff --git a/paramedic.js b/paramedic.js
new file mode 100644
index 0000000..88cd09c
--- /dev/null
+++ b/paramedic.js
@@ -0,0 +1,284 @@
+#!/usr/bin/env node
+
+var http = require('http'),
+    localtunnel = require('localtunnel'),
+    parseArgs = require('minimist'),
+    shell = require('shelljs'),
+    fs = require('fs'),
+    request = require('request'),
+    tmp = require('tmp'),
+    path = require('path');
+
+var tunneledUrl = "";
+var PORT = 8008;
+var TIMEOUT = 10 * 60 * 1000; // 10 minutes in msec - this will become a param
+
+var TMP_FOLDER = null;
+var storedCWD = process.cwd();
+
+var JustBuild = false;
+
+var plugins,
+    platformId;
+
+
+exports.run = function(_platformId,_plugins,bJustBuild,nPort,msTimeout) {
+
+    if(_platformId && _plugins) {
+
+        platformId = _platformId;
+        // make it an array if it's not
+        plugins = Array.isArray(_plugins) ? _plugins : [_plugins];
+
+        JustBuild = bJustBuild == true;
+        PORT = nPort || PORT;
+        TIMEOUT = msTimeout || TIMEOUT;
+
+        var cordovaResult = shell.exec('cordova --version', {silent:true});
+        if(cordovaResult.code) {
+            console.error(cordovaResult.output);
+            process.exit(cordovaResult.code);
+        }
+
+        createTempProject();
+        installPlugins();
+        startServer();
+    }
+    else {
+        console.log("Error : Missing platformId and/or plugins");
+    }
+
+}
+
+
+function createTempProject() {
+    TMP_FOLDER = tmp.dirSync();
+    tmp.setGracefulCleanup();
+    
+    console.log("cordova-paramedic :: creating temp project");
+    shell.exec('cordova create ' + TMP_FOLDER.name);
+    shell.cd(TMP_FOLDER.name);
+}
+
+function installSinglePlugin(plugin) {
+    console.log("cordova-paramedic :: installing " + plugin);
+    
+    var pluginPath = path.resolve(storedCWD, plugin);
+
+    var installExitCode = shell.exec('cordova plugin add ' + pluginPath,
+                                     {silent:true}).code;
+    if(installExitCode !== 0) {
+        console.error('Failed to install plugin : ' + plugin);
+        cleanUpAndExitWithCode(1);
+        return;
+    }
+}
+
+
+function installPlugins() {
+
+    for(var n = 0; n < plugins.length; n++) {
+
+        var plugin = plugins[n];
+        installSinglePlugin(plugin);
+
+        if(!JustBuild) {
+            installSinglePlugin(path.join(plugin,"tests"));
+        }
+    }
+
+
+    if(!JustBuild) {
+        console.log("cordova-paramedic :: installing plugin-test-framework");
+        installExitCode = shell.exec('cordova plugin add https://github.com/apache/cordova-plugin-test-framework',
+                                     {silent:true}).code;
+        if(installExitCode !== 0) {
+            console.error('cordova-plugin-test-framework');
+            cleanUpAndExitWithCode(1);
+            return;
+        }
+    }
+}
+
+function addAndRunPlatform() {
+
+    if(JustBuild) {
+        console.log("cordova-paramedic :: adding platform");
+        shell.exec('cordova platform add ' + platformId,{silent:true});
+        shell.exec('cordova prepare',{silent:true});
+        console.log("building ...");
+        shell.exec('cordova build ' + platformId.split("@")[0],
+            {async:true,silent:true},
+            function(code,output){
+                if(code !== 0) {
+                    console.error("Error: cordova build returned error code " + code);
+                    console.log("output: " + output);
+                    cleanUpAndExitWithCode(1);
+                }
+                else {
+                    console.log("lookin' good!");
+                    cleanUpAndExitWithCode(0);
+                }
+            }
+        );
+    }
+    else {
+        setConfigStartPage();
+        console.log("cordova-paramedic :: adding platform");
+        shell.exec('cordova platform add ' + platformId,{silent:true});
+        shell.exec('cordova prepare',{silent:true});
+        // limit runtime to TIMEOUT msecs
+        setTimeout(function(){
+            console.error("This test seems to be blocked :: timeout exceeded. Exiting ...");
+            cleanUpAndExitWithCode(1);
+        },(TIMEOUT));
+
+        shell.exec('cordova emulate ' + platformId.split("@")[0] + " --phone",
+            {async:true,silent:true},
+            function(code,output){
+                if(code !== 0) {
+                    console.error("Error: cordova emulate return error code " + code);
+                    console.log("output: " + output);
+                    cleanUpAndExitWithCode(1);
+                }
+            }
+        );
+    }
+}
+
+function cleanUpAndExitWithCode(exitCode) {
+    shell.cd(storedCWD);
+    // the TMP_FOLDER.removeCallback() call is throwing an exception, so we explicitly delete it here
+    shell.exec('rm -rf ' + TMP_FOLDER.name);
+    
+    process.exit(exitCode);
+}
+
+function writeMedicLogUrl(url) {
+    console.log("cordova-paramedic :: writing medic log url to project");
+    var obj = {logurl:url};
+    fs.writeFileSync(path.join("www","medic.json"),JSON.stringify(obj));
+}
+
+
+function setConfigStartPage() {
+
+    console.log("cordova-paramedic :: setting app start page to test page");
+
+    var fileName = 'config.xml';
+    var configStr = fs.readFileSync(fileName).toString();
+    if(configStr) {
+        configStr = configStr.replace("src=\"index.html\"","src=\"cdvtests/index.html\"");
+        fs.writeFileSync(fileName, configStr);
+    }
+    else {
+        console.error("Oops, could not find config.xml");
+    }
+}
+
+function startServer() {
+
+    if(JustBuild) {
+        addAndRunPlatform();
+        return;
+    }
+
+    console.log("cordova-paramedic :: starting local medic server " + platformId);
+    var server = http.createServer(requestListener);
+    server.listen(PORT, '127.0.0.1',function onServerConnect() {
+
+        switch(platformId) {
+            case "ios"     :  // intentional fallthrough
+            case "windows" :
+                writeMedicLogUrl("http://127.0.0.1:" + PORT);
+                addAndRunPlatform();
+                break;
+            case "android" :
+                writeMedicLogUrl("http://10.0.2.2:" + PORT);
+                addAndRunPlatform();
+                break;
+            case "wp8" :
+                //localtunnel(PORT, tunnelCallback);
+                request.get('http://google.com/', function(e, res, data) {
+                    if(e) {
+                        console.error("failed to detect ip address");
+                        cleanUpAndExitWithCode(1);
+                    }
+                    else {
+                        console.log("res.req.connection = " + res.req.connection);
+                        var ip = res.req.connection.localAddress ||
+                                 res.req.socket.localAddress;
+                        console.log("Using ip : " + ip);
+                        writeMedicLogUrl("http://" + ip + ":" + PORT);
+                        addAndRunPlatform();
+                    }
+                });
+                break;
+            default :
+                console.log("platform is not supported :: " + platformId);
+                cleanUpAndExitWithCode(1);
+        }
+    });
+}
+
+function requestListener(request, response) {
+    if (request.method == 'PUT' || request.method == 'POST') {
+        var body = '';
+        request.on('data', function (data) {
+            body += data;
+            // Too much POST data, kill the connection!
+            if (body.length > 1e6) {
+                req.connection.destroy();
+            }
+        });
+        request.on('end', function (res) {
+            if(body.indexOf("mobilespec")  == 2){ // {\"mobilespec\":{...}}
+                try {
+                    console.log("body = " + body);
+                    var results = JSON.parse(body);
+                    console.log("Results:: ran " + 
+                        results.mobilespec.specs + 
+                        " specs with " + 
+                        results.mobilespec.failures + 
+                        " failures");
+                    if(results.mobilespec.failures > 0) {
+                        cleanUpAndExitWithCode(1);
+                    }
+                    else {
+                        cleanUpAndExitWithCode(0);
+                    }
+                    
+                }
+                catch(err) {
+                    console.log("parse error :: " + err);
+                    cleanUpAndExitWithCode(1);
+                }
+            }
+            else {
+                console.log("console-log:" + body);
+            }
+        });
+    }
+    else {
+        console.log(request.method);
+        response.writeHead(200, { 'Content-Type': 'text/plain'});
+        response.write("Hello"); // sanity check to make sure server is running
+        response.end();
+    }
+}
+
+function tunnelCallback(err, tunnel) {
+    if (err){
+        console.log("failed to create tunnel url, check your internet connectivity.");
+        cleanUpAndExitWithCode(1);
+    }
+    else {
+        // the assigned public url for your tunnel
+        // i.e. https://abcdefgjhij.localtunnel.me
+        tunneledUrl = tunnel.url;
+        console.log("cordova-paramedic :: tunneledURL = " + tunneledUrl);
+        writeMedicLogUrl(tunneledUrl);
+        addAndRunPlatform();
+    }
+}
+


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[03/50] cordova-paramedic git commit: ugh, duh

Posted by pu...@apache.org.
ugh, duh


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

Branch: refs/heads/master
Commit: 0ad9d9b1f2d766059aebfaa56cc1b908a36ec1c3
Parents: 1baeca6
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Feb 5 20:09:47 2015 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Feb 5 20:09:47 2015 -0800

----------------------------------------------------------------------
 appveyor.yml | 1 -
 1 file changed, 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/0ad9d9b1/appveyor.yml
----------------------------------------------------------------------
diff --git a/appveyor.yml b/appveyor.yml
index 68c8710..8a8cd0f 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -3,7 +3,6 @@
 
 install:
   - npm install cordova
-  - npm install ios-sim
   - npm install
   - npm link
   - cd ..


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[40/50] cordova-paramedic git commit: Updates to use new modular paramedic lib

Posted by pu...@apache.org.
Updates to use new modular paramedic lib


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

Branch: refs/heads/master
Commit: a688d653d2c02db8468be854066f1850b08683e0
Parents: d41f158
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Apr 9 17:38:57 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Apr 9 17:38:57 2015 -0700

----------------------------------------------------------------------
 main.js | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/a688d653/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index c6bc9bd..db3bd3e 100755
--- a/main.js
+++ b/main.js
@@ -25,16 +25,16 @@ if(!argv.platform || !argv.plugin) {
     process.exit(1);
 }
 
-platformId = argv.platform;
-plugins = argv.plugin;
-plugins = Array.isArray(plugins) ? plugins : [plugins];
-
 var onComplete = function(resCode,resObj,logStr) {
-	console.log("result code is : " + resCode + "\n" + JSON.stringify(resObj));
-	console.log(logStr);
+	console.log("result code is : " + resCode);
+	if(resObj) {
+		console.log(JSON.stringify(resObj));
+	}
+	if(logStr) {
+		console.log(logStr);
+	}
 	process.exit(resCode);
-}
-
+};
 
-paramedic.run(platformId, plugins, onComplete, argv.justbuild, argv.port, argv.timeout,true);
+paramedic.run(argv.platform, argv.plugin, onComplete, argv.justbuild, argv.port, argv.timeout,false);
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[29/50] cordova-paramedic git commit: fix merge issues

Posted by pu...@apache.org.
fix merge issues


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

Branch: refs/heads/master
Commit: be9e6f25269ede13ed8a1f7a9b42884c36ceecbb
Parents: ede1cee f3f58e7
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Sat Mar 21 00:53:27 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Sat Mar 21 00:53:27 2015 -0700

----------------------------------------------------------------------
 main.js      | 18 ++++++++++++++----
 package.json |  9 +++++----
 2 files changed, 19 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/be9e6f25/main.js
----------------------------------------------------------------------
diff --cc main.js
index 312dc26,c47d448..ee97e65
--- a/main.js
+++ b/main.js
@@@ -56,37 -54,39 +57,43 @@@ function init() 
  }
  
  function createTempProject() {
+     TMP_FOLDER = tmp.dirSync();
+     tmp.setGracefulCleanup();
+     
      console.log("cordova-paramedic :: creating temp project");
-     shell.exec('cordova create ' + TEMP_PROJECT_PATH);
-     shell.cd(TEMP_PROJECT_PATH);
+     shell.exec('cordova create ' + TMP_FOLDER.name);
+     shell.cd(TMP_FOLDER.name);
  }
  
 -function installPlugins() {
 -
 +function installSinglePlugin(plugin) {
      console.log("cordova-paramedic :: installing " + plugin);
+     
+     var pluginPath = path.resolve(storedCWD, plugin);
  
-     var installExitCode = shell.exec('cordova plugin add ' + plugin,
+     var installExitCode = shell.exec('cordova plugin add ' + pluginPath,
                                       {silent:true}).code;
 -    if(installExitCode != 0) {
 +    if(installExitCode !== 0) {
          console.error('Failed to install plugin : ' + plugin);
          cleanUpAndExitWithCode(1);
          return;
      }
 +}
  
 -    if(!JustBuild) { 
 -        // we only install the test stuff if needed
 -        console.log("cordova-paramedic :: installing " + path.join(pluginPath,'tests'));
 -        installExitCode = shell.exec('cordova plugin add ' + path.join(pluginPath,'tests'),
 -                                     {silent:true}).code;
 -        if(installExitCode != 0) {
 -            console.error('Failed to find /tests/ for plugin : ' + plugin);
 -            cleanUpAndExitWithCode(1);
 -            return;
++
 +function installPlugins() {
 +
 +    for(var n = 0; n < plugins.length; n++) {
 +
 +        var plugin = plugins[n];
 +        installSinglePlugin(plugin);
 +
 +        if(!JustBuild) {
 +            installSinglePlugin(path.join(plugin,"tests"));
          }
 +    }
 +
  
 +    if(!JustBuild) {
          console.log("cordova-paramedic :: installing plugin-test-framework");
          installExitCode = shell.exec('cordova plugin add https://github.com/apache/cordova-plugin-test-framework',
                                       {silent:true}).code;

http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/be9e6f25/package.json
----------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[42/50] cordova-paramedic git commit: add some hinting

Posted by pu...@apache.org.
add some hinting


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

Branch: refs/heads/master
Commit: faa4eed677f2219cba77c847759485c0612aa992
Parents: cbdd3c7
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Apr 9 17:39:49 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Apr 9 17:39:49 2015 -0700

----------------------------------------------------------------------
 package.json | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/faa4eed6/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 2984806..f6fa9ac 100644
--- a/package.json
+++ b/package.json
@@ -11,7 +11,8 @@
     "url": "git://github.com/purplecabbage/cordova-paramedic.git"
   },
   "scripts": {
-    "test":"npm run test-ios",
+    "test":"npm run jshint & npm run test-ios",
+    "jshint":"node node_modules/jshint/bin/jshint *.js",
     "test-appveyor":"npm run test-windows",
     "test-travis":"npm run test-ios",
     "test-android":"node main.js --platform android --plugin ./spec/testable-plugin/",
@@ -33,5 +34,9 @@
     "request": "^2.53.0",
     "shelljs": "~0.3.0",
     "tmp": "0.0.25"
+  },
+  "devDependencies": {
+        "jasmine-node": "~1",
+        "jshint": "^2.6.0"
   }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[47/50] cordova-paramedic git commit: license tweak

Posted by pu...@apache.org.
license tweak


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

Branch: refs/heads/master
Commit: c55403bc447523c749972a6aa766f885d109c709
Parents: b4884a0
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Apr 23 11:02:45 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Apr 23 11:02:45 2015 -0700

----------------------------------------------------------------------
 LICENSE | 25 -------------------------
 1 file changed, 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/c55403bc/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 2ff80bf..3fd0bc3 100644
--- a/LICENSE
+++ b/LICENSE
@@ -175,29 +175,4 @@
       of your accepting any such warranty or additional liability.
 
    END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
    


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[32/50] cordova-paramedic git commit: version bump 0.0.11

Posted by pu...@apache.org.
version bump 0.0.11


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

Branch: refs/heads/master
Commit: 9718efe68bc0bf4a9f71470a709aa8f78477d73d
Parents: a9fbce8
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Sat Mar 21 01:38:11 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Sat Mar 21 01:38:11 2015 -0700

----------------------------------------------------------------------
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/9718efe6/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 1e6973b..a8e2b14 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "cordova-paramedic",
-  "version": "0.0.10",
+  "version": "0.0.11",
   "description": "Use medic to test a cordova plugin locally",
   "main": "cordova-paramedic",
   "bin": {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[46/50] cordova-paramedic git commit: Cleanup copy/paste license cruft

Posted by pu...@apache.org.
Cleanup copy/paste license cruft


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

Branch: refs/heads/master
Commit: b4884a099fdde68b25f60f1d67626d5b19a39344
Parents: ccd9954
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Apr 23 10:56:57 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Apr 23 10:56:57 2015 -0700

----------------------------------------------------------------------
 LICENSE | 61 ------------------------------------------------------------
 1 file changed, 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/b4884a09/LICENSE
----------------------------------------------------------------------
diff --git a/LICENSE b/LICENSE
index 1621bab..2ff80bf 100644
--- a/LICENSE
+++ b/LICENSE
@@ -201,64 +201,3 @@
    See the License for the specific language governing permissions and
    limitations under the License.
    
- ADDITIONAL LICENSES:
- 
- /*
- File: CordovaLib/Classes/CDVReachability.*
- Abstract: Basic demonstration of how to use the SystemConfiguration Reachability APIs.
- 
- Version: 2.2
- 
- Disclaimer: IMPORTANT:  This Apple software is supplied to you by Apple Inc.
- ("Apple") in consideration of your agreement to the following terms, and your
- use, installation, modification or redistribution of this Apple software
- constitutes acceptance of these terms.  If you do not agree with these terms,
- please do not use, install, modify or redistribute this Apple software.
- 
- In consideration of your agreement to abide by the following terms, and subject
- to these terms, Apple grants you a personal, non-exclusive license, under
- Apple's copyrights in this original Apple software (the "Apple Software"), to
- use, reproduce, modify and redistribute the Apple Software, with or without
- modifications, in source and/or binary forms; provided that if you redistribute
- the Apple Software in its entirety and without modifications, you must retain
- this notice and the following text and disclaimers in all such redistributions
- of the Apple Software.
- Neither the name, trademarks, service marks or logos of Apple Inc. may be used
- to endorse or promote products derived from the Apple Software without specific
- prior written permission from Apple.  Except as expressly stated in this notice,
- no other rights or licenses, express or implied, are granted by Apple herein,
- including but not limited to any patent rights that may be infringed by your
- derivative works or by other works in which the Apple Software may be
- incorporated.
- 
- The Apple Software is provided by Apple on an "AS IS" basis.  APPLE MAKES NO
- WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED
- WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN
- COMBINATION WITH YOUR PRODUCTS.
- 
- IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR
- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR
- DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF
- CONTRACT, TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
- APPLE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- 
- Copyright (C) 2010 Apple Inc. All Rights Reserved.
- 
-*/
-
-//
-//  CordovaLib/Classes/Utils/NSData+Base64.*
-//  base64
-//
-//  Created by Matt Gallagher on 2009/06/03.
-//  Copyright 2009 Matt Gallagher. All rights reserved.
-//
-//  Permission is given to use this source code file, free of charge, in any
-//  project, commercial or otherwise, entirely at your risk, with the condition
-//  that any redistribution (in part or whole) of source code must retain
-//  this copyright and permission notice. Attribution in compiled projects is
-//  appreciated but not required.
-//


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[16/50] cordova-paramedic git commit: added specialized android emulator ip for host machine. Thanks @infil00p

Posted by pu...@apache.org.
added specialized android emulator ip for host machine. Thanks @infil00p


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

Branch: refs/heads/master
Commit: a5fcab013f4b0e86ddb53d87d4ca8b7e8ae697d4
Parents: 2312e53
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Mar 13 18:08:03 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Mar 13 18:08:03 2015 -0700

----------------------------------------------------------------------
 main.js | 36 ++++++++++++++++++++----------------
 1 file changed, 20 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/a5fcab01/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index eff040e..6c1ddb1 100755
--- a/main.js
+++ b/main.js
@@ -143,27 +143,31 @@ function startServer() {
 
         switch(platformId) {
             case "ios"     :  // intentional fallthrough
-            case "android" :
             case "windows" :
                 writeMedicLogUrl("http://127.0.0.1:" + PORT);
                 addAndRunPlatform();
                 break;
+            case "android" :
+                writeMedicLogUrl("http://10.0.2.2:" + PORT);
+                addAndRunPlatform();
+                break;
+                break;
             case "wp8" :
-                localtunnel(PORT, tunnelCallback);
-                // request.get('http://google.com/', function(e, res, data) {
-                //     if(e) {
-                //         console.error("failed to detect ip address");
-                //         cleanUpAndExitWithCode(1);
-                //     }
-                //     else {
-                //         console.log("res.req.connection = " + res.req.connection);
-                //         var ip = res.req.connection.localAddress ||
-                //                  res.req.socket.localAddress;
-                //         console.log("Using ip : " + ip);
-                //         writeMedicLogUrl("http://" + ip + ":" + PORT);
-                //         addAndRunPlatform();
-                //     }
-                // });
+                //localtunnel(PORT, tunnelCallback);
+                request.get('http://google.com/', function(e, res, data) {
+                    if(e) {
+                        console.error("failed to detect ip address");
+                        cleanUpAndExitWithCode(1);
+                    }
+                    else {
+                        console.log("res.req.connection = " + res.req.connection);
+                        var ip = res.req.connection.localAddress ||
+                                 res.req.socket.localAddress;
+                        console.log("Using ip : " + ip);
+                        writeMedicLogUrl("http://" + ip + ":" + PORT);
+                        addAndRunPlatform();
+                    }
+                });
                 break;
             default :
                 console.log("platform is not supported :: " + platformId);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[49/50] cordova-paramedic git commit: dropped in browser support

Posted by pu...@apache.org.
dropped in browser support


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

Branch: refs/heads/master
Commit: b81f56c83439afbc2466b3ffdc67a18b8068fba7
Parents: 0818793
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Aug 21 16:18:17 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Aug 21 16:18:17 2015 -0700

----------------------------------------------------------------------
 README.md    | 2 +-
 paramedic.js | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/b81f56c8/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 77d9034..3d062f4 100644
--- a/README.md
+++ b/README.md
@@ -15,7 +15,7 @@ Usage :
 ```
 cordova-paramedic --platform CORDOVA-PLATFORM --plugin PLUGIN-PATH [--justbuild --timeout MSECS --port PORTNUM]
 
-	`CORDOVA-PLATFORM` : the platform id, currently only supports 'ios'
+	`CORDOVA-PLATFORM` : the platform id, currently supports `ios|android|windows` and barely `browser`
 	`PLUGIN-PATH` : the relative or absolute path to a plugin folder
 					expected to have a 'tests' folder. 
 					You may specify multiple --plugin flags and they will all 

http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/b81f56c8/paramedic.js
----------------------------------------------------------------------
diff --git a/paramedic.js b/paramedic.js
index 09d7aed..7e623ca 100644
--- a/paramedic.js
+++ b/paramedic.js
@@ -138,6 +138,7 @@ ParamedicRunner.prototype = {
 
             switch(self.platformId) {
                 case "ios"     :  // intentional fallthrough
+                case "browser" :
                 case "windows" :
                     self.writeMedicLogUrl("http://127.0.0.1:" + self.port);
                     self.addAndRunPlatform();


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[28/50] cordova-paramedic git commit: Fixes tests with relative and absolute paths for plugins.

Posted by pu...@apache.org.
Fixes tests with relative and absolute paths for plugins.


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

Branch: refs/heads/master
Commit: f3f58e76defff93b025c39b146c6779efdffbe9b
Parents: bbd060d
Author: Shazron Abdullah <sh...@gmail.com>
Authored: Fri Mar 20 23:54:10 2015 -0700
Committer: Shazron Abdullah <sh...@gmail.com>
Committed: Fri Mar 20 23:54:10 2015 -0700

----------------------------------------------------------------------
 main.js      | 2 +-
 package.json | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/f3f58e76/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index adc0f18..c47d448 100755
--- a/main.js
+++ b/main.js
@@ -66,7 +66,7 @@ function installPlugins() {
 
     console.log("cordova-paramedic :: installing " + plugin);
     
-    var pluginPath = path.join(storedCWD, plugin);
+    var pluginPath = path.resolve(storedCWD, plugin);
 
     var installExitCode = shell.exec('cordova plugin add ' + pluginPath,
                                      {silent:true}).code;

http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/f3f58e76/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 874d23d..83c6baf 100644
--- a/package.json
+++ b/package.json
@@ -14,10 +14,10 @@
     "test":"npm run test-ios",
     "test-appveyor":"npm run test-windows",
     "test-travis":"npm run test-ios",
-    "test-android":"node main.js --platform android --plugin spec/testable-plugin/",
-    "test-ios": "node main.js --platform ios --plugin spec/testable-plugin/",
-    "test-windows" : "node main.js --platform windows --plugin spec/testable-plugin/",
-    "test-wp8": "node main.js --platform wp8 --plugin spec/testable-plugin/"
+    "test-android":"node main.js --platform android --plugin ./spec/testable-plugin/",
+    "test-ios": "node main.js --platform ios --plugin ./spec/testable-plugin/",
+    "test-windows" : "node main.js --platform windows --plugin ./spec/testable-plugin/",
+    "test-wp8": "node main.js --platform wp8 --plugin ./spec/testable-plugin/"
 
   },
   "keywords": [


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[35/50] cordova-paramedic git commit: Make this code usable as a module

Posted by pu...@apache.org.
Make this code usable as a module


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

Branch: refs/heads/master
Commit: 59ecc14c305a5d82f812f77b9c3af384a104a7be
Parents: ed53a92
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Mar 31 17:07:29 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Mar 31 17:07:29 2015 -0700

----------------------------------------------------------------------
 paramedic.js | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/59ecc14c/paramedic.js
----------------------------------------------------------------------
diff --git a/paramedic.js b/paramedic.js
index 88cd09c..f043b62 100644
--- a/paramedic.js
+++ b/paramedic.js
@@ -19,10 +19,11 @@ var storedCWD = process.cwd();
 var JustBuild = false;
 
 var plugins,
-    platformId;
+    platformId,
+    callback;
 
 
-exports.run = function(_platformId,_plugins,bJustBuild,nPort,msTimeout) {
+exports.run = function(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout) {
 
     if(_platformId && _plugins) {
 
@@ -30,6 +31,12 @@ exports.run = function(_platformId,_plugins,bJustBuild,nPort,msTimeout) {
         // make it an array if it's not
         plugins = Array.isArray(_plugins) ? _plugins : [_plugins];
 
+        // if we are passed a callback, we will use it, 
+        // otherwise just make a quick and dirty one
+        callback = ( _callback && _callback.apply ) ? _callback : function(resCode,resObj) {
+            process.exit(resCode);
+        };
+
         JustBuild = bJustBuild == true;
         PORT = nPort || PORT;
         TIMEOUT = msTimeout || TIMEOUT;
@@ -146,12 +153,12 @@ function addAndRunPlatform() {
     }
 }
 
-function cleanUpAndExitWithCode(exitCode) {
+function cleanUpAndExitWithCode(exitCode,resultsObj) {
     shell.cd(storedCWD);
     // the TMP_FOLDER.removeCallback() call is throwing an exception, so we explicitly delete it here
     shell.exec('rm -rf ' + TMP_FOLDER.name);
     
-    process.exit(exitCode);
+    callback(exitCode,resultsObj);
 }
 
 function writeMedicLogUrl(url) {
@@ -242,10 +249,10 @@ function requestListener(request, response) {
                         results.mobilespec.failures + 
                         " failures");
                     if(results.mobilespec.failures > 0) {
-                        cleanUpAndExitWithCode(1);
+                        cleanUpAndExitWithCode(1,results);
                     }
                     else {
-                        cleanUpAndExitWithCode(0);
+                        cleanUpAndExitWithCode(0,results);
                     }
                     
                 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[39/50] cordova-paramedic git commit: Allow output to be suppressed in module with additional param bSilent. This closes #22

Posted by pu...@apache.org.
Allow output to be suppressed in module with additional param bSilent. This closes #22


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

Branch: refs/heads/master
Commit: d41f158c68a211cf1745cdc7049ecdda257f7fbd
Parents: b275816
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Wed Apr 1 23:04:06 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Wed Apr 1 23:04:06 2015 -0700

----------------------------------------------------------------------
 main.js      |  7 +++--
 paramedic.js | 83 ++++++++++++++++++++++++++++++++-----------------------
 2 files changed, 52 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/d41f158c/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index ea814c8..c6bc9bd 100755
--- a/main.js
+++ b/main.js
@@ -29,11 +29,12 @@ platformId = argv.platform;
 plugins = argv.plugin;
 plugins = Array.isArray(plugins) ? plugins : [plugins];
 
-var onComplete = function(resCode,resObj) {
-	console.log("result is : " + resCode + "\n" + JSON.stringify(resObj));
+var onComplete = function(resCode,resObj,logStr) {
+	console.log("result code is : " + resCode + "\n" + JSON.stringify(resObj));
+	console.log(logStr);
 	process.exit(resCode);
 }
 
 
-paramedic.run(platformId, plugins, onComplete, argv.justbuild, argv.port, argv.timeout);
+paramedic.run(platformId, plugins, onComplete, argv.justbuild, argv.port, argv.timeout,true);
 

http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/d41f158c/paramedic.js
----------------------------------------------------------------------
diff --git a/paramedic.js b/paramedic.js
index f043b62..112592f 100644
--- a/paramedic.js
+++ b/paramedic.js
@@ -18,12 +18,15 @@ var storedCWD = process.cwd();
 
 var JustBuild = false;
 
+var logMessage;// function
+var logOutput;
+
 var plugins,
     platformId,
     callback;
 
 
-exports.run = function(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout) {
+exports.run = function(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout,bSilent) {
 
     if(_platformId && _plugins) {
 
@@ -40,10 +43,21 @@ exports.run = function(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout
         JustBuild = bJustBuild == true;
         PORT = nPort || PORT;
         TIMEOUT = msTimeout || TIMEOUT;
+        if(bSilent) {
+            logOutput = [];
+            logMessage = function(msg) {
+                logOutput.push(msg);
+            };
+        }
+        else {
+            logMessage = function(msg) {
+                console.log(msg);
+            };
+        }
 
         var cordovaResult = shell.exec('cordova --version', {silent:true});
         if(cordovaResult.code) {
-            console.error(cordovaResult.output);
+            logMessage(cordovaResult.output);
             process.exit(cordovaResult.code);
         }
 
@@ -52,7 +66,7 @@ exports.run = function(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout
         startServer();
     }
     else {
-        console.log("Error : Missing platformId and/or plugins");
+        console.error("Error : Missing platformId and/or plugins");
     }
 
 }
@@ -62,20 +76,20 @@ function createTempProject() {
     TMP_FOLDER = tmp.dirSync();
     tmp.setGracefulCleanup();
     
-    console.log("cordova-paramedic :: creating temp project");
-    shell.exec('cordova create ' + TMP_FOLDER.name);
+    logMessage("cordova-paramedic: creating temp project");
+    shell.exec('cordova create ' + TMP_FOLDER.name,{silent:true});
     shell.cd(TMP_FOLDER.name);
 }
 
 function installSinglePlugin(plugin) {
-    console.log("cordova-paramedic :: installing " + plugin);
+    logMessage("cordova-paramedic: installing " + plugin);
     
     var pluginPath = path.resolve(storedCWD, plugin);
 
     var installExitCode = shell.exec('cordova plugin add ' + pluginPath,
                                      {silent:true}).code;
     if(installExitCode !== 0) {
-        console.error('Failed to install plugin : ' + plugin);
+        logMessage('Failed to install plugin : ' + plugin);
         cleanUpAndExitWithCode(1);
         return;
     }
@@ -96,11 +110,11 @@ function installPlugins() {
 
 
     if(!JustBuild) {
-        console.log("cordova-paramedic :: installing plugin-test-framework");
+        logMessage("cordova-paramedic: installing plugin-test-framework");
         installExitCode = shell.exec('cordova plugin add https://github.com/apache/cordova-plugin-test-framework',
                                      {silent:true}).code;
         if(installExitCode !== 0) {
-            console.error('cordova-plugin-test-framework');
+            logMessage('cordova-plugin-test-framework');
             cleanUpAndExitWithCode(1);
             return;
         }
@@ -110,20 +124,19 @@ function installPlugins() {
 function addAndRunPlatform() {
 
     if(JustBuild) {
-        console.log("cordova-paramedic :: adding platform");
+        logMessage("cordova-paramedic: adding platform");
         shell.exec('cordova platform add ' + platformId,{silent:true});
         shell.exec('cordova prepare',{silent:true});
-        console.log("building ...");
+        logMessage("building ...");
         shell.exec('cordova build ' + platformId.split("@")[0],
             {async:true,silent:true},
             function(code,output){
                 if(code !== 0) {
-                    console.error("Error: cordova build returned error code " + code);
-                    console.log("output: " + output);
+                    logMessage("Error: cordova build returned error code " + code);
+                    logMessage("output: " + output);
                     cleanUpAndExitWithCode(1);
                 }
                 else {
-                    console.log("lookin' good!");
                     cleanUpAndExitWithCode(0);
                 }
             }
@@ -131,12 +144,12 @@ function addAndRunPlatform() {
     }
     else {
         setConfigStartPage();
-        console.log("cordova-paramedic :: adding platform");
+        logMessage("cordova-paramedic: adding platform");
         shell.exec('cordova platform add ' + platformId,{silent:true});
         shell.exec('cordova prepare',{silent:true});
         // limit runtime to TIMEOUT msecs
         setTimeout(function(){
-            console.error("This test seems to be blocked :: timeout exceeded. Exiting ...");
+            LogMessage("This test seems to be blocked :: timeout exceeded. Exiting ...");
             cleanUpAndExitWithCode(1);
         },(TIMEOUT));
 
@@ -144,8 +157,8 @@ function addAndRunPlatform() {
             {async:true,silent:true},
             function(code,output){
                 if(code !== 0) {
-                    console.error("Error: cordova emulate return error code " + code);
-                    console.log("output: " + output);
+                    logMessage("Error: cordova emulate return error code " + code);
+                    logMessage("output: " + output);
                     cleanUpAndExitWithCode(1);
                 }
             }
@@ -157,12 +170,12 @@ function cleanUpAndExitWithCode(exitCode,resultsObj) {
     shell.cd(storedCWD);
     // the TMP_FOLDER.removeCallback() call is throwing an exception, so we explicitly delete it here
     shell.exec('rm -rf ' + TMP_FOLDER.name);
-    
-    callback(exitCode,resultsObj);
+    var logStr = logOutput ? logOutput.join("\n") : null;
+    callback(exitCode,resultsObj,logStr);
 }
 
 function writeMedicLogUrl(url) {
-    console.log("cordova-paramedic :: writing medic log url to project");
+    logMessage("cordova-paramedic: writing medic log url to project");
     var obj = {logurl:url};
     fs.writeFileSync(path.join("www","medic.json"),JSON.stringify(obj));
 }
@@ -170,7 +183,7 @@ function writeMedicLogUrl(url) {
 
 function setConfigStartPage() {
 
-    console.log("cordova-paramedic :: setting app start page to test page");
+    logMessage("cordova-paramedic: setting app start page to test page");
 
     var fileName = 'config.xml';
     var configStr = fs.readFileSync(fileName).toString();
@@ -179,7 +192,7 @@ function setConfigStartPage() {
         fs.writeFileSync(fileName, configStr);
     }
     else {
-        console.error("Oops, could not find config.xml");
+        logMessage("Oops, could not find config.xml");
     }
 }
 
@@ -190,7 +203,7 @@ function startServer() {
         return;
     }
 
-    console.log("cordova-paramedic :: starting local medic server " + platformId);
+    logMessage("cordova-paramedic: starting local medic server " + platformId);
     var server = http.createServer(requestListener);
     server.listen(PORT, '127.0.0.1',function onServerConnect() {
 
@@ -208,21 +221,21 @@ function startServer() {
                 //localtunnel(PORT, tunnelCallback);
                 request.get('http://google.com/', function(e, res, data) {
                     if(e) {
-                        console.error("failed to detect ip address");
+                        logMessage("failed to detect ip address");
                         cleanUpAndExitWithCode(1);
                     }
                     else {
-                        console.log("res.req.connection = " + res.req.connection);
+                        logMessage("res.req.connection = " + res.req.connection);
                         var ip = res.req.connection.localAddress ||
                                  res.req.socket.localAddress;
-                        console.log("Using ip : " + ip);
+                        logMessage("Using ip : " + ip);
                         writeMedicLogUrl("http://" + ip + ":" + PORT);
                         addAndRunPlatform();
                     }
                 });
                 break;
             default :
-                console.log("platform is not supported :: " + platformId);
+                logMessage("platform is not supported :: " + platformId);
                 cleanUpAndExitWithCode(1);
         }
     });
@@ -241,9 +254,9 @@ function requestListener(request, response) {
         request.on('end', function (res) {
             if(body.indexOf("mobilespec")  == 2){ // {\"mobilespec\":{...}}
                 try {
-                    console.log("body = " + body);
+                    //logMessage("body = " + body);
                     var results = JSON.parse(body);
-                    console.log("Results:: ran " + 
+                    logMessage("Results: ran " + 
                         results.mobilespec.specs + 
                         " specs with " + 
                         results.mobilespec.failures + 
@@ -257,17 +270,17 @@ function requestListener(request, response) {
                     
                 }
                 catch(err) {
-                    console.log("parse error :: " + err);
+                    logMessage("parse error :: " + err);
                     cleanUpAndExitWithCode(1);
                 }
             }
             else {
-                console.log("console-log:" + body);
+                logMessage("console-log:" + body);
             }
         });
     }
     else {
-        console.log(request.method);
+        logMessage(request.method);
         response.writeHead(200, { 'Content-Type': 'text/plain'});
         response.write("Hello"); // sanity check to make sure server is running
         response.end();
@@ -276,14 +289,14 @@ function requestListener(request, response) {
 
 function tunnelCallback(err, tunnel) {
     if (err){
-        console.log("failed to create tunnel url, check your internet connectivity.");
+        logMessage("failed to create tunnel url, check your internet connectivity.");
         cleanUpAndExitWithCode(1);
     }
     else {
         // the assigned public url for your tunnel
         // i.e. https://abcdefgjhij.localtunnel.me
         tunneledUrl = tunnel.url;
-        console.log("cordova-paramedic :: tunneledURL = " + tunneledUrl);
+        logMessage("cordova-paramedic: tunneledURL = " + tunneledUrl);
         writeMedicLogUrl(tunneledUrl);
         addAndRunPlatform();
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[43/50] cordova-paramedic git commit: bump version, in prep for npm pub

Posted by pu...@apache.org.
bump version, in prep for npm pub


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

Branch: refs/heads/master
Commit: 09cb6ac438b8997b10c4a9c2a464361196044fc1
Parents: faa4eed
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Apr 9 17:40:19 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Apr 9 17:40:19 2015 -0700

----------------------------------------------------------------------
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/09cb6ac4/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index f6fa9ac..3913387 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "cordova-paramedic",
-  "version": "0.2.0",
+  "version": "0.3.0",
   "description": "Use medic to test a cordova plugin locally",
   "main": "paramedic.js",
   "bin": {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[12/50] cordova-paramedic git commit: Run shelljs scripts in silent mode where possuble

Posted by pu...@apache.org.
Run shelljs scripts in silent mode where possuble


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

Branch: refs/heads/master
Commit: 6815d6685622dd2fc697979838577962564599a5
Parents: 36f3bdc
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Wed Mar 11 13:48:54 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Wed Mar 11 13:48:54 2015 -0700

----------------------------------------------------------------------
 main.js | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/6815d668/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index ff83003..66843c0 100755
--- a/main.js
+++ b/main.js
@@ -54,25 +54,29 @@ function createTempProject() {
 }
 
 function installPlugins() {
-    //console.log("cordova-paramedic :: installing " + plugin);
 
-    var installExitCode = shell.exec('cordova plugin add ' + plugin).code;
+    console.log("cordova-paramedic :: installing " + plugin);
+
+    var installExitCode = shell.exec('cordova plugin add ' + plugin,
+                                     {silent:true}).code;
     if(installExitCode != 0) {
         console.error('Failed to install plugin : ' + plugin);
         cleanUpAndExitWithCode(1);
         return;
     }
 
-    //console.log("cordova-paramedic :: installing " + path.join(plugin,'tests'));
-    installExitCode = shell.exec('cordova plugin add ' + path.join(plugin,'tests')).code;
+    console.log("cordova-paramedic :: installing " + path.join(plugin,'tests'));
+    installExitCode = shell.exec('cordova plugin add ' + path.join(plugin,'tests'),
+                                 {silent:true}).code;
     if(installExitCode != 0) {
         console.error('Failed to find /tests/ for plugin : ' + plugin);
         cleanUpAndExitWithCode(1);
         return;
     }
 
-    //console.log("cordova-paramedic :: installing plugin-test-framework");
-    installExitCode = shell.exec('cordova plugin add https://github.com/apache/cordova-plugin-test-framework').code;
+    console.log("cordova-paramedic :: installing plugin-test-framework");
+    installExitCode = shell.exec('cordova plugin add https://github.com/apache/cordova-plugin-test-framework',
+                                 {silent:true}).code;
     if(installExitCode != 0) {
         console.error('cordova-plugin-test-framework');
         cleanUpAndExitWithCode(1);
@@ -83,9 +87,9 @@ function installPlugins() {
 
 function addAndRunPlatform() {
     setConfigStartPage();
-    //console.log("cordova-paramedic :: adding platform and running");
-    shell.exec('cordova platform add ' + platformId);
-    shell.exec('cordova prepare');
+    console.log("cordova-paramedic :: adding platform");
+    shell.exec('cordova platform add ' + platformId,{silent:true});
+    shell.exec('cordova prepare',{silent:true});
     // limit runtime to 5 minutes
     setTimeout(function(){
         console.error("This test seems to be blocked :: timeout exceeded. Exiting ...");
@@ -93,7 +97,7 @@ function addAndRunPlatform() {
     },(TIMEOUT));
 
     shell.exec('cordova emulate ' + platformId.split("@")[0] + " --phone",
-        {async:true},
+        {async:true,silent:true},
         function(code,output){
             if(code != 0) {
                 console.error("Error: cordova emulate return error code " + code);
@@ -165,8 +169,6 @@ function startServer() {
                 console.log("platform is not supported :: " + platformId);
                 cleanUpAndExitWithCode(1);
         }
-
-        //localtunnel(PORT, tunnelCallback); // TODO
     });
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[11/50] cordova-paramedic git commit: Merge pull request #8 from purplecabbage/AddParams

Posted by pu...@apache.org.
Merge pull request #8 from purplecabbage/AddParams

Add params

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

Branch: refs/heads/master
Commit: 36f3bdc7bb4d40876d8c995072d2c53441a8e50f
Parents: 78c63f3 948f98d
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Mar 10 17:56:49 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Mar 10 17:56:49 2015 -0700

----------------------------------------------------------------------
 main.js | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[04/50] cordova-paramedic git commit: run it

Posted by pu...@apache.org.
run it


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

Branch: refs/heads/master
Commit: 880b927547283f2f80e2ab75f2b0b8ef7390f32d
Parents: 0ad9d9b
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Feb 5 20:25:51 2015 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Feb 5 20:25:51 2015 -0800

----------------------------------------------------------------------
 main.js | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/880b9275/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index d05bdac..808a710 100755
--- a/main.js
+++ b/main.js
@@ -159,6 +159,7 @@ function startServer() {
                              res.req.socket.localAddress;
                     console.log("Using ip : " + ip);
                     writeMedicLogUrl("http://" + ip + ":" + PORT);
+                    addAndRunPlatform();
                 }
             });
         }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[18/50] cordova-paramedic git commit: bump version, add PORT param

Posted by pu...@apache.org.
bump version, add PORT param


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

Branch: refs/heads/master
Commit: aa7d1f66c17b779f930a4d6f3dbfa5b793d1b138
Parents: 031c212
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Mar 20 14:59:03 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Mar 20 14:59:03 2015 -0700

----------------------------------------------------------------------
 main.js      | 7 ++++++-
 package.json | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/aa7d1f66/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index 6c1ddb1..06a1513 100755
--- a/main.js
+++ b/main.js
@@ -10,7 +10,8 @@ var http = require('http'),
 
 var tunneledUrl = "";
 var PORT = 8008;
-var USAGE = "Error missing args. \n Usage: $cordova-paramedic --platform CORDOVA-PLATFORM --plugin PLUGIN-PATH";
+var USAGE = "Error missing args. \n Usage: $cordova-paramedic " +
+            "  --platform CORDOVA-PLATFORM --plugin PLUGIN-PATH [--port PORT]";
 var TEMP_PROJECT_PATH = "tmp";
 var storedCWD = process.cwd();
 var TIMEOUT = 10 * 60 * 1000; // 10 minutes in msec - this will become a param
@@ -39,6 +40,10 @@ function init() {
 
     platformId = argv.platform;
     plugin = argv.plugin;
+    // TODO: validate that it is a number
+    PORT = argv.port || PORT;
+
+
 
     var cordovaResult = shell.exec('cordova --version', {silent:true});
     if(cordovaResult.code) {

http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/aa7d1f66/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 4f3915c..3992e09 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "cordova-paramedic",
-  "version": "0.0.8",
+  "version": "0.0.9",
   "description": "Use medic to test a cordova plugin locally",
   "main": "cordova-paramedic",
   "bin": {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[45/50] cordova-paramedic git commit: version jump and pump

Posted by pu...@apache.org.
version jump and pump


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

Branch: refs/heads/master
Commit: ccd9954492926fb3ee735a9363e556bb4a556007
Parents: de18305
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Wed Apr 15 13:25:02 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Wed Apr 15 13:25:02 2015 -0700

----------------------------------------------------------------------
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/ccd99544/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 3913387..a3125cc 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "cordova-paramedic",
-  "version": "0.3.0",
+  "version": "0.3.1",
   "description": "Use medic to test a cordova plugin locally",
   "main": "paramedic.js",
   "bin": {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[38/50] cordova-paramedic git commit: clean up usage info output

Posted by pu...@apache.org.
clean up usage info output


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

Branch: refs/heads/master
Commit: b275816ecd1542dac8a6fc63fce9829f42d72c27
Parents: 3815760
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Mar 31 18:02:24 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Mar 31 18:02:24 2015 -0700

----------------------------------------------------------------------
 main.js | 17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/b275816e/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index daa329c..ea814c8 100755
--- a/main.js
+++ b/main.js
@@ -6,12 +6,17 @@ var parseArgs = require('minimist'),
 var plugins,
     platformId;
 
-var USAGE = "Error missing args. \n Usage: $cordova-paramedic " +
-            "  --platform CORDOVA-PLATFORM --plugin PLUGIN-PATH [--justbuild ] [--port PORT] [--timeout TIMEOUT] \n" +
-            " CORDOVA-PLATFORM : Which platform to build target\n" +
-            " PLUGIN-PATH : Path to the plugin to install.\n" +
-            " --justbuild : Will not run tests, just verify that the plugin+platform can be built.\n" +
-            " TIMEOUT : time to wait for tests to run, in msecs, default is 10 minutes."; 
+var USAGE = "Error missing args. \n" +
+	"cordova-paramedic --platform PLATFORM --plugin PATH [--justbuild --timeout MSECS --port PORTNUM]" +
+	"`PLATFORM` : the platform id, currently only supports 'ios'\n" +
+	"`PATH` : the relative or absolute path to a plugin folder\n" +
+					"\texpected to have a 'tests' folder.\n" +  
+					"\tYou may specify multiple --plugin flags and they will all\n" + 
+					"\tbe installed and tested together.\n" +
+	"`MSECS` : (optional) time in millisecs to wait for tests to pass|fail \n" +
+			  "\t(defaults to 10 minutes) \n" +
+	"`PORTNUM` : (optional) port to use for posting results from emulator back to paramedic server\n" +
+	"--justbuild : (optional) just builds the project, without running the tests"; 
 
 var argv = parseArgs(process.argv.slice(2));
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[02/50] cordova-paramedic git commit: come on appveyor give me meaningful output

Posted by pu...@apache.org.
come on appveyor give me meaningful output


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

Branch: refs/heads/master
Commit: 1baeca6068a5a06f6fbb51d51d415240ec33ffd9
Parents: 5f1b0d5
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Feb 5 20:02:20 2015 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Feb 5 20:02:20 2015 -0800

----------------------------------------------------------------------
 appveyor.yml | 6 ++++++
 package.json | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/1baeca60/appveyor.yml
----------------------------------------------------------------------
diff --git a/appveyor.yml b/appveyor.yml
index 32508aa..68c8710 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -2,7 +2,13 @@
 # http://www.appveyor.com/docs/appveyor-yml
 
 install:
+  - npm install cordova
+  - npm install ios-sim
   - npm install
+  - npm link
+  - cd ..
+  - git clone https://github.com/apache/cordova-plugin-test-framework
+  - cd cordova-paramedic
 
 build: off
 

http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/1baeca60/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 2e2e12a..126697f 100644
--- a/package.json
+++ b/package.json
@@ -16,7 +16,7 @@
     "test-travis":"npm run test-ios",
     "test-android":"cordova-paramedic --platform android --plugin ../spec/testable-plugin/",
     "test-ios": "cordova-paramedic --platform ios --plugin ../spec/testable-plugin/",
-    "test-wp8": "node ./main.js --platform wp8 --plugin ../spec/testable-plugin/"
+    "test-wp8": "node main.js --platform wp8 --plugin ../spec/testable-plugin/"
 
   },
   "keywords": [


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[41/50] cordova-paramedic git commit: modular, will still fail if you attempt to create multiple emulators ..

Posted by pu...@apache.org.
modular, will still fail if you attempt to create multiple emulators ..


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

Branch: refs/heads/master
Commit: cbdd3c712d9876f34f5705c2157853b702af9f11
Parents: a688d65
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Apr 9 17:39:29 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Apr 9 17:39:29 2015 -0700

----------------------------------------------------------------------
 paramedic.js | 508 ++++++++++++++++++++++++++----------------------------
 1 file changed, 246 insertions(+), 262 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/cbdd3c71/paramedic.js
----------------------------------------------------------------------
diff --git a/paramedic.js b/paramedic.js
index 112592f..69a659d 100644
--- a/paramedic.js
+++ b/paramedic.js
@@ -9,296 +9,280 @@ var http = require('http'),
     tmp = require('tmp'),
     path = require('path');
 
-var tunneledUrl = "";
 var PORT = 8008;
 var TIMEOUT = 10 * 60 * 1000; // 10 minutes in msec - this will become a param
 
-var TMP_FOLDER = null;
-var storedCWD = process.cwd();
 
-var JustBuild = false;
 
-var logMessage;// function
-var logOutput;
-
-var plugins,
-    platformId,
-    callback;
-
-
-exports.run = function(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout,bSilent) {
-
-    if(_platformId && _plugins) {
-
-        platformId = _platformId;
-        // make it an array if it's not
-        plugins = Array.isArray(_plugins) ? _plugins : [_plugins];
-
-        // if we are passed a callback, we will use it, 
-        // otherwise just make a quick and dirty one
-        callback = ( _callback && _callback.apply ) ? _callback : function(resCode,resObj) {
-            process.exit(resCode);
+function ParamedicRunner(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout,bSilent) {
+    this.tunneledUrl = "";
+    this.port = nPort;
+    this.justBuild = bJustBuild;
+    this.plugins = _plugins;
+    this.platformId = _platformId;
+    this.callback = _callback;
+    this.tempFolder = null;
+    this.timeout = msTimeout;
+    
+    if(bSilent) {
+        var logOutput = this.logOutput = [];
+        this.logMessage = function(msg) {
+            logOutput.push(msg);
         };
-
-        JustBuild = bJustBuild == true;
-        PORT = nPort || PORT;
-        TIMEOUT = msTimeout || TIMEOUT;
-        if(bSilent) {
-            logOutput = [];
-            logMessage = function(msg) {
-                logOutput.push(msg);
-            };
-        }
-        else {
-            logMessage = function(msg) {
-                console.log(msg);
-            };
-        }
-
-        var cordovaResult = shell.exec('cordova --version', {silent:true});
-        if(cordovaResult.code) {
-            logMessage(cordovaResult.output);
-            process.exit(cordovaResult.code);
-        }
-
-        createTempProject();
-        installPlugins();
-        startServer();
     }
     else {
-        console.error("Error : Missing platformId and/or plugins");
-    }
-
-}
-
-
-function createTempProject() {
-    TMP_FOLDER = tmp.dirSync();
-    tmp.setGracefulCleanup();
-    
-    logMessage("cordova-paramedic: creating temp project");
-    shell.exec('cordova create ' + TMP_FOLDER.name,{silent:true});
-    shell.cd(TMP_FOLDER.name);
-}
-
-function installSinglePlugin(plugin) {
-    logMessage("cordova-paramedic: installing " + plugin);
-    
-    var pluginPath = path.resolve(storedCWD, plugin);
-
-    var installExitCode = shell.exec('cordova plugin add ' + pluginPath,
-                                     {silent:true}).code;
-    if(installExitCode !== 0) {
-        logMessage('Failed to install plugin : ' + plugin);
-        cleanUpAndExitWithCode(1);
-        return;
+        this.logMessage = function(msg) {
+            console.log(msg);
+        };
     }
 }
 
-
-function installPlugins() {
-
-    for(var n = 0; n < plugins.length; n++) {
-
-        var plugin = plugins[n];
-        installSinglePlugin(plugin);
-
-        if(!JustBuild) {
-            installSinglePlugin(path.join(plugin,"tests"));
+ParamedicRunner.prototype = {
+    run: function() {
+        var cordovaResult = shell.exec('cordova --version', {silent:true});
+        if(cordovaResult.code) {
+            this.logMessage(cordovaResult.output);
+            // this would be fatal
+            process.exit(cordovaResult.code);
+        }
+        this.createTempProject();
+        this.installPlugins();
+        this.startServer();
+    },
+    createTempProject: function() {
+        this.tempFolder = tmp.dirSync();
+        tmp.setGracefulCleanup();
+        this.logMessage("cordova-paramedic: creating temp project at " + this.tempFolder.name);
+        shell.exec('cordova create ' + this.tempFolder.name,{silent:true});
+        shell.cd(this.tempFolder.name);
+    },
+    installSinglePlugin: function(plugin) {
+        this.logMessage("cordova-paramedic: installing " + plugin);
+        var pluginPath = path.resolve(this.storedCWD, plugin);
+        var plugAddCmd = shell.exec('cordova plugin add ' + pluginPath, {silent:true});
+        if(plugAddCmd.code !== 0) {
+            this.logMessage('Failed to install plugin : ' + plugin);
+            this.cleanUpAndExitWithCode(1);
+        }
+    },
+    installPlugins: function() {
+        for(var n = 0; n < this.plugins.length; n++) {
+            var plugin = this.plugins[n];
+            this.installSinglePlugin(plugin);
+            if(!this.justBuild) {
+                this.installSinglePlugin(path.join(plugin,"tests"));
+            }
         }
-    }
 
+        if(!this.justBuild) {
+            this.logMessage("cordova-paramedic: installing plugin-test-framework");
+            var plugAddCmd = shell.exec('cordova plugin add https://github.com/apache/cordova-plugin-test-framework',
+                                         {silent:true});
+            if(plugAddCmd.code !== 0) {
+                this.logMessage('cordova-plugin-test-framework');
+                this.cleanUpAndExitWithCode(1);
+            }
+        }
+    },
+    cleanUpAndExitWithCode: function(exitCode,resultsObj) {
+        shell.cd(this.storedCWD);
+        // the TMP_FOLDER.removeCallback() call is throwing an exception, so we explicitly delete it here
+        shell.exec('rm -rf ' + this.tempFolder.name);
+        var logStr = this.logOutput ? this.logOutput.join("\n") : null;
+        this.callback(exitCode,resultsObj,logStr);
+    },
+    writeMedicLogUrl: function(url) {
+        this.logMessage("cordova-paramedic: writing medic log url to project");
+        var obj = {logurl:url};
+        fs.writeFileSync(path.join("www","medic.json"),JSON.stringify(obj));
+    },
+    setConfigStartPage: function() {
+        this.logMessage("cordova-paramedic: setting app start page to test page");
+        var fileName = 'config.xml';
+        var configStr = fs.readFileSync(fileName).toString();
+        if(configStr) {
+            configStr = configStr.replace("src=\"index.html\"","src=\"cdvtests/index.html\"");
+            fs.writeFileSync(fileName, configStr);
+        }
+        else {
+            this.logMessage("Oops, could not find config.xml");
+        }
+    },
+    startServer: function() {
 
-    if(!JustBuild) {
-        logMessage("cordova-paramedic: installing plugin-test-framework");
-        installExitCode = shell.exec('cordova plugin add https://github.com/apache/cordova-plugin-test-framework',
-                                     {silent:true}).code;
-        if(installExitCode !== 0) {
-            logMessage('cordova-plugin-test-framework');
-            cleanUpAndExitWithCode(1);
+        if(this.justBuild) {
+            this.addAndRunPlatform();
             return;
         }
-    }
-}
-
-function addAndRunPlatform() {
-
-    if(JustBuild) {
-        logMessage("cordova-paramedic: adding platform");
-        shell.exec('cordova platform add ' + platformId,{silent:true});
-        shell.exec('cordova prepare',{silent:true});
-        logMessage("building ...");
-        shell.exec('cordova build ' + platformId.split("@")[0],
-            {async:true,silent:true},
-            function(code,output){
-                if(code !== 0) {
-                    logMessage("Error: cordova build returned error code " + code);
-                    logMessage("output: " + output);
-                    cleanUpAndExitWithCode(1);
-                }
-                else {
-                    cleanUpAndExitWithCode(0);
-                }
+        /// else ....
+
+        this.logMessage("cordova-paramedic: starting local medic server " + this.platformId);
+        var self = this;
+        var server = http.createServer(this.requestListener.bind(this));
+        
+        server.listen(this.port, '127.0.0.1',function onServerConnect() {
+
+            switch(self.platformId) {
+                case "ios"     :  // intentional fallthrough
+                case "windows" :
+                    self.writeMedicLogUrl("http://127.0.0.1:" + self.port);
+                    self.addAndRunPlatform();
+                    break;
+                case "android" :
+                    self.writeMedicLogUrl("http://10.0.2.2:" + self.port);
+                    self.addAndRunPlatform();
+                    break;
+                case "wp8" :
+                    //localtunnel(PORT, tunnelCallback);
+                    request.get('http://google.com/', function(e, res, data) {
+                        if(e) {
+                            self.logMessage("failed to detect ip address");
+                            self.cleanUpAndExitWithCode(1);
+                        }
+                        else {
+                            var ip = res.req.connection.localAddress ||
+                                     res.req.socket.localAddress;
+                            self.logMessage("Using ip : " + ip);
+                            self.writeMedicLogUrl("http://" + ip + ":" + self.port);
+                            self.addAndRunPlatform();
+                        }
+                    });
+                    break;
+                default :
+                    self.logMessage("platform is not supported :: " + self.platformId);
+                    self.cleanUpAndExitWithCode(1);
+                    break;
             }
-        );
-    }
-    else {
-        setConfigStartPage();
-        logMessage("cordova-paramedic: adding platform");
-        shell.exec('cordova platform add ' + platformId,{silent:true});
-        shell.exec('cordova prepare',{silent:true});
-        // limit runtime to TIMEOUT msecs
-        setTimeout(function(){
-            LogMessage("This test seems to be blocked :: timeout exceeded. Exiting ...");
-            cleanUpAndExitWithCode(1);
-        },(TIMEOUT));
-
-        shell.exec('cordova emulate ' + platformId.split("@")[0] + " --phone",
-            {async:true,silent:true},
-            function(code,output){
-                if(code !== 0) {
-                    logMessage("Error: cordova emulate return error code " + code);
-                    logMessage("output: " + output);
-                    cleanUpAndExitWithCode(1);
+        });
+    },
+    requestListener: function(request, response) {
+        var self = this;
+        if (request.method == 'PUT' || request.method == 'POST') {
+            var body = '';
+            request.on('data', function (data) {
+                body += data;
+                // Too much POST data, kill the connection!
+                if (body.length > 1e6) {
+                    req.connection.destroy();
                 }
-            }
-        );
-    }
-}
-
-function cleanUpAndExitWithCode(exitCode,resultsObj) {
-    shell.cd(storedCWD);
-    // the TMP_FOLDER.removeCallback() call is throwing an exception, so we explicitly delete it here
-    shell.exec('rm -rf ' + TMP_FOLDER.name);
-    var logStr = logOutput ? logOutput.join("\n") : null;
-    callback(exitCode,resultsObj,logStr);
-}
-
-function writeMedicLogUrl(url) {
-    logMessage("cordova-paramedic: writing medic log url to project");
-    var obj = {logurl:url};
-    fs.writeFileSync(path.join("www","medic.json"),JSON.stringify(obj));
-}
-
-
-function setConfigStartPage() {
-
-    logMessage("cordova-paramedic: setting app start page to test page");
-
-    var fileName = 'config.xml';
-    var configStr = fs.readFileSync(fileName).toString();
-    if(configStr) {
-        configStr = configStr.replace("src=\"index.html\"","src=\"cdvtests/index.html\"");
-        fs.writeFileSync(fileName, configStr);
-    }
-    else {
-        logMessage("Oops, could not find config.xml");
-    }
-}
-
-function startServer() {
-
-    if(JustBuild) {
-        addAndRunPlatform();
-        return;
-    }
-
-    logMessage("cordova-paramedic: starting local medic server " + platformId);
-    var server = http.createServer(requestListener);
-    server.listen(PORT, '127.0.0.1',function onServerConnect() {
-
-        switch(platformId) {
-            case "ios"     :  // intentional fallthrough
-            case "windows" :
-                writeMedicLogUrl("http://127.0.0.1:" + PORT);
-                addAndRunPlatform();
-                break;
-            case "android" :
-                writeMedicLogUrl("http://10.0.2.2:" + PORT);
-                addAndRunPlatform();
-                break;
-            case "wp8" :
-                //localtunnel(PORT, tunnelCallback);
-                request.get('http://google.com/', function(e, res, data) {
-                    if(e) {
-                        logMessage("failed to detect ip address");
-                        cleanUpAndExitWithCode(1);
+            });
+            request.on('end', function (res) {
+                if(body.indexOf("mobilespec")  == 2){ // {\"mobilespec\":{...}}
+                    try {
+                        //logMessage("body = " + body);
+                        var results = JSON.parse(body);
+                        self.logMessage("Results: ran " + 
+                                        results.mobilespec.specs + 
+                                        " specs with " + 
+                                        results.mobilespec.failures + 
+                                        " failures");
+                        if(results.mobilespec.failures > 0) {
+                            self.cleanUpAndExitWithCode(1,results);
+                        }
+                        else {
+                            self.cleanUpAndExitWithCode(0,results);
+                        }
+                        
                     }
-                    else {
-                        logMessage("res.req.connection = " + res.req.connection);
-                        var ip = res.req.connection.localAddress ||
-                                 res.req.socket.localAddress;
-                        logMessage("Using ip : " + ip);
-                        writeMedicLogUrl("http://" + ip + ":" + PORT);
-                        addAndRunPlatform();
+                    catch(err) {
+                        self.logMessage("parse error :: " + err);
+                        self.cleanUpAndExitWithCode(1);
                     }
-                });
-                break;
-            default :
-                logMessage("platform is not supported :: " + platformId);
-                cleanUpAndExitWithCode(1);
+                }
+                else {
+                    self.logMessage("console-log:" + body);
+                }
+            });
         }
-    });
-}
-
-function requestListener(request, response) {
-    if (request.method == 'PUT' || request.method == 'POST') {
-        var body = '';
-        request.on('data', function (data) {
-            body += data;
-            // Too much POST data, kill the connection!
-            if (body.length > 1e6) {
-                req.connection.destroy();
-            }
-        });
-        request.on('end', function (res) {
-            if(body.indexOf("mobilespec")  == 2){ // {\"mobilespec\":{...}}
-                try {
-                    //logMessage("body = " + body);
-                    var results = JSON.parse(body);
-                    logMessage("Results: ran " + 
-                        results.mobilespec.specs + 
-                        " specs with " + 
-                        results.mobilespec.failures + 
-                        " failures");
-                    if(results.mobilespec.failures > 0) {
-                        cleanUpAndExitWithCode(1,results);
+        else {
+            self.logMessage(request.method);
+            response.writeHead(200, { 'Content-Type': 'text/plain'});
+            response.write("Hello"); // sanity check to make sure server is running
+            response.end();
+        }
+    },
+    addAndRunPlatform: function() {
+        var self = this;
+        if(self.justBuild) {
+            self.logMessage("cordova-paramedic: adding platform");
+            shell.exec('cordova platform add ' + self.platformId,{silent:true});
+            shell.exec('cordova prepare',{silent:true});
+            self.logMessage("building ...");
+            
+            shell.exec('cordova build ' + self.platformId.split("@")[0],
+                {async:true,silent:true},
+                function(code,output){
+                    if(code !== 0) {
+                        self.logMessage("Error: cordova build returned error code " + code);
+                        self.logMessage("output: " + output);
+                        self.cleanUpAndExitWithCode(1);
                     }
                     else {
-                        cleanUpAndExitWithCode(0,results);
+                        self.cleanUpAndExitWithCode(0);
                     }
-                    
                 }
-                catch(err) {
-                    logMessage("parse error :: " + err);
-                    cleanUpAndExitWithCode(1);
+            );
+        }
+        else {
+            self.setConfigStartPage();
+            self.logMessage("cordova-paramedic: adding platform");
+            shell.exec('cordova platform add ' + self.platformId,{silent:true});
+            shell.exec('cordova prepare',{silent:true});
+            // limit runtime to TIMEOUT msecs
+            setTimeout(function(){
+                self.logMessage("This test seems to be blocked :: timeout exceeded. Exiting ...");
+                self.cleanUpAndExitWithCode(1);
+            },self.timeout);
+
+            shell.exec('cordova emulate ' + self.platformId.split("@")[0] + " --phone",
+                {async:true,silent:true},
+                function(code,output){
+                    if(code !== 0) {
+                        self.logMessage("Error: cordova emulate return error code " + code);
+                        self.logMessage("output: " + output);
+                        self.cleanUpAndExitWithCode(1);
+                    }
                 }
-            }
-            else {
-                logMessage("console-log:" + body);
-            }
-        });
-    }
-    else {
-        logMessage(request.method);
-        response.writeHead(200, { 'Content-Type': 'text/plain'});
-        response.write("Hello"); // sanity check to make sure server is running
-        response.end();
+            );
+        }
+    },
+    tunnelCallback: function(err, tunnel) {
+        if (err){
+            this.logMessage("failed to create tunnel url, check your internet connectivity.");
+            this.cleanUpAndExitWithCode(1);
+        }
+        else {
+            // the assigned public url for your tunnel
+            // i.e. https://abcdefgjhij.localtunnel.me
+            this.tunneledUrl = tunnel.url;
+            this.logMessage("cordova-paramedic: tunneledURL = " + tunneledUrl);
+            this.writeMedicLogUrl(tunneledUrl);
+            this.addAndRunPlatform();
+        }
     }
-}
+};
 
-function tunnelCallback(err, tunnel) {
-    if (err){
-        logMessage("failed to create tunnel url, check your internet connectivity.");
-        cleanUpAndExitWithCode(1);
+var storedCWD =  null;
+exports.run = function(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout,bSilent) {
+
+    storedCWD = storedCWD || process.cwd();
+    if(_platformId && _plugins) {
+
+        // make it an array if it's not
+        var plugins = Array.isArray(_plugins) ? _plugins : [_plugins];
+
+        // if we are passed a callback, we will use it, 
+        // otherwise just make a quick and dirty one
+        var callback = ( _callback && _callback.apply ) ? _callback : function(resCode,resObj) {
+            process.exit(resCode);
+        };
+
+        var runner = new ParamedicRunner(_platformId, plugins, callback, !!bJustBuild,
+                                         nPort || PORT, msTimeout || TIMEOUT, !!bSilent);
+        runner.storedCWD = storedCWD;
+        return runner.run();
     }
     else {
-        // the assigned public url for your tunnel
-        // i.e. https://abcdefgjhij.localtunnel.me
-        tunneledUrl = tunnel.url;
-        logMessage("cordova-paramedic: tunneledURL = " + tunneledUrl);
-        writeMedicLogUrl(tunneledUrl);
-        addAndRunPlatform();
+        console.error("Error : Missing platformId and/or plugins");
     }
-}
-
+};


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[19/50] cordova-paramedic git commit: added justbuild param, set to truthy to exit without running installing all the tests. This closes #12

Posted by pu...@apache.org.
added justbuild param, set to truthy to exit without running installing all the tests. This closes #12


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

Branch: refs/heads/master
Commit: d83fdbcc024c5f48a62f1863cee8c05bf3bc6637
Parents: aa7d1f6
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Mar 20 15:31:41 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Mar 20 15:33:56 2015 -0700

----------------------------------------------------------------------
 main.js | 122 +++++++++++++++++++++++++++++++++++++----------------------
 1 file changed, 76 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/d83fdbcc/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index 06a1513..c23f24d 100755
--- a/main.js
+++ b/main.js
@@ -10,28 +10,27 @@ var http = require('http'),
 
 var tunneledUrl = "";
 var PORT = 8008;
+var TIMEOUT = 10 * 60 * 1000; // 10 minutes in msec - this will become a param
 var USAGE = "Error missing args. \n Usage: $cordova-paramedic " +
             "  --platform CORDOVA-PLATFORM --plugin PLUGIN-PATH [--port PORT]";
+
 var TEMP_PROJECT_PATH = "tmp";
 var storedCWD = process.cwd();
-var TIMEOUT = 10 * 60 * 1000; // 10 minutes in msec - this will become a param
+
+var JustBuild = false;
 
 var plugin,platformId;
 
-run();
 
-// main program here 
-function run() {
+(function run_main() { // main program here 
     init();
     createTempProject();
     installPlugins();
     startServer();
-}
+})();
 
 function init() {
-    var argv = parseArgs(process.argv.slice(2),{default:{
-        timeout:TIMEOUT
-    }});
+    var argv = parseArgs(process.argv.slice(2));
 
     if(!argv.platform || !argv.plugin) {
         console.log(USAGE);
@@ -40,10 +39,11 @@ function init() {
 
     platformId = argv.platform;
     plugin = argv.plugin;
-    // TODO: validate that it is a number
-    PORT = argv.port || PORT;
-
 
+    // TODO: validate that port is a number
+    PORT = argv.port || PORT;
+    JustBuild = argv.justbuild || JustBuild; 
+    TIMEOUT = argv.timeout || TIMEOUT;
 
     var cordovaResult = shell.exec('cordova --version', {silent:true});
     if(cordovaResult.code) {
@@ -70,47 +70,72 @@ function installPlugins() {
         return;
     }
 
-    console.log("cordova-paramedic :: installing " + path.join(plugin,'tests'));
-    installExitCode = shell.exec('cordova plugin add ' + path.join(plugin,'tests'),
-                                 {silent:true}).code;
-    if(installExitCode != 0) {
-        console.error('Failed to find /tests/ for plugin : ' + plugin);
-        cleanUpAndExitWithCode(1);
-        return;
-    }
+    if(!JustBuild) { 
+        // we only install the test stuff if needed
+        console.log("cordova-paramedic :: installing " + path.join(plugin,'tests'));
+        installExitCode = shell.exec('cordova plugin add ' + path.join(plugin,'tests'),
+                                     {silent:true}).code;
+        if(installExitCode != 0) {
+            console.error('Failed to find /tests/ for plugin : ' + plugin);
+            cleanUpAndExitWithCode(1);
+            return;
+        }
 
-    console.log("cordova-paramedic :: installing plugin-test-framework");
-    installExitCode = shell.exec('cordova plugin add https://github.com/apache/cordova-plugin-test-framework',
-                                 {silent:true}).code;
-    if(installExitCode != 0) {
-        console.error('cordova-plugin-test-framework');
-        cleanUpAndExitWithCode(1);
-        return;
+        console.log("cordova-paramedic :: installing plugin-test-framework");
+        installExitCode = shell.exec('cordova plugin add https://github.com/apache/cordova-plugin-test-framework',
+                                     {silent:true}).code;
+        if(installExitCode != 0) {
+            console.error('cordova-plugin-test-framework');
+            cleanUpAndExitWithCode(1);
+            return;
+        }
     }
-
 }
 
 function addAndRunPlatform() {
-    setConfigStartPage();
-    console.log("cordova-paramedic :: adding platform");
-    shell.exec('cordova platform add ' + platformId,{silent:true});
-    shell.exec('cordova prepare',{silent:true});
-    // limit runtime to TIMEOUT msecs
-    setTimeout(function(){
-        console.error("This test seems to be blocked :: timeout exceeded. Exiting ...");
-        cleanUpAndExitWithCode(1);
-    },(TIMEOUT));
-
-    shell.exec('cordova emulate ' + platformId.split("@")[0] + " --phone",
-        {async:true,silent:true},
-        function(code,output){
-            if(code != 0) {
-                console.error("Error: cordova emulate return error code " + code);
-                console.log("output: " + output);
-                cleanUpAndExitWithCode(1);
+
+    if(JustBuild) {
+        console.log("cordova-paramedic :: adding platform");
+        shell.exec('cordova platform add ' + platformId,{silent:true});
+        shell.exec('cordova prepare',{silent:true});
+        console.log("building ...");
+        shell.exec('cordova build ' + platformId.split("@")[0],
+            {async:true,silent:true},
+            function(code,output){
+                if(code != 0) {
+                    console.error("Error: cordova build returned error code " + code);
+                    console.log("output: " + output);
+                    cleanUpAndExitWithCode(1);
+                }
+                else {
+                    console.log("lookin' good!");
+                    cleanUpAndExitWithCode(0);
+                }
             }
-        }
-    );
+        );
+    }
+    else {
+        setConfigStartPage();
+        console.log("cordova-paramedic :: adding platform");
+        shell.exec('cordova platform add ' + platformId,{silent:true});
+        shell.exec('cordova prepare',{silent:true});
+        // limit runtime to TIMEOUT msecs
+        setTimeout(function(){
+            console.error("This test seems to be blocked :: timeout exceeded. Exiting ...");
+            cleanUpAndExitWithCode(1);
+        },(TIMEOUT));
+
+        shell.exec('cordova emulate ' + platformId.split("@")[0] + " --phone",
+            {async:true,silent:true},
+            function(code,output){
+                if(code != 0) {
+                    console.error("Error: cordova emulate return error code " + code);
+                    console.log("output: " + output);
+                    cleanUpAndExitWithCode(1);
+                }
+            }
+        );
+    }
 }
 
 function cleanUpAndExitWithCode(exitCode) {
@@ -142,6 +167,11 @@ function setConfigStartPage() {
 
 function startServer() {
 
+    if(JustBuild) {
+        addAndRunPlatform();
+        return;
+    }
+
     console.log("cordova-paramedic :: starting local medic server " + platformId);
     var server = http.createServer(requestListener);
     server.listen(PORT, '127.0.0.1',function onServerConnect() {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[07/50] cordova-paramedic git commit: appveyor failing ... path issue

Posted by pu...@apache.org.
appveyor failing ... path issue


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

Branch: refs/heads/master
Commit: 749693a80b10cd694b4ac944b8b73c1eba042561
Parents: 51180a9
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Feb 12 17:29:02 2015 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Feb 12 17:29:02 2015 -0800

----------------------------------------------------------------------
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/749693a8/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 4e4af32..bcf97b7 100644
--- a/package.json
+++ b/package.json
@@ -16,7 +16,7 @@
     "test-travis":"npm run test-ios",
     "test-android":"cordova-paramedic --platform android --plugin ../spec/testable-plugin/",
     "test-ios": "cordova-paramedic --platform ios --plugin ../spec/testable-plugin/",
-    "test-windows" : "node main.js --platform windows --plugin ./spec/testable-plugin/",
+    "test-windows" : "node main.js --platform windows --plugin ../spec/testable-plugin/",
     "test-wp8": "node main.js --platform wp8 --plugin ./spec/testable-plugin/"
 
   },


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[48/50] cordova-paramedic git commit: added support for --browserify

Posted by pu...@apache.org.
added support for --browserify


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

Branch: refs/heads/master
Commit: 0818793d1e35d7ece9bec250c593ef6d192165cc
Parents: c55403b
Author: Steve Gill <st...@gmail.com>
Authored: Tue May 19 17:27:06 2015 -0700
Committer: Steve Gill <st...@gmail.com>
Committed: Tue May 19 17:27:06 2015 -0700

----------------------------------------------------------------------
 main.js      |  7 ++++---
 paramedic.js | 12 +++++++++---
 2 files changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/0818793d/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index db3bd3e..03a1a20 100755
--- a/main.js
+++ b/main.js
@@ -7,7 +7,7 @@ var plugins,
     platformId;
 
 var USAGE = "Error missing args. \n" +
-	"cordova-paramedic --platform PLATFORM --plugin PATH [--justbuild --timeout MSECS --port PORTNUM]" +
+	"cordova-paramedic --platform PLATFORM --plugin PATH [--justbuild --timeout MSECS --port PORTNUM --browserify]" +
 	"`PLATFORM` : the platform id, currently only supports 'ios'\n" +
 	"`PATH` : the relative or absolute path to a plugin folder\n" +
 					"\texpected to have a 'tests' folder.\n" +  
@@ -16,7 +16,8 @@ var USAGE = "Error missing args. \n" +
 	"`MSECS` : (optional) time in millisecs to wait for tests to pass|fail \n" +
 			  "\t(defaults to 10 minutes) \n" +
 	"`PORTNUM` : (optional) port to use for posting results from emulator back to paramedic server\n" +
-	"--justbuild : (optional) just builds the project, without running the tests"; 
+	"--justbuild : (optional) just builds the project, without running the tests \n" + 
+    "--browserify : (optional) plugins are browserified into cordova.js"; 
 
 var argv = parseArgs(process.argv.slice(2));
 
@@ -36,5 +37,5 @@ var onComplete = function(resCode,resObj,logStr) {
 	process.exit(resCode);
 };
 
-paramedic.run(argv.platform, argv.plugin, onComplete, argv.justbuild, argv.port, argv.timeout,false);
+paramedic.run(argv.platform, argv.plugin, onComplete, argv.justbuild, argv.port, argv.timeout, argv.browserify, false);
 

http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/0818793d/paramedic.js
----------------------------------------------------------------------
diff --git a/paramedic.js b/paramedic.js
index ad9d787..09d7aed 100644
--- a/paramedic.js
+++ b/paramedic.js
@@ -14,7 +14,7 @@ var TIMEOUT = 10 * 60 * 1000; // 10 minutes in msec - this will become a param
 
 
 
-function ParamedicRunner(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout,bSilent) {
+function ParamedicRunner(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeout,browserify,bSilent) {
     this.tunneledUrl = "";
     this.port = nPort;
     this.justBuild = bJustBuild;
@@ -23,6 +23,12 @@ function ParamedicRunner(_platformId,_plugins,_callback,bJustBuild,nPort,msTimeo
     this.callback = _callback;
     this.tempFolder = null;
     this.timeout = msTimeout;
+
+    if(browserify) {
+        this.browserify = "--browserify";
+    } else {
+        this.browserify = '';
+    }
     
     if(bSilent) {
         var logOutput = this.logOutput = [];
@@ -214,7 +220,7 @@ ParamedicRunner.prototype = {
         if(self.justBuild) {
             self.logMessage("cordova-paramedic: adding platform");
             shell.exec('cordova platform add ' + self.platformId,{silent:true});
-            shell.exec('cordova prepare',{silent:true});
+            shell.exec('cordova prepare '+ self.browserify,{silent:true});
             self.logMessage("building ...");
             
             shell.exec('cordova build ' + self.platformId.split("@")[0],
@@ -235,7 +241,7 @@ ParamedicRunner.prototype = {
             self.setConfigStartPage();
             self.logMessage("cordova-paramedic: adding platform");
             shell.exec('cordova platform add ' + self.platformId,{silent:true});
-            shell.exec('cordova prepare',{silent:true});
+            shell.exec('cordova prepare '+ self.browserify,{silent:true});
 
             shell.exec('cordova emulate ' + self.platformId.split("@")[0] + " --phone",
                 {async:true,silent:true},


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[17/50] cordova-paramedic git commit: ignore that annoying debug log file

Posted by pu...@apache.org.
ignore that annoying debug log file


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

Branch: refs/heads/master
Commit: 031c2122b44be4674a20ab977c25f45892aae40e
Parents: a5fcab0
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Mar 13 18:10:31 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Mar 13 18:10:31 2015 -0700

----------------------------------------------------------------------
 .gitignore | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/031c2122/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index 3b32cda..4081bfd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,6 @@
 .DS_Store
 
+npm-debug.log
+
 tmp/
 node_modules/
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[06/50] cordova-paramedic git commit: cleanup platformId checks and testing windows as target

Posted by pu...@apache.org.
cleanup platformId checks and testing windows as target


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

Branch: refs/heads/master
Commit: 51180a96edab5f7ed8ddad17178c5ec6680d46ef
Parents: 962db83
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Feb 12 17:17:20 2015 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Feb 12 17:17:20 2015 -0800

----------------------------------------------------------------------
 main.js | 62 ++++++++++++++++++++++++++++++------------------------------
 1 file changed, 31 insertions(+), 31 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/51180a96/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index 808a710..0655261 100755
--- a/main.js
+++ b/main.js
@@ -1,7 +1,7 @@
 #!/usr/bin/env node
 
 var http = require('http'),
-    //localtunnel = require('localtunnel'),
+    localtunnel = require('localtunnel'),
     parseArgs = require('minimist'),
     shell = require('shelljs'),
     fs = require('fs'),
@@ -133,41 +133,41 @@ function setConfigStartPage() {
 }
 
 function startServer() {
+
     console.log("cordova-paramedic :: starting local medic server " + platformId);
     var server = http.createServer(requestListener);
     server.listen(PORT, '127.0.0.1',function onServerConnect() {
 
-        if(platformId == "ios") {
-            console.log('platform is ios');
-            writeMedicLogUrl("http://127.0.0.1:" + PORT);
-            addAndRunPlatform();
-        }
-        else if(platformId == "android") {
-            console.log('platform is android');
-            writeMedicLogUrl("http://127.0.0.1:" + PORT);
-            addAndRunPlatform();
-        }
-        else if(platformId == "wp8") {
-            request.get('http://google.com/', function(e, res, data) {
-                if(e) {
-                    console.error("failed to detect ip address");
-                    cleanUpAndExitWithCode(1);
-                }
-                else {
-                    console.log("res.req.connection = " + res.req.connection);
-                    var ip = res.req.connection.localAddress ||
-                             res.req.socket.localAddress;
-                    console.log("Using ip : " + ip);
-                    writeMedicLogUrl("http://" + ip + ":" + PORT);
-                    addAndRunPlatform();
-                }
-            });
-        }
-        else {
-            //localtunnel(PORT, tunnelCallback); // TODO
-            console.log("platform is not supported :: " + platformId);
-            cleanUpAndExitWithCode(1);
+        switch(platformId) {
+            case "ios"     :  // intentional fallthrough
+            case "android" :
+            case "windows" :
+                writeMedicLogUrl("http://127.0.0.1:" + PORT);
+                addAndRunPlatform();
+                break;
+            case "wp8" :
+                localtunnel(PORT, tunnelCallback);
+                // request.get('http://google.com/', function(e, res, data) {
+                //     if(e) {
+                //         console.error("failed to detect ip address");
+                //         cleanUpAndExitWithCode(1);
+                //     }
+                //     else {
+                //         console.log("res.req.connection = " + res.req.connection);
+                //         var ip = res.req.connection.localAddress ||
+                //                  res.req.socket.localAddress;
+                //         console.log("Using ip : " + ip);
+                //         writeMedicLogUrl("http://" + ip + ":" + PORT);
+                //         addAndRunPlatform();
+                //     }
+                // });
+                break;
+            default :
+                console.log("platform is not supported :: " + platformId);
+                cleanUpAndExitWithCode(1);
         }
+
+        //localtunnel(PORT, tunnelCallback); // TODO
     });
 }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[37/50] cordova-paramedic git commit: Bump version for publish. API changed

Posted by pu...@apache.org.
Bump version for publish. API changed


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

Branch: refs/heads/master
Commit: 3815760cf881dcc8ddfd3b0467ed3cf0967d01b7
Parents: 1c739c9
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Mar 31 17:31:35 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Mar 31 17:31:35 2015 -0700

----------------------------------------------------------------------
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/3815760c/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 5df4aa2..2984806 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "cordova-paramedic",
-  "version": "0.1.0",
+  "version": "0.2.0",
   "description": "Use medic to test a cordova plugin locally",
   "main": "paramedic.js",
   "bin": {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[22/50] cordova-paramedic git commit: now supports multiple plugins, some jshint suggested cleanups

Posted by pu...@apache.org.
now supports multiple plugins, some jshint suggested cleanups


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

Branch: refs/heads/master
Commit: 8e90ba4fa80120af67abd798a88ebd26e34f719e
Parents: d83fdbc
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Mar 20 17:29:43 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Mar 20 17:29:43 2015 -0700

----------------------------------------------------------------------
 main.js | 43 ++++++++++++++++++++++++-------------------
 1 file changed, 24 insertions(+), 19 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/8e90ba4f/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index c23f24d..312dc26 100755
--- a/main.js
+++ b/main.js
@@ -19,7 +19,8 @@ var storedCWD = process.cwd();
 
 var JustBuild = false;
 
-var plugin,platformId;
+var plugins,
+    platformId;
 
 
 (function run_main() { // main program here 
@@ -38,7 +39,9 @@ function init() {
     }
 
     platformId = argv.platform;
-    plugin = argv.plugin;
+    plugins = argv.plugin;
+    plugins = Array.isArray(plugins) ? plugins : [plugins];
+
 
     // TODO: validate that port is a number
     PORT = argv.port || PORT;
@@ -58,33 +61,36 @@ function createTempProject() {
     shell.cd(TEMP_PROJECT_PATH);
 }
 
-function installPlugins() {
-
+function installSinglePlugin(plugin) {
     console.log("cordova-paramedic :: installing " + plugin);
 
     var installExitCode = shell.exec('cordova plugin add ' + plugin,
                                      {silent:true}).code;
-    if(installExitCode != 0) {
+    if(installExitCode !== 0) {
         console.error('Failed to install plugin : ' + plugin);
         cleanUpAndExitWithCode(1);
         return;
     }
+}
 
-    if(!JustBuild) { 
-        // we only install the test stuff if needed
-        console.log("cordova-paramedic :: installing " + path.join(plugin,'tests'));
-        installExitCode = shell.exec('cordova plugin add ' + path.join(plugin,'tests'),
-                                     {silent:true}).code;
-        if(installExitCode != 0) {
-            console.error('Failed to find /tests/ for plugin : ' + plugin);
-            cleanUpAndExitWithCode(1);
-            return;
+function installPlugins() {
+
+    for(var n = 0; n < plugins.length; n++) {
+
+        var plugin = plugins[n];
+        installSinglePlugin(plugin);
+
+        if(!JustBuild) {
+            installSinglePlugin(path.join(plugin,"tests"));
         }
+    }
+
 
+    if(!JustBuild) {
         console.log("cordova-paramedic :: installing plugin-test-framework");
         installExitCode = shell.exec('cordova plugin add https://github.com/apache/cordova-plugin-test-framework',
                                      {silent:true}).code;
-        if(installExitCode != 0) {
+        if(installExitCode !== 0) {
             console.error('cordova-plugin-test-framework');
             cleanUpAndExitWithCode(1);
             return;
@@ -102,7 +108,7 @@ function addAndRunPlatform() {
         shell.exec('cordova build ' + platformId.split("@")[0],
             {async:true,silent:true},
             function(code,output){
-                if(code != 0) {
+                if(code !== 0) {
                     console.error("Error: cordova build returned error code " + code);
                     console.log("output: " + output);
                     cleanUpAndExitWithCode(1);
@@ -128,7 +134,7 @@ function addAndRunPlatform() {
         shell.exec('cordova emulate ' + platformId.split("@")[0] + " --phone",
             {async:true,silent:true},
             function(code,output){
-                if(code != 0) {
+                if(code !== 0) {
                     console.error("Error: cordova emulate return error code " + code);
                     console.log("output: " + output);
                     cleanUpAndExitWithCode(1);
@@ -186,7 +192,6 @@ function startServer() {
                 writeMedicLogUrl("http://10.0.2.2:" + PORT);
                 addAndRunPlatform();
                 break;
-                break;
             case "wp8" :
                 //localtunnel(PORT, tunnelCallback);
                 request.get('http://google.com/', function(e, res, data) {
@@ -259,7 +264,7 @@ function requestListener(request, response) {
 
 function tunnelCallback(err, tunnel) {
     if (err){
-        console.log("failed to create tunnel url, check your internet connectivity.")
+        console.log("failed to create tunnel url, check your internet connectivity.");
         cleanUpAndExitWithCode(1);
     }
     else {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[20/50] cordova-paramedic git commit: Added tmp module support.

Posted by pu...@apache.org.
Added tmp module support.


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

Branch: refs/heads/master
Commit: 21dc126fa2d91222dbc2bb0660a59757d96f09b4
Parents: d83fdbc
Author: Shazron Abdullah <sh...@apache.org>
Authored: Fri Mar 20 16:45:31 2015 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Fri Mar 20 16:45:31 2015 -0700

----------------------------------------------------------------------
 main.js      | 13 ++++++++++---
 package.json |  3 ++-
 2 files changed, 12 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/21dc126f/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index c23f24d..b197a0f 100755
--- a/main.js
+++ b/main.js
@@ -6,6 +6,7 @@ var http = require('http'),
     shell = require('shelljs'),
     fs = require('fs'),
     request = require('request'),
+    tmp = require('tmp'),
     path = require('path');
 
 var tunneledUrl = "";
@@ -14,7 +15,7 @@ var TIMEOUT = 10 * 60 * 1000; // 10 minutes in msec - this will become a param
 var USAGE = "Error missing args. \n Usage: $cordova-paramedic " +
             "  --platform CORDOVA-PLATFORM --plugin PLUGIN-PATH [--port PORT]";
 
-var TEMP_PROJECT_PATH = "tmp";
+var TMP_FOLDER = null;
 var storedCWD = process.cwd();
 
 var JustBuild = false;
@@ -53,9 +54,12 @@ function init() {
 }
 
 function createTempProject() {
+    TMP_FOLDER = tmp.dirSync();
+    tmp.setGracefulCleanup();
+    
     console.log("cordova-paramedic :: creating temp project");
-    shell.exec('cordova create ' + TEMP_PROJECT_PATH);
-    shell.cd(TEMP_PROJECT_PATH);
+    shell.exec('cordova create ' + TMP_FOLDER.name);
+    shell.cd(TMP_FOLDER.name);
 }
 
 function installPlugins() {
@@ -140,6 +144,9 @@ function addAndRunPlatform() {
 
 function cleanUpAndExitWithCode(exitCode) {
     shell.cd(storedCWD);
+    // the TMP_FOLDER.removeCallback() call is throwing an exception, so we explicitly delete it here
+    shell.exec('rm -rf ' + TMP_FOLDER.name);
+    
     process.exit(exitCode);
 }
 

http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/21dc126f/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 3992e09..03ca09d 100644
--- a/package.json
+++ b/package.json
@@ -31,6 +31,7 @@
     "localtunnel": "~1.5.0",
     "minimist": "~1.1.0",
     "request": "^2.53.0",
-    "shelljs": "~0.3.0"
+    "shelljs": "~0.3.0",
+    "tmp": "0.0.25"
   }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[10/50] cordova-paramedic git commit: remove defaults for required params

Posted by pu...@apache.org.
remove defaults for required params


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

Branch: refs/heads/master
Commit: 948f98d7f5cc783fa672b02f036a0d9e8efd1b28
Parents: 8ddb84a
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Mar 10 17:56:22 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Mar 10 17:56:22 2015 -0700

----------------------------------------------------------------------
 main.js | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/948f98d7/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index dbf4c2e..ff83003 100755
--- a/main.js
+++ b/main.js
@@ -29,8 +29,6 @@ function run() {
 
 function init() {
     var argv = parseArgs(process.argv.slice(2),{default:{
-        plugin:".",
-        platform:"",
         timeout:TIMEOUT
     }});
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[50/50] cordova-paramedic git commit: bump version

Posted by pu...@apache.org.
bump version


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

Branch: refs/heads/master
Commit: 7ed83daa0f7ba30f8c9f5808eed8674371c2d0a6
Parents: b81f56c
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Aug 21 16:20:30 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Aug 21 16:20:30 2015 -0700

----------------------------------------------------------------------
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/7ed83daa/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index a3125cc..16955a3 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "cordova-paramedic",
-  "version": "0.3.1",
+  "version": "0.3.2",
   "description": "Use medic to test a cordova plugin locally",
   "main": "paramedic.js",
   "bin": {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[13/50] cordova-paramedic git commit: Remove magic, ios default, skip unused clone

Posted by pu...@apache.org.
Remove magic, ios default, skip unused clone


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

Branch: refs/heads/master
Commit: f35c6cba0c8e13d7472f0ed27a4a2a3ed45156ab
Parents: 6815d66
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Wed Mar 11 13:54:21 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Wed Mar 11 13:54:21 2015 -0700

----------------------------------------------------------------------
 .travis.yml  | 1 -
 main.js      | 2 +-
 package.json | 6 +++---
 3 files changed, 4 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/f35c6cba/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 2bfb4df..218c567 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,7 +8,6 @@ install:
   - npm install
   - npm link
   - cd ..
-  - git clone https://github.com/apache/cordova-plugin-test-framework
   - cd cordova-paramedic
 script:
   - npm run test-travis

http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/f35c6cba/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index 66843c0..eff040e 100755
--- a/main.js
+++ b/main.js
@@ -90,7 +90,7 @@ function addAndRunPlatform() {
     console.log("cordova-paramedic :: adding platform");
     shell.exec('cordova platform add ' + platformId,{silent:true});
     shell.exec('cordova prepare',{silent:true});
-    // limit runtime to 5 minutes
+    // limit runtime to TIMEOUT msecs
     setTimeout(function(){
         console.error("This test seems to be blocked :: timeout exceeded. Exiting ...");
         cleanUpAndExitWithCode(1);

http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/f35c6cba/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index bcf97b7..4f3915c 100644
--- a/package.json
+++ b/package.json
@@ -11,11 +11,11 @@
     "url": "git://github.com/purplecabbage/cordova-paramedic.git"
   },
   "scripts": {
-    "test":"npm run test-wp8",
+    "test":"npm run test-ios",
     "test-appveyor":"npm run test-windows",
     "test-travis":"npm run test-ios",
-    "test-android":"cordova-paramedic --platform android --plugin ../spec/testable-plugin/",
-    "test-ios": "cordova-paramedic --platform ios --plugin ../spec/testable-plugin/",
+    "test-android":"node main.js --platform android --plugin ../spec/testable-plugin/",
+    "test-ios": "node main.js --platform ios --plugin ../spec/testable-plugin/",
     "test-windows" : "node main.js --platform windows --plugin ../spec/testable-plugin/",
     "test-wp8": "node main.js --platform wp8 --plugin ./spec/testable-plugin/"
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[09/50] cordova-paramedic git commit: #5 accept timeout param or use default

Posted by pu...@apache.org.
#5 accept timeout param or use default


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

Branch: refs/heads/master
Commit: 8ddb84a2bd5680c7f56357badc83cf5243d43e03
Parents: 78c63f3
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Mar 10 17:52:27 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Mar 10 17:54:01 2015 -0700

----------------------------------------------------------------------
 main.js | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/8ddb84a2/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index 0655261..dbf4c2e 100755
--- a/main.js
+++ b/main.js
@@ -28,10 +28,11 @@ function run() {
 }
 
 function init() {
-    var argv = parseArgs(process.argv.slice(2),{
+    var argv = parseArgs(process.argv.slice(2),{default:{
         plugin:".",
-        platform:""
-    });
+        platform:"",
+        timeout:TIMEOUT
+    }});
 
     if(!argv.platform || !argv.plugin) {
         console.log(USAGE);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[44/50] cordova-paramedic git commit: honor timeout even when justbuild is specified. This closes #25

Posted by pu...@apache.org.
honor timeout even when justbuild is specified. This closes #25


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

Branch: refs/heads/master
Commit: de183052d992e13f57133c856d74476d057637d7
Parents: 09cb6ac
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Wed Apr 15 13:23:33 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Wed Apr 15 13:23:33 2015 -0700

----------------------------------------------------------------------
 paramedic.js | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/de183052/paramedic.js
----------------------------------------------------------------------
diff --git a/paramedic.js b/paramedic.js
index 69a659d..ad9d787 100644
--- a/paramedic.js
+++ b/paramedic.js
@@ -45,6 +45,14 @@ ParamedicRunner.prototype = {
             // this would be fatal
             process.exit(cordovaResult.code);
         }
+
+        // limit runtime to TIMEOUT msecs
+        var self = this;
+        setTimeout(function(){
+            self.logMessage("This test seems to be blocked :: timeout exceeded. Exiting ...");
+            self.cleanUpAndExitWithCode(1);
+        },self.timeout);
+
         this.createTempProject();
         this.installPlugins();
         this.startServer();
@@ -228,11 +236,6 @@ ParamedicRunner.prototype = {
             self.logMessage("cordova-paramedic: adding platform");
             shell.exec('cordova platform add ' + self.platformId,{silent:true});
             shell.exec('cordova prepare',{silent:true});
-            // limit runtime to TIMEOUT msecs
-            setTimeout(function(){
-                self.logMessage("This test seems to be blocked :: timeout exceeded. Exiting ...");
-                self.cleanUpAndExitWithCode(1);
-            },self.timeout);
 
             shell.exec('cordova emulate ' + self.platformId.split("@")[0] + " --phone",
                 {async:true,silent:true},


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[23/50] cordova-paramedic git commit: Merge pull request #14 from shazron/readme_update

Posted by pu...@apache.org.
Merge pull request #14 from shazron/readme_update

Updated readme for --justbuild option

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

Branch: refs/heads/master
Commit: 06630ac278f98266f9aa1d4666d77ad36f7a771b
Parents: 8e90ba4 2660ba9
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Mar 20 17:33:51 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Mar 20 17:33:51 2015 -0700

----------------------------------------------------------------------
 README.md | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[36/50] cordova-paramedic git commit: Add a callback to get the results from the now modular version of paramedic.js

Posted by pu...@apache.org.
Add a callback to get the results from the now modular version of paramedic.js


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

Branch: refs/heads/master
Commit: 1c739c9055f5e32e308d28449cbf5f6200a04cff
Parents: 59ecc14
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Mar 31 17:09:02 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Mar 31 17:09:02 2015 -0700

----------------------------------------------------------------------
 main.js | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/1c739c90/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index b0c0c86..daa329c 100755
--- a/main.js
+++ b/main.js
@@ -7,7 +7,11 @@ var plugins,
     platformId;
 
 var USAGE = "Error missing args. \n Usage: $cordova-paramedic " +
-            "  --platform CORDOVA-PLATFORM --plugin PLUGIN-PATH [--port PORT]";    
+            "  --platform CORDOVA-PLATFORM --plugin PLUGIN-PATH [--justbuild ] [--port PORT] [--timeout TIMEOUT] \n" +
+            " CORDOVA-PLATFORM : Which platform to build target\n" +
+            " PLUGIN-PATH : Path to the plugin to install.\n" +
+            " --justbuild : Will not run tests, just verify that the plugin+platform can be built.\n" +
+            " TIMEOUT : time to wait for tests to run, in msecs, default is 10 minutes."; 
 
 var argv = parseArgs(process.argv.slice(2));
 
@@ -20,9 +24,11 @@ platformId = argv.platform;
 plugins = argv.plugin;
 plugins = Array.isArray(plugins) ? plugins : [plugins];
 
-
-paramedic.run(platformId,plugins,argv.justbuild,argv.port,argv.timeout);
-
+var onComplete = function(resCode,resObj) {
+	console.log("result is : " + resCode + "\n" + JSON.stringify(resObj));
+	process.exit(resCode);
+}
 
 
+paramedic.run(platformId, plugins, onComplete, argv.justbuild, argv.port, argv.timeout);
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[26/50] cordova-paramedic git commit: doc support for multiple plugins

Posted by pu...@apache.org.
doc support for multiple plugins


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

Branch: refs/heads/master
Commit: ede1cee12250bd589e5df72f273b111f81132545
Parents: 9921119
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Mar 20 17:49:50 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Mar 20 17:49:50 2015 -0700

----------------------------------------------------------------------
 README.md | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/ede1cee1/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index a37c270..8e062b7 100644
--- a/README.md
+++ b/README.md
@@ -16,6 +16,7 @@ Usage :
 
     CORDOVA-PLATFORM : the platform id, currently only supports 'ios'
     PLUGIN-PATH : the relative path to the plugin folder, expected to have a 'tests' folder
+                : you may specify multiple --plugin flags and they will all be installed and tested
     MSECS : (optional) time in millisecs to wait for tests to pass|fail ( defaults to 10 minutes )
     PORTNUM : (optional) port to use for posting results from emulator back to paramedic server
     --justbuild : (optional) just builds the project, without running the tests


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[14/50] cordova-paramedic git commit: remove unneeded extra change dirs

Posted by pu...@apache.org.
remove unneeded extra change dirs


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

Branch: refs/heads/master
Commit: 84d2bf66dca4fc69cf53b5a2d315a1dcb48b4d69
Parents: f35c6cb
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Mar 13 17:59:01 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Mar 13 17:59:01 2015 -0700

----------------------------------------------------------------------
 .travis.yml | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/84d2bf66/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 218c567..3c02467 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -7,7 +7,5 @@ install:
   - npm install ios-sim
   - npm install
   - npm link
-  - cd ..
-  - cd cordova-paramedic
 script:
   - npm run test-travis


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[25/50] cordova-paramedic git commit: update docs for port and timeout

Posted by pu...@apache.org.
update docs for port and timeout


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

Branch: refs/heads/master
Commit: 9921119874f6551dcb94436117cb90b78c4bd051
Parents: 54facf2
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Mar 20 17:48:32 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Mar 20 17:48:32 2015 -0700

----------------------------------------------------------------------
 README.md | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/99211198/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index af1dd0c..a37c270 100644
--- a/README.md
+++ b/README.md
@@ -12,9 +12,11 @@ To install :
 
 Usage :
 
-```cordova-paramedic --platform CORDOVA-PLATFORM --plugin PLUGIN-PATH --justbuild```
+```cordova-paramedic --platform CORDOVA-PLATFORM --plugin PLUGIN-PATH [--justbuild --timeout MSECS --port PORTNUM]```
 
     CORDOVA-PLATFORM : the platform id, currently only supports 'ios'
     PLUGIN-PATH : the relative path to the plugin folder, expected to have a 'tests' folder
-    --justbuild : just builds the project, without running the tests
+    MSECS : (optional) time in millisecs to wait for tests to pass|fail ( defaults to 10 minutes )
+    PORTNUM : (optional) port to use for posting results from emulator back to paramedic server
+    --justbuild : (optional) just builds the project, without running the tests
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[31/50] cordova-paramedic git commit: more cleanup

Posted by pu...@apache.org.
more cleanup


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

Branch: refs/heads/master
Commit: a9fbce841b44751b040f9027ed9d5782267febb3
Parents: e2412e3
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Sat Mar 21 01:36:59 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Sat Mar 21 01:36:59 2015 -0700

----------------------------------------------------------------------
 README.md | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/a9fbce84/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 892dda0..c65482c 100644
--- a/README.md
+++ b/README.md
@@ -14,9 +14,13 @@ Usage :
 
 ```cordova-paramedic --platform CORDOVA-PLATFORM --plugin PLUGIN-PATH [--justbuild --timeout MSECS --port PORTNUM]```
 
-    `CORDOVA-PLATFORM` : the platform id, currently only supports 'ios'
-    `PLUGIN-PATH` : the relative or absolute path to the plugin folder, expected to have a 'tests' folder. You may specify multiple --plugin flags and they will all be installed and tested together.
-    `MSECS` : (optional) time in millisecs to wait for tests to pass|fail ( defaults to 10 minutes )
-    `PORTNUM` : (optional) port to use for posting results from emulator back to paramedic server
-    --justbuild : (optional) just builds the project, without running the tests
+	`CORDOVA-PLATFORM` : the platform id, currently only supports 'ios'
+	`PLUGIN-PATH` : the relative or absolute path to a plugin folder
+					expected to have a 'tests' folder. 
+					You may specify multiple --plugin flags and they will all 
+					be installed and tested together.
+	`MSECS` : (optional) time in millisecs to wait for tests to pass|fail 
+			  (defaults to 10 minutes)
+	`PORTNUM` : (optional) port to use for posting results from emulator back to paramedic server
+	--justbuild : (optional) just builds the project, without running the tests
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[05/50] cordova-paramedic git commit: added windows tests and set appveyor default

Posted by pu...@apache.org.
added windows tests and set appveyor default


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

Branch: refs/heads/master
Commit: 962db83a0a50154aecbe0882247337beff632165
Parents: 880b927
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Thu Feb 12 17:16:24 2015 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Thu Feb 12 17:16:24 2015 -0800

----------------------------------------------------------------------
 package.json | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/962db83a/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 126697f..4e4af32 100644
--- a/package.json
+++ b/package.json
@@ -11,12 +11,13 @@
     "url": "git://github.com/purplecabbage/cordova-paramedic.git"
   },
   "scripts": {
-    "test":"npm run test-ios",
-    "test-appveyor":"npm run test-wp8",
+    "test":"npm run test-wp8",
+    "test-appveyor":"npm run test-windows",
     "test-travis":"npm run test-ios",
     "test-android":"cordova-paramedic --platform android --plugin ../spec/testable-plugin/",
     "test-ios": "cordova-paramedic --platform ios --plugin ../spec/testable-plugin/",
-    "test-wp8": "node main.js --platform wp8 --plugin ../spec/testable-plugin/"
+    "test-windows" : "node main.js --platform windows --plugin ./spec/testable-plugin/",
+    "test-wp8": "node main.js --platform wp8 --plugin ./spec/testable-plugin/"
 
   },
   "keywords": [


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[08/50] cordova-paramedic git commit: Added travis badge

Posted by pu...@apache.org.
Added travis badge

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

Branch: refs/heads/master
Commit: 78c63f34a56f4da01cceccbf1556ca7d1b6c5d5a
Parents: 749693a
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Tue Feb 24 15:32:37 2015 -0800
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Tue Feb 24 15:32:37 2015 -0800

----------------------------------------------------------------------
 README.md | 2 ++
 1 file changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/78c63f34/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index b3ac137..7225138 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,8 @@
 cordova-paramedic
 =================
 
+[![Build Status](https://travis-ci.org/purplecabbage/cordova-paramedic.svg?branch=master)](https://travis-ci.org/purplecabbage/cordova-paramedic)
+
 Runs cordova medic/buildbot tests locally.
 
 ... provides advanced levels of care at the point of illness or injury, including out of hospital treatment, and diagnostic services


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[21/50] cordova-paramedic git commit: Updated readme for --justbuild option

Posted by pu...@apache.org.
Updated readme for --justbuild option


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

Branch: refs/heads/master
Commit: 2660ba9b4382bf2003a9ed79c13fa480527df58c
Parents: d83fdbc
Author: Shazron Abdullah <sh...@apache.org>
Authored: Fri Mar 20 16:58:54 2015 -0700
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Fri Mar 20 16:58:54 2015 -0700

----------------------------------------------------------------------
 README.md | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/2660ba9b/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 7225138..af1dd0c 100644
--- a/README.md
+++ b/README.md
@@ -12,7 +12,9 @@ To install :
 
 Usage :
 
-```cordova-paramedic --platform CORDOVA-PLATFORM --plugin PLUGIN-PATH```
-CORDOVA-PLATFORM : the platform id, currently only supports 'ios'
-PLUGIN-PATH : the relative path to the plugin folder, expected to have a 'tests' folder
+```cordova-paramedic --platform CORDOVA-PLATFORM --plugin PLUGIN-PATH --justbuild```
+
+    CORDOVA-PLATFORM : the platform id, currently only supports 'ios'
+    PLUGIN-PATH : the relative path to the plugin folder, expected to have a 'tests' folder
+    --justbuild : just builds the project, without running the tests
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[15/50] cordova-paramedic git commit: test for something

Posted by pu...@apache.org.
test for something


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

Branch: refs/heads/master
Commit: 2312e53c3d82b54ff86630b39bd498db46c13a80
Parents: 84d2bf6
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Fri Mar 13 17:59:30 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Fri Mar 13 17:59:30 2015 -0700

----------------------------------------------------------------------
 spec/testable-plugin/tests/tests.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/2312e53c/spec/testable-plugin/tests/tests.js
----------------------------------------------------------------------
diff --git a/spec/testable-plugin/tests/tests.js b/spec/testable-plugin/tests/tests.js
index 0897b2c..f9a2ee7 100644
--- a/spec/testable-plugin/tests/tests.js
+++ b/spec/testable-plugin/tests/tests.js
@@ -23,7 +23,7 @@ exports.defineAutoTests = function() {
   describe('Testable', function () {
 
     it("should pass a test", function() {
-      expect(true);
+      expect(window).toBeDefined();
     });
 
     it("should exist", function() {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[30/50] cordova-paramedic git commit: cleanup, readme

Posted by pu...@apache.org.
cleanup, readme


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

Branch: refs/heads/master
Commit: e2412e3232b7fadfd2e80cc80fda4d2a5f6bf867
Parents: be9e6f2
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Sat Mar 21 01:34:06 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Sat Mar 21 01:34:06 2015 -0700

----------------------------------------------------------------------
 README.md |  9 ++++-----
 todo.txt  | 17 -----------------
 2 files changed, 4 insertions(+), 22 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/e2412e32/README.md
----------------------------------------------------------------------
diff --git a/README.md b/README.md
index 8e062b7..892dda0 100644
--- a/README.md
+++ b/README.md
@@ -14,10 +14,9 @@ Usage :
 
 ```cordova-paramedic --platform CORDOVA-PLATFORM --plugin PLUGIN-PATH [--justbuild --timeout MSECS --port PORTNUM]```
 
-    CORDOVA-PLATFORM : the platform id, currently only supports 'ios'
-    PLUGIN-PATH : the relative path to the plugin folder, expected to have a 'tests' folder
-                : you may specify multiple --plugin flags and they will all be installed and tested
-    MSECS : (optional) time in millisecs to wait for tests to pass|fail ( defaults to 10 minutes )
-    PORTNUM : (optional) port to use for posting results from emulator back to paramedic server
+    `CORDOVA-PLATFORM` : the platform id, currently only supports 'ios'
+    `PLUGIN-PATH` : the relative or absolute path to the plugin folder, expected to have a 'tests' folder. You may specify multiple --plugin flags and they will all be installed and tested together.
+    `MSECS` : (optional) time in millisecs to wait for tests to pass|fail ( defaults to 10 minutes )
+    `PORTNUM` : (optional) port to use for posting results from emulator back to paramedic server
     --justbuild : (optional) just builds the project, without running the tests
 

http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/e2412e32/todo.txt
----------------------------------------------------------------------
diff --git a/todo.txt b/todo.txt
deleted file mode 100644
index af9a125..0000000
--- a/todo.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-TODO:
-
-- parse args for (a)platform (b)plugin
-- create a local server
-- create a localtunnel url to the local server
-- create a cordova project, and add the platorm (a)
-> cordova platform add
-- add the plugin (b)
-> cordova plugin add (b)
-> cordova plugin add org.apache.cordova.test-framework
-> cordova plugin add (b)/tests/
-
-- set config.xml start page to <content src="cdvtests/index.html" />
-- add localtunnel url to whitelist <access origin="..." />
-- put localtunnel url in www/medic.json file in cordova project
-- cordova run platform 
-- console.log results[] if failures : exit with error
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[34/50] cordova-paramedic git commit: minor bump, added module interface

Posted by pu...@apache.org.
minor bump, added module interface


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

Branch: refs/heads/master
Commit: ed53a92524a787b927a07c5b3327c2ee03523a74
Parents: bffb14e
Author: Jesse MacFadyen <pu...@gmail.com>
Authored: Mon Mar 23 15:43:37 2015 -0700
Committer: Jesse MacFadyen <pu...@gmail.com>
Committed: Mon Mar 23 15:43:37 2015 -0700

----------------------------------------------------------------------
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/ed53a925/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 156901f..5df4aa2 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "cordova-paramedic",
-  "version": "0.0.11",
+  "version": "0.1.0",
   "description": "Use medic to test a cordova plugin locally",
   "main": "paramedic.js",
   "bin": {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[27/50] cordova-paramedic git commit: Fixed failing tests.

Posted by pu...@apache.org.
Fixed failing tests.


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

Branch: refs/heads/master
Commit: bbd060d7ed3df02be855216c98038bd473c55733
Parents: 21dc126
Author: Shazron Abdullah <sh...@gmail.com>
Authored: Fri Mar 20 22:05:10 2015 -0700
Committer: Shazron Abdullah <sh...@gmail.com>
Committed: Fri Mar 20 22:05:10 2015 -0700

----------------------------------------------------------------------
 main.js      | 8 +++++---
 package.json | 8 ++++----
 2 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/bbd060d7/main.js
----------------------------------------------------------------------
diff --git a/main.js b/main.js
index b197a0f..adc0f18 100755
--- a/main.js
+++ b/main.js
@@ -65,8 +65,10 @@ function createTempProject() {
 function installPlugins() {
 
     console.log("cordova-paramedic :: installing " + plugin);
+    
+    var pluginPath = path.join(storedCWD, plugin);
 
-    var installExitCode = shell.exec('cordova plugin add ' + plugin,
+    var installExitCode = shell.exec('cordova plugin add ' + pluginPath,
                                      {silent:true}).code;
     if(installExitCode != 0) {
         console.error('Failed to install plugin : ' + plugin);
@@ -76,8 +78,8 @@ function installPlugins() {
 
     if(!JustBuild) { 
         // we only install the test stuff if needed
-        console.log("cordova-paramedic :: installing " + path.join(plugin,'tests'));
-        installExitCode = shell.exec('cordova plugin add ' + path.join(plugin,'tests'),
+        console.log("cordova-paramedic :: installing " + path.join(pluginPath,'tests'));
+        installExitCode = shell.exec('cordova plugin add ' + path.join(pluginPath,'tests'),
                                      {silent:true}).code;
         if(installExitCode != 0) {
             console.error('Failed to find /tests/ for plugin : ' + plugin);

http://git-wip-us.apache.org/repos/asf/cordova-paramedic/blob/bbd060d7/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 03ca09d..874d23d 100644
--- a/package.json
+++ b/package.json
@@ -14,10 +14,10 @@
     "test":"npm run test-ios",
     "test-appveyor":"npm run test-windows",
     "test-travis":"npm run test-ios",
-    "test-android":"node main.js --platform android --plugin ../spec/testable-plugin/",
-    "test-ios": "node main.js --platform ios --plugin ../spec/testable-plugin/",
-    "test-windows" : "node main.js --platform windows --plugin ../spec/testable-plugin/",
-    "test-wp8": "node main.js --platform wp8 --plugin ./spec/testable-plugin/"
+    "test-android":"node main.js --platform android --plugin spec/testable-plugin/",
+    "test-ios": "node main.js --platform ios --plugin spec/testable-plugin/",
+    "test-windows" : "node main.js --platform windows --plugin spec/testable-plugin/",
+    "test-wp8": "node main.js --platform wp8 --plugin spec/testable-plugin/"
 
   },
   "keywords": [


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org