Dashboard > MbUnit > ... > MbUnit Home > TestExecutionUsingMSBuild
  MbUnit Log In View a printable version of the current page.  
  TestExecutionUsingMSBuild
Added by Jonathan de Halleux, last edited by Jonathan de Halleux on Jul 02, 2005
Labels: 
(None)

Executes tests in a [MsBuild] task.

!! How to use the task ?

In order to use the MbUnit task in one of your [MsBuild] task, you need to add a UsingTask node to the project that specifies the task name and assembly location:

<UsingTask 
    TaskName="MbUnit.MSBuild.Tasks.MbUnit" 
    AssemblyFile="MbUnit.MSBuild.Tasks.dll"
    />

Attributes

All attributes only input information.

'''Attribute''' '''Description''' '''Type'''
ReportFileNameFormat Format string for creating the report names. 0 and 1 are respectively replaced by the date and time string
ReportOutputDirectory Output folder of the reports string
ReportTypes List of report types: Xml,Html,Text or dox string[]
Assemblies List of test assemblies '''(required)''' string[]

Example

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
     <UsingTask 
        TaskName="MbUnit.MSBuild.Tasks.MbUnit" 
        AssemblyFile="%ProgramFiles%\TestDriven.NET 1.0\MbUnit\MbUnit.MSBuild.Tasks.dll"
        />
     <!-- defining test assemblies -->
     <ItemGroup>
         <TestAssemblies Include="**.Tests.dll" />
     </ItemGroup>
     <!-- test target -->   
     <Target Name="Tests">
         <MbUnit
          Assemblies="@(TestAssemblies)"
          ReportTypes="Xml;Text;Html;Dox"
          ReportFileNameFormat="myreportname{0}{1}"
          ReportOutputDirectory="..\Somewhere"
          />
     </Target>
 </Project>

See Also

TestExecutionUsingNAnt

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.2.9 Build:#527 Sep 07, 2006) - Bug/feature request - Contact Administrators