var gulp = require("gulp");
var path = require("path");
var test = require("../e2e/test");

gulp.task("testPerformanceInCI", function (done) {
    var testPerformance = require(path.join(process.cwd(), "lib/js/test/e2e/performance/TestPerformance.js"));

    test.testInCI("generate benchmark...", "performance", testPerformance.generateBenchmark, testPerformance.runTest, done);
});

gulp.task("testPerformanceInLocal", function (done) {
    var testPerformance = require(path.join(process.cwd(), "lib/js/test/e2e/performance/TestPerformance.js"));

    var reportFilePath = path.join(process.cwd(), "./test/e2e/performance/report/report.html");

    test.testInLocal("generate benchmark...", reportFilePath, "performance", testPerformance.generateBenchmark, testPerformance.generateReport, testPerformance.runTest, done);
});



function _fail(message, done) {
    console.log("fail");

    console.error(message);

    done();
}

gulp.task("generatePerformanceReport", function (done) {
    var testPerformance = require(path.join(process.cwd(), "lib/js/test/e2e/performance/TestPerformance.js"));

    var reportFilePath = path.join(process.cwd(), "./test/e2e/performance/report/report.html");

    try {
        testPerformance.generateAllCasesReport(reportFilePath).then(function () {
            done();
        }, function (e) {
            _fail(e, done);
        })
    }
    catch (e) {
        _fail(e, done);
    }
});

@@ -822,16 +822,460 @@
 );%0A%7D);%0A%0A
+gulp.task(%22testFastPerformance%22, function (done) %7B%0A    var testPerformance = require(path.join(process.cwd(), %22lib/js/test/e2e/performance/TestPerformance.js%22));%0A%0A    var reportFilePath = path.join(process.cwd(), %22./test/e2e/performance/report/report.html%22);%0A%0A    test.fastTest(%22generate correct image...%22, reportFilePath, %22performance%22, testPerformance.generateCorrectImage, testPerformance.generateReport, testPerformance.runTest, done);%0A%7D);%0A
 %0A%0Afuncti

fix package.json->"fastPf" script