2 ***********************************************************************************************
\r
3 Microsoft.TestPlatform.targets
\r
5 WARNING: DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
\r
6 created a backup copy. Incorrect changes to this file will make it
\r
7 impossible to load or build your projects from the command-line or the IDE.
\r
9 Copyright (c) .NET Foundation. All rights reserved.
\r
10 ***********************************************************************************************
\r
12 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
\r
13 <!-- Load Microsoft.TestPlatform.Build.Tasks.dll, this can be overridden to use a different version with $(VSTestTaskAssemblyFile) -->
\r
15 <VSTestTaskAssemblyFile Condition="$(VSTestTaskAssemblyFile) == ''">Microsoft.TestPlatform.Build.dll</VSTestTaskAssemblyFile>
\r
16 <VSTestConsolePath Condition="$(VSTestConsolePath) == ''">$([System.IO.Path]::Combine($(MSBuildThisFileDirectory),"vstest.console.dll"))</VSTestConsolePath>
\r
17 <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
\r
19 <UsingTask TaskName="Microsoft.TestPlatform.Build.Tasks.VSTestTask" AssemblyFile="$(VSTestTaskAssemblyFile)" />
\r
20 <UsingTask TaskName="Microsoft.TestPlatform.Build.Tasks.BuildLogTask" AssemblyFile="$(VSTestTaskAssemblyFile)" />
\r
23 ============================================================
\r
25 Main entry point for running tests through vstest.console.exe
\r
26 ============================================================
\r
28 <Target Name="VSTest" >
\r
29 <CallTarget Condition="'$(VSTestNoBuild)' != 'true'" Targets="BuildProject" />
\r
31 <CallTarget Targets="ShowCallOfVSTestTaskWithParameter" />
\r
33 <Microsoft.TestPlatform.Build.Tasks.VSTestTask
\r
34 TestFileFullPath="$(TargetPath)"
\r
35 VSTestSetting="$(VSTestSetting)"
\r
36 VSTestTestAdapterPath="$(VSTestTestAdapterPath)"
\r
37 VSTestFramework="$(TargetFrameworkMoniker)"
\r
38 VSTestPlatform="$(PlatformTarget)"
\r
39 VSTestTestCaseFilter="$(VSTestTestCaseFilter)"
\r
40 VSTestLogger="$(VSTestLogger)"
\r
41 VSTestListTests="$(VSTestListTests)"
\r
42 VSTestDiag="$(VSTestDiag)"
\r
43 VSTestCLIRunSettings="$(VSTestCLIRunSettings)"
\r
44 VSTestConsolePath="$(VSTestConsolePath)"
\r
45 VSTestResultsDirectory="$(VSTestResultsDirectory)"
\r
46 VSTestVerbosity="$(VSTestVerbosity)"
\r
47 VSTestCollect="$(VSTestCollect)"
\r
51 <Target Name="BuildProject">
\r
52 <CallTarget Targets="ShowMsbuildWithParameter" />
\r
54 <Microsoft.TestPlatform.Build.Tasks.BuildLogTask BuildStarted="True" />
\r
55 <MSBuild Projects ="$(MSBuildProjectFullPath)" />
\r
56 <Microsoft.TestPlatform.Build.Tasks.BuildLogTask />
\r
58 <Message Text="Done Building project $(MSBuildProjectFullPath) for TargetFramework=$(TargetFramework)" Importance="low" />
\r
61 <Target Name="ShowMsbuildWithParameter">
\r
62 <Message Text="Building project $(MSBuildProjectFullPath) for TargetFramework=$(TargetFramework)" Importance="low"/>
\r
63 <Message Text="Value passed to msbuild are..." Importance="low" />
\r
64 <Message Text="Configuration = $(Configuration)" Importance="low" />
\r
65 <Message Text="TargetFramework = $(TargetFramework)" Importance="low" />
\r
66 <Message Text="Platform = $(PlatformTarget)" Importance="low" />
\r
67 <Message Text="OutputPath = $(OutputPath)" Importance="low" />
\r
70 <Target Name="ShowCallOfVSTestTaskWithParameter">
\r
71 <Message Text="Calling task Microsoft.TestPlatform.Build.Tasks.VSTestTask with following parameter..." Importance="low" />
\r
72 <Message Text="TestFileFullPath = $(TargetPath)" Importance="low" />
\r
73 <Message Text="VSTestSetting = $(VSTestSetting)" Importance="low" />
\r
74 <Message Text="VSTestTestAdapterPath = $(VSTestTestAdapterPath)" Importance="low" />
\r
75 <Message Text="VSTestFramework = $(TargetFrameworkMoniker)" Importance="low" />
\r
76 <Message Text="VSTestPlatform = $(PlatformTarget)" Importance="low" />
\r
77 <Message Text="VSTestTestCaseFilter = $(VSTestTestCaseFilter)" Importance="low" />
\r
78 <Message Text="VSTestLogger = $(VSTestLogger)" Importance="low" />
\r
79 <Message Text="VSTestListTests = $(VSTestListTests)" Importance="low" />
\r
80 <Message Text="VSTestDiag = $(VSTestDiag)" Importance="low" />
\r
81 <Message Text="VSTestCLIRunSettings = $(VSTestCLIRunSettings)" Importance="low" />
\r
82 <Message Text="VSTestResultsDirectory = $(VSTestResultsDirectory)" Importance="low" />
\r
83 <Message Text="VSTestConsolePath = $(VSTestConsolePath)" Importance="low" />
\r
84 <Message Text="VSTestVerbosity = $(VSTestVerbosity)" Importance="low" />
\r
85 <Message Text="VSTestCollect = $(VSTestCollect)" Importance="low" />
\r