Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

We’re showing branches in this repository, but you can also compare across forks.

base fork: Macadamian/titanium_mobile
...
head fork: Macadamian/titanium_mobile
  • 3 commits
  • 2 files changed
  • 0 commit comments
  • 2 contributors
Commits on Sep 07, 2012
dlifshitz-maca dlifshitz-maca TIMOB-9840: BlackBerry: Integrate Anvil unit test framework and get t…
…ests to run

[Issues Fixed]
TIMOB-9840: BlackBerry: Integrate Anvil unit test framework and get tests to run

[Description]
The latest merge changed from using / to separate paths to using the node.js' path.join function. This caused the paths on Windows to use \, but the cp command fails with that.
For now, we'll just change the separators, but this should be removed when a proper fix is implemented.

[Changes]
common.js
- use function fixPathSeparator
- change to not put two cp args into the path.join call so it won't add an extra path separator

driverUtils.js
- added function fixPathSeparator

[Tests]
Test 1: Run Anvil
1) Set the variables in config.js
2) Run Anvil
3) Verify all the tests run and there are no errors
b5cfafe
Commits on Sep 10, 2012
dlifshitz-maca dlifshitz-maca TIMOB-10814: Blackberry: Fix Anvil issue caused by sync
only change paths on windows
73d5d02
dlifshitz-maca dlifshitz-maca Merge pull request #152 from dlifshitz-maca/TIMOB-9840_02
TIMOB-9840: BlackBerry: Integrate Anvil unit test framework and get tests to run
94667b2
Showing with 14 additions and 4 deletions.
  1. +4 −4 anvil/driver/common.js
  2. +10 −0 anvil/driver/driverUtils.js
8 anvil/driver/common.js
View
@@ -330,7 +330,7 @@ module.exports = new function() {
driverUtils.log("updating harness for config: " + config.configName);
var updateSuitesCallback = function() {
- driverUtils.runCommand("cp -r " + path.join(configs[configSetIndex].setDir, "Resources") + " " + path.join(harnessPlatformDir, "harness"), driverUtils.logStdout, function(error) {
+ driverUtils.runCommand("cp -r " + driverUtils.fixPathSeparator(path.join(configs[configSetIndex].setDir, "Resources") + " " + path.join(harnessPlatformDir, "harness")), driverUtils.logStdout, function(error) {
if (error !== null) {
driverUtils.log("unable to update the harness suites: " + error);
if (errorCallback) {
@@ -402,7 +402,7 @@ module.exports = new function() {
fs.writeFileSync(tiappXmlPath, newTiappXmlContents);
}
- driverUtils.runCommand("cp -r " + path.join(configDir, "tiapp.xml") + " " + path.join(harnessPlatformDir, "harness"), driverUtils.logStdout, function(error) {
+ driverUtils.runCommand("cp -r " + driverUtils.fixPathSeparator(path.join(configDir, "tiapp.xml") + " " + path.join(harnessPlatformDir, "harness")), driverUtils.logStdout, function(error) {
if (error !== null) {
driverUtils.log("unable to update the harness tiapp.xml: " + error);
if (errorCallback) {
@@ -420,7 +420,7 @@ module.exports = new function() {
var updateAppjsCallback = function() {
if (path.existsSync(path.join(configDir, "app.js"))) {
- driverUtils.runCommand("cp -r " + path.join(configDir, "app.js ", harnessPlatformDir, "harness", "Resources"), driverUtils.logStdout, function(error) {
+ driverUtils.runCommand("cp -r " + driverUtils.fixPathSeparator(path.join(configDir, "app.js") + " " + path.join(harnessPlatformDir, "harness", "Resources")), driverUtils.logStdout, function(error) {
if (error !== null) {
driverUtils.log("unable to update app.js for harness: " + error);
if (errorCallback) {
@@ -441,7 +441,7 @@ module.exports = new function() {
};
// update the harness based on the harness template packaged with the driver
- driverUtils.runCommand("cp -r " + path.join(driverGlobal.harnessTemplateDir, "* ", harnessPlatformDir, "harness", "Resources"), driverUtils.logStdout, function(error) {
+ driverUtils.runCommand("cp -r " + driverUtils.fixPathSeparator(path.join(driverGlobal.harnessTemplateDir, "*") + " " + path.join(harnessPlatformDir, "harness", "Resources")), driverUtils.logStdout, function(error) {
if (error !== null) {
driverUtils.log("unable to update harness with template: " + error);
if (errorCallback) {
10 anvil/driver/driverUtils.js
View
@@ -13,6 +13,7 @@
var fs = require("fs"),
child_process = require("child_process"),
path = require("path");
+var os = require("os");
module.exports = new function() {
var self = this,
@@ -124,6 +125,15 @@ module.exports = new function() {
return targetString.replace(/\s+$/,"");
};
+ // TODO: this shouldn't be necessary once we replace the cp command with something cross-platform
+ this.fixPathSeparator = function(pathString) {
+ if (os.platform().toLowerCase().match(/^win/)) {
+ return pathString.split("\\").join("/");
+ } else {
+ return pathString;
+ }
+ };
+
/*
* sets active log file based on driver command line arguments and deletes any old logs
* above the specified max number of logs if needed

No commit comments for this range

Something went wrong with that request. Please try again.