diff --git a/package.json b/package.json index 7eb0ceb7a..863c70926 100644 --- a/package.json +++ b/package.json @@ -67,8 +67,8 @@ }, "scripts": { "start": "./bin/pylon.sh", - "test": "./test/run-tests.sh", - "build": "cd ppc && mkdir -p build && node ppc-package.js projects/default.ppp && cat ./build/ppc_release.js | sed 's/\\(\\/\\*FILEHEAD(\\).*//g' > ../plugins-client/lib.apf/www/apf-packaged/apf_release.js & cd ..", + "test": "npm run-script build && ./test/run-tests.sh", + "build": "mkdir -p ./plugins-client/lib.ppc/www/ppc && cd ppc && mkdir -p build && node ppc-package.js projects/default.ppp && cat ./build/ppc_release.js | sed 's/\\(\\/\\*FILEHEAD(\\).*//g' > ../plugins-client/lib.ppc/www/ppc/ppc.js && cd ..", "postinstall": "if [ -d 'node_modules/ace' ]; then cd node_modules/ace; else mkdir -p node_modules; ln -s ../../ace node_modules/ace; ln -s ../../treehugger node_modules/treehugger; cd ../ace; fi; make clean pre_build; ./Makefile.dryice.js minimal; cd ../..; make worker; if [ -L 'node_modules/ace' ]; then rm node_modules/ace; rm node_modules/treehugger; rmdir node_modules; fi" } } diff --git a/plugins-client/lib.ppc/package.json b/plugins-client/lib.ppc/package.json new file mode 100644 index 000000000..90b65bcc8 --- /dev/null +++ b/plugins-client/lib.ppc/package.json @@ -0,0 +1,14 @@ +{ + "name": "pylon.client.ppc", + "version": "0.0.1", + "main": "ppc-lib.js", + "private": true, + + "dependencies": { + }, + + "plugin": { + "provides": ["client.ppc"], + "consumes": ["static"] + } +} \ No newline at end of file diff --git a/plugins-client/lib.ppc/ppc-lib.js b/plugins-client/lib.ppc/ppc-lib.js new file mode 100644 index 000000000..f7a139f07 --- /dev/null +++ b/plugins-client/lib.ppc/ppc-lib.js @@ -0,0 +1,14 @@ +module.exports = function setup(options, imports, register) { + var base = __dirname + "/www"; + imports.static.addStatics([{ + path: base, + mount: "/", + rjs: { + ppc: "/ppc" + } + }]); + + register(null, { + "client.ppc": {} + }); +}; \ No newline at end of file diff --git a/ppc/ppc-package.js b/ppc/ppc-package.js index a2a10379f..7c8fb26ef 100644 --- a/ppc/ppc-package.js +++ b/ppc/ppc-package.js @@ -2,14 +2,12 @@ XPath = require('xpath'); DOMParser = require('xmldom').DOMParser; -require("apf"); - var Fs = require("fs"); boot(); function boot() { - require("apf/apf-node"); + require("./platform/apf-node"); require("./lib/proc"); require("./lib/files"); diff --git a/ppc/ppc-package_test.js b/ppc/ppc-package_test.js new file mode 100644 index 000000000..a03c864c8 --- /dev/null +++ b/ppc/ppc-package_test.js @@ -0,0 +1,38 @@ +/** + * Pylon Platform Code + * + * @license GPLv3 + */ + +/*global after, afterEach, before, beforeEach, describe, it, setup, suite, teardown, test*/ + +"use strict"; +"use mocha"; + +var Assert = require("assert"); +var fs = require('fs'); + +var basePath = __dirname; + +describe("ppc-package", function() { + it("APF should exist", function(next) { + Assert.equal(true, fs.existsSync(__dirname + "/../plugins-client/lib.apf/www/apf-packaged/apf_release.js", function(result) { + return result; + })); + next(); + }); + + it("PPC should exist", function(next) { + Assert.equal(true, fs.existsSync(__dirname + "/../plugins-client/lib.ppc/www/ppc/ppc.js", function(result) { + return result; + })); + next(); + }); + + it("PPC should be the same as APF", function(next) { + var apf = fs.readFileSync(__dirname + "/../plugins-client/lib.apf/www/apf-packaged/apf_release.js"); + var ppc = fs.readFileSync(__dirname + "/../plugins-client/lib.ppc/www/ppc/ppc.js"); + Assert.equal(true, ppc.equals(apf)); + next(); + }); +}); diff --git a/test/blacklist.txt b/test/blacklist.txt index 55fcb7ad7..2aca1851c 100644 --- a/test/blacklist.txt +++ b/test/blacklist.txt @@ -1,6 +1,4 @@ -./plugins-server/c9.api.ftp/ftp_test.js -./plugins-server/c9.graceful-shutdown/graceful-shutdown_test.js ./plugins-client/ext.console/logger_test.js -./plugins-server/c9.backup.duplicity/duplicity_test.js ./plugins-client/ext.watcher/three_way_merge_test.js -./test/integration/project_archive/archive_and_restore_test.js +./ppc/platform/test/lm_test.js +./ppc/platform/core/lib/util/xml_test.js diff --git a/test/run-tests.sh b/test/run-tests.sh index 9b8541085..7f92c5f74 100755 --- a/test/run-tests.sh +++ b/test/run-tests.sh @@ -6,7 +6,7 @@ mocha -V || : cd `dirname $0`/.. -npm install amd-loader +npm install amd-loader --no-save which mocha 2>/dev/null || npm install -g mocha # continue on error