An MSBuild task that provides support for running Gallio tests.

Namespace:  Gallio.MSBuildTasks
Assembly:  Gallio.MSBuildTasks (in Gallio.MSBuildTasks.dll) Version: 3.2.0.0 (3.2.300.0)

Syntax

C#
public class Gallio : Task
Visual Basic (Declaration)
Public Class Gallio _
	Inherits Task

Remarks

In order for MSBuild to find this task, the Gallio.MSBuildTasks.dll has to be loaded with the UsingTask directive:
CopyC#
<UsingTask AssemblyFile="[Path-to-assembly]\Gallio.MSBuildTasks.dll" TaskName="Gallio" />
The AssemblyFile attribute must be set to the path where the Gallio.MSBuildTasks.dll assembly resides, and the TaskName attribute must be set to "Gallio", otherwise MSBuild won't load the task.

Examples

The following code is an example build file that shows how to load the task, specify the test files and assemblies and set some of the task's properties:
CopyC#
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <!-- This is needed by MSBuild to locate the Gallio task -->
    <UsingTask AssemblyFile="[Path-to-assembly]\Gallio.MSBuildTasks.dll" TaskName="Gallio" />
    <!-- Specify the test files and assemblies -->
    <ItemGroup>
      <TestFile Include="[Path-to-test-assembly1]/TestAssembly1.dll" />
      <TestFile Include="[Path-to-test-assembly2]/TestAssembly2.dll" />
      <TestFile Include="[Path-to-test-script1]/TestScript1_spec.rb" />
      <TestFile Include="[Path-to-test-script2]/TestScript2.xml" />
    </ItemGroup>
    <Target Name="RunTests">
        <Gallio IgnoreFailures="true" Filter="Type=SomeFixture" Files="@(TestFile)">
            <!-- This tells MSBuild to store the output value of the task's ExitCode property
                 into the project's ExitCode property -->
            <Output TaskParameter="ExitCode" PropertyName="ExitCode"/>
        </Gallio>
        <Error Text="Tests execution failed" Condition="'$(ExitCode)' != 0" />
    </Target>
</Project>

Inheritance Hierarchy

System..::.Object
  Microsoft.Build.Utilities..::.Task
    Gallio.MSBuildTasks..::.Gallio

See Also