/**
 * Define coverage tasks.
 * @module ci.tasks.coverageTasks
 * @author "ci.worker.generateStructure"
 *
 */
var helpers = require('../helpers'),
    t = helpers.taskDefineHelper;

/**
 * Prepare instruments for the coverage task.
 * @name ci.tasks.coveragePrepareInstruments
 * @type {object}
 */
exports.coveragePrepareInstruments = t.generateInstruments({
    srcDir: [
        'lib',
        'ci/helpers',
        'ci/worker'
    ],
    instrumentsDir: 'work/instruments',
    testDir: [
        'test',
        'test/unit_tests',
        'test/mock',
        'tmpl'
    ],
    filesToCopy: [
        'test/test_resource.js',
        'test/mock_injector.js'
    ]
});

exports.coverageReportToCoverallsIO = t.reportToCoveralls({
    files: [
        'work/instruments/test/unit_tests/lib/**',
        'work/instruments/test/unit_tests/ci/**'
    ]
});

/**
 * Report coverages task.
 * @name ci.tasks.coverage
 * @type {object}
 */
exports.coverage = [
    'coveragePrepareInstruments',
    'coverageReportToCoverallsIO'
];