Author: ygrego Date: 2015-06-10 21:10:42 +0000 (Wed, 10 Jun 2015) New Revision: 1692 Url: http://forge.nuiton.org/projects/sandbox/repository/revisions/1692 Log: Necessary for use of gulp. Added: oipf/test/gulpfile.js oipf/test/paths.json Added: oipf/test/gulpfile.js =================================================================== --- oipf/test/gulpfile.js (rev 0) +++ oipf/test/gulpfile.js 2015-06-10 21:10:42 UTC (rev 1692) @@ -0,0 +1,57 @@ +var gulp = require("gulp"); +var gulpSequence = require("gulp-sequence"); +var concat = require("gulp-concat"); +var sourcemaps = require("gulp-sourcemaps"); +var babel = require("gulp-babel"); +var del = require("del"); + +var notifier = require("node-notifier"); +var util = require("gulp-util"); + +var paths = require("./paths.json"); + +var conf = { + jsTestFiles: paths.test, + buildFile: "oipf-tests.js", + buildDir: "build" +}; + +function errorHandler(err) { + notifier.notify({message: "Error: " + err.message}); + util.log(util.colors.red("Error"), err.message); + this.emit("end"); +} + +gulp.task("clean", function(cb) { + del([conf.buildDir], cb); +}); + +gulp.task("javascriptTests", function() { + return gulp.src(conf.jsTestFiles) + .pipe(sourcemaps.init()) + .pipe(babel({ + blacklist: [ + "es3.memberExpressionLiterals", + "es3.propertyLiterals", + "es5.properties.mutators" + ], + optional: [ + "asyncToGenerator", + "minification.memberExpressionLiterals", + "minification.propertyLiterals", + "utility.inlineEnvironmentVariables" + ], + compact: false + })) + .on("error", errorHandler) + .pipe(concat(conf.buildFile)) + .pipe(sourcemaps.write()) + .pipe(gulp.dest(conf.buildDir)); +}); + +// Rerun the task when a file changes +gulp.task("watch", function() { + gulp.watch(conf.jsTestFiles, ["javascriptTests"]); +}); + +gulp.task("default", gulpSequence("javascriptTests", "watch")); Added: oipf/test/paths.json =================================================================== --- oipf/test/paths.json (rev 0) +++ oipf/test/paths.json 2015-06-10 21:10:42 UTC (rev 1692) @@ -0,0 +1,15 @@ +{ + "test": [ + "js/TestCase.js", + "js/ApplicationManagerTest.js", + "js/CapabilitiesTest.js", + "js/ParentalControlManagerTest.js", + "js/RecordingSchedulerTest.js", + "js/ConfigurationTest.js", + "js/SearchManagerTest.js", + "js/VideoBroadcastTest.js", + "js/OipfFactoryTest.js", + "js/TestConfig.js", + "js/Test.js" + ] +}
participants (1)
-
ygregoï¼ users.nuiton.org