incubator-callback-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [2/5] git commit: updated test bootstrap + tests for bb10 support.
Date Wed, 26 Sep 2012 20:49:56 GMT
updated test bootstrap + tests for bb10 support.


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

Branch: refs/heads/cordova-client
Commit: f27c669c068ef847e8be2879ba935c186eb9d1ca
Parents: d6217bf
Author: Fil Maj <maj.fil@gmail.com>
Authored: Wed Sep 26 13:48:32 2012 -0700
Committer: Fil Maj <maj.fil@gmail.com>
Committed: Wed Sep 26 13:48:32 2012 -0700

----------------------------------------------------------------------
 spec/platform.spec.js |   18 ++++++++++--------
 src/build.js          |    3 +--
 test_bootstrap.js     |    2 +-
 3 files changed, 12 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/f27c669c/spec/platform.spec.js
----------------------------------------------------------------------
diff --git a/spec/platform.spec.js b/spec/platform.spec.js
index 56bc6d5..4dc8c6b 100644
--- a/spec/platform.spec.js
+++ b/spec/platform.spec.js
@@ -5,6 +5,7 @@ var cordova = require('../cordova'),
     et = require('elementtree'),
     config_parser = require('../src/config_parser'),
     helper = require('./helper'),
+    util = require('../src/util'),
     platforms = require('../platforms'),
     tempDir = path.join(__dirname, '..', 'temp');
 
@@ -86,16 +87,17 @@ describe('platform command', function() {
 
         describe('without any libraries cloned', function() {
             var lib = path.join(__dirname, '..', 'lib');
+            var libs = fs.readdirSync(lib);
             
             beforeEach(function() {
-                platforms.forEach(function(p) {
+                libs.forEach(function(p) {
                     var s = path.join(lib, p);
                     var d = path.join(lib, p + '-bkup');
                     shell.mv(s, d);
                 });
             });
             afterEach(function() {
-                platforms.forEach(function(p) {
+                libs.forEach(function(p) {
                     var s = path.join(lib, p + '-bkup');
                     var d = path.join(lib, p);
                     shell.mv(s, d);
@@ -203,16 +205,16 @@ describe('platform command', function() {
                 });
             });
         });
-        describe('blackberry', function() {
+        describe('blackberry-10', function() {
             it('should add a basic blackberry project', function() {
                 var cb = jasmine.createSpy();
 
                 runs(function() {
-                    cordova.platform('add', 'blackberry', cb);
+                    cordova.platform('add', 'blackberry-10', cb);
                 });
-                waitsFor(function() { return cb.wasCalled; }, "platform add blackberry callback");
+                waitsFor(function() { return cb.wasCalled; }, "platform add blackberry");
                 runs(function() {
-                    expect(fs.existsSync(path.join(tempDir, 'platforms', 'blackberry', 'www'))).toBe(true);
+                    expect(fs.existsSync(path.join(tempDir, 'platforms', 'blackberry-10',
'www'))).toBe(true);
                 });
             });
             it('should use the correct application name based on what is in config.xml',
function() {
@@ -226,11 +228,11 @@ describe('platform command', function() {
 
                 runs(function() {
                     cfg.name('upon closer inspection they appear to be loafers');
-                    cordova.platform('add', 'blackberry', cb);
+                    cordova.platform('add', 'blackberry-10', cb);
                 });
                 waitsFor(function() { return cb.wasCalled; }, "platform add blackberry callback");
                 runs(function() {
-                    var bb_cfg = new config_parser(path.join(tempDir, 'platforms', 'blackberry',
'www', 'config.xml'));
+                    var bb_cfg = new config_parser(path.join(tempDir, 'platforms', 'blackberry-10',
'www', 'config.xml'));
                     expect(bb_cfg.name()).toBe(cfg.name());
                 });
             });

http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/f27c669c/src/build.js
----------------------------------------------------------------------
diff --git a/src/build.js b/src/build.js
index 23f5d6b..8df0798 100644
--- a/src/build.js
+++ b/src/build.js
@@ -17,7 +17,7 @@ function shell_out_to_debug(projectRoot, platform) {
     // TODO: this is bb10 only for now
     // TODO: this hsould be in emualte, we should use the load-device command
     if (platform.indexOf('blackberry') > -1) {
-        cmd = 'ant -f ' + path.join(projectRoot, 'platforms', platform, 'build.xml') + '
qnx load-simulator';
+        cmd = 'ant -f ' + path.join(projectRoot, 'platforms', platform, 'build.xml') + '
qnx load-device';
     }
     var response = shell.exec(cmd, {silent:true});
     if (response.code > 0) throw 'An error occurred while building the ' + platform +
' project. ' + response.output;
@@ -177,6 +177,5 @@ module.exports = function build (callback) {
                 });
                 break;
         }
-
     });
 };

http://git-wip-us.apache.org/repos/asf/incubator-cordova-labs/blob/f27c669c/test_bootstrap.js
----------------------------------------------------------------------
diff --git a/test_bootstrap.js b/test_bootstrap.js
index 603e3de..4ed34a0 100644
--- a/test_bootstrap.js
+++ b/test_bootstrap.js
@@ -10,7 +10,7 @@ var fs = require('fs'),
 
 // If a platform library dependency does not exist, will clone it down.
 platforms.forEach(function(p) {
-    if (!fs.existsSync(path.join(__dirname, 'lib', p))) {
+    if (!util.havePlatformLib(p)) {
         util.getPlatformLib(p);
     }
 });


Mime
View raw message