org.sonar.plugins.csharp.gallio.GallioPlugin Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sonar-csharp-gallio-plugin
Show all versions of sonar-csharp-gallio-plugin
Plugin that executes unit tests and computes code coverage.
/*
* Sonar C# Plugin :: Gallio
* Copyright (C) 2010 Jose Chillan, Alexandre Victoor and SonarSource
* [email protected]
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
*/
package org.sonar.plugins.csharp.gallio;
import java.util.ArrayList;
import java.util.List;
import org.sonar.api.Extension;
import org.sonar.api.Properties;
import org.sonar.api.Property;
import org.sonar.api.SonarPlugin;
import org.sonar.plugins.csharp.gallio.results.coverage.CoverageResultParser;
import org.sonar.plugins.csharp.gallio.results.execution.GallioResultParser;
/**
* C# Gallio plugin class.
*/
@Properties({
@Property(key = GallioConstants.INSTALL_FOLDER_KEY, defaultValue = GallioConstants.INSTALL_FOLDER_DEFVALUE,
name = "Gallio install directory", description = "Absolute path of the Gallio installation folder.", global = true, project = false),
@Property(key = GallioConstants.TIMEOUT_MINUTES_KEY, defaultValue = GallioConstants.TIMEOUT_MINUTES_DEFVALUE + "",
name = "Gallio program timeout", description = "Maximum number of minutes before the Gallio program will be stopped.",
global = true, project = true),
@Property(key = GallioConstants.MODE, defaultValue = "", name = "Gallio activation mode",
description = "Possible values : empty (means active), 'skip' and 'reuseReport'.", global = false, project = false),
@Property(key = GallioConstants.REPORTS_PATH_KEY, defaultValue = "", name = "Name of the Gallio report files",
description = "Path to the Gallio report file used when reuse report mode is activated. "
+ "This can be an absolute path, or a path relative to the solution base directory.", global = false, project = false),
@Property(
key = GallioConstants.FILTER_KEY,
defaultValue = GallioConstants.FILTER_DEFVALUE,
name = "Test filter",
description = "Filter that can be used to execute only a specific test category (i.e. CategotyName:unit to consider only tests from the 'unit' category).",
global = true, project = true),
@Property(
key = GallioConstants.COVERAGE_TOOL_KEY,
defaultValue = GallioConstants.COVERAGE_TOOL_DEFVALUE,
name = "Coverage tool",
description = "Coverage tool used by Gallio: it currently can be 'PartCover' (default), 'NCover' or 'none' (= means no coverage analysis will be done).",
global = true, project = true),
@Property(key = GallioConstants.PART_COVER_INSTALL_KEY, defaultValue = GallioConstants.PART_COVER_INSTALL_DEFVALUE,
name = "PartCover install directory", description = "Absolute path of the PartCover installation folder.", global = true,
project = false),
@Property(key = GallioConstants.REPORTS_COVERAGE_PATH_KEY, defaultValue = "", name = "Name of the Gallio coverage report files",
description = "Path to the Gallio coverage report file used when reuse report mode is activated. "
+ "This can be an absolute path, or a path relative to the solution base directory.", global = false, project = false),
@Property(key = GallioConstants.COVERAGE_EXCLUDES_KEY, defaultValue = GallioConstants.COVERAGE_EXCLUDES_DEFVALUE,
name = "Coverage excludes", description = "Comma-separated list of namespaces and assemblies excluded from the code coverage. "
+ "For PartCover, the format for an exclusion is : '[assembly]namespace'. "
+ "For NCover, the format is just the name of the assemblies to exclude.", global = true, project = true) })
public class GallioPlugin extends SonarPlugin {
/**
* {@inheritDoc}
*/
public List> getExtensions() {
List> extensions = new ArrayList>();
extensions.add(TestMetrics.class);
// Parser(s)
extensions.add(CoverageResultParser.class);
extensions.add(GallioResultParser.class);
// Sensors
extensions.add(GallioSensor.class);
extensions.add(TestReportSensor.class);
extensions.add(CoverageReportSensor.class);
// Decorators
extensions.add(CoverageDecorator.class);
return extensions;
}
}