Integrating with MSBuild

dotTEST ships with built-in support for integration with MSBuild to simplify running it in MSBuild build scripts environments. Integration with MSBuild scripts is achieved with the following custom MSBuild task:

Parasoft.Dottest.MSBuild.Tasks.dll 

Use the following code in your MSBuild script after a task is deployed:

<Import Project="$(MSBuildExtensionsPath)\Parasoft\Parasoft.Dottest.targets"/> 

	<Target Name="Demo"> 
		<Dottest 
			Configuration="builtin://Demo" 
			Solutions="C:\Devel\FooSolution\FooSolution.sln" 
 			Report="C:\Devel\Report" 
 			Out="C:\Devel\Out.txt" /> 
	</Target>

Target File

The target file must be imported in the MSBuild script. If you use deploy.exe, then you can the following import statement:

<Import Project="$(MSBuildExtensionsPath)\Parasoft\Parasoft.Dottest.targets"/> 

Alternatively, you can import the target directly from the installation directory:

<Import 
Project="<INSTALL_DIR>\integration\MSBuild\Parasoft.Dottest.targets\Parasoft.Dottest.targets 
"/> 

Targets can be directly imported from the installation directory when running multiple dotTESTinstallations on a single machine.

MSBuild Task

Use <Dottest> task in your build file to run dotTEST. The following arguments are supported:

Integrating with NAnt

dotTEST ships with built-in support for integration with NAnt to simplify running it in NAnt build scripts environments. Use the following code in your NAnt script after the task is deployed to NAnt:

<target name="analyze">  
	<dottest 
		config="builtin://Demo" 
		report="C:\Devel\Report" 
		out="C:\Devel\Out.txt"> 
		<solutions> 
			<include name ="C:\Devel\FooSolution\FooSolution.sln"> 
		</solutions> 
	</dottest> 
</target> 

Loading NAnt Task Library

Integration with NAnt scripts is achieved with the following custom NAnt task:

Parasoft.Dottest.NAnt.Tasks.dll.

This library must be in the same directory as NAnt.exe for the NAnt scripts to detect the dotTEST task. Alternatively, <loadtasks> can be used, which is useful for running multiple dotTEST installations on one machine

<project name="sampleProject" default="test"> 
	<target name="test"> 
		<loadtasks> 
			<fileset> 
				<include 
name="<INSTALL_DIR>\integration\NAnt\Parasoft.Dottest.NAnt.Tasks.dll" /> 
			</fileset> 
		</loadtasks> 
	</target>
</project>

Supported NAnt Task Arguments