Skip to content

Commit

Permalink
Reimplement the MSBuild test task based on ToolTask (microsoft#680)
Browse files Browse the repository at this point in the history
Also refined the use of boolean types in the MSBuild targets.
  • Loading branch information
mcartoixa committed May 18, 2020
1 parent 59354e1 commit e2c6331
Show file tree
Hide file tree
Showing 7 changed files with 257 additions and 499 deletions.
102 changes: 0 additions & 102 deletions src/Microsoft.TestPlatform.Build/ArgumentEscaper.cs

This file was deleted.

55 changes: 28 additions & 27 deletions src/Microsoft.TestPlatform.Build/Microsoft.TestPlatform.targets
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Copyright (c) .NET Foundation. All rights reserved.
============================================================
-->
<Target Name="VSTest" DependsOnTargets="ShowInfoMessageIfProjectHasNoIsTestProjectProperty">
<CallTarget Condition="'$(VSTestNoBuild)' != 'true' AND '$(IsTestProject)' == 'true'" Targets="BuildProject" />
<CallTarget Condition="!$(VSTestNoBuild) AND $(IsTestProject)" Targets="BuildProject" />

<CallTarget Targets="ShowCallOfVSTestTaskWithParameter" />

Expand Down Expand Up @@ -53,7 +53,8 @@ Copyright (c) .NET Foundation. All rights reserved.
VSTestBlameHangTimeout="$(VSTestBlameHangTimeout)"
VSTestTraceDataCollectorDirectoryPath="$(TraceDataCollectorDirectoryPath)"
VSTestNoLogo="$(VSTestNoLogo)"
Condition="'$(IsTestProject)' == 'true'"
YieldDuringToolExecution="True"
Condition="$(IsTestProject)"
/>
</Target>

Expand All @@ -68,37 +69,37 @@ Copyright (c) .NET Foundation. All rights reserved.
<MSBuild Projects ="$(MSBuildProjectFullPath)" />
<Microsoft.TestPlatform.Build.Tasks.VSTestLogsTask LogType="BuildCompleted" />

<Message Text="Done Building project $(MSBuildProjectFullPath) for TargetFramework=$(TargetFramework)" Importance="low" />
<Message Text="Done Building project $(MSBuildProjectFullPath) for TargetFramework=$(TargetFramework)" Importance="Low" />
</Target>

<Target Name="ShowMsbuildWithParameter">
<Message Text="Building project $(MSBuildProjectFullPath) for TargetFramework=$(TargetFramework)" Importance="low"/>
<Message Text="Value passed to msbuild are..." Importance="low" />
<Message Text="Configuration = $(Configuration)" Importance="low" />
<Message Text="TargetFramework = $(TargetFramework)" Importance="low" />
<Message Text="Platform = $(PlatformTarget)" Importance="low" />
<Message Text="OutputPath = $(OutputPath)" Importance="low" />
<Message Text="Building project $(MSBuildProjectFullPath) for TargetFramework=$(TargetFramework)" Importance="Low"/>
<Message Text="Value passed to msbuild are..." Importance="Low" />
<Message Text="Configuration = $(Configuration)" Importance="Low" />
<Message Text="TargetFramework = $(TargetFramework)" Importance="Low" />
<Message Text="Platform = $(PlatformTarget)" Importance="Low" />
<Message Text="OutputPath = $(OutputPath)" Importance="Low" />
</Target>

<Target Name="ShowCallOfVSTestTaskWithParameter">
<Message Text="Calling task Microsoft.TestPlatform.Build.Tasks.VSTestTask with following parameter..." Importance="low" />
<Message Text="TestFileFullPath = $(TargetPath)" Importance="low" />
<Message Text="VSTestSetting = $(VSTestSetting)" Importance="low" />
<Message Text="VSTestTestAdapterPath = $(VSTestTestAdapterPath)" Importance="low" />
<Message Text="VSTestFramework = $(TargetFrameworkMoniker)" Importance="low" />
<Message Text="VSTestPlatform = $(PlatformTarget)" Importance="low" />
<Message Text="VSTestTestCaseFilter = $(VSTestTestCaseFilter)" Importance="low" />
<Message Text="VSTestLogger = $(VSTestLogger)" Importance="low" />
<Message Text="VSTestListTests = $(VSTestListTests)" Importance="low" />
<Message Text="VSTestDiag = $(VSTestDiag)" Importance="low" />
<Message Text="VSTestCLIRunSettings = $(VSTestCLIRunSettings)" Importance="low" />
<Message Text="VSTestResultsDirectory = $(VSTestResultsDirectory)" Importance="low" />
<Message Text="VSTestConsolePath = $(VSTestConsolePath)" Importance="low" />
<Message Text="VSTestVerbosity = $(VSTestVerbosity)" Importance="low" />
<Message Text="VSTestCollect = $(VSTestCollect)" Importance="low" />
<Message Text="VSTestBlame = $(VSTestBlame)" Importance="low" />
<Message Text="VSTestTraceDataCollectorDirectoryPath = $(TraceDataCollectorDirectoryPath)" Importance="low" />
<Message Text="VSTestNoLogo = $(VSTestNoLogo)" Importance="low" />
<Message Text="Calling task Microsoft.TestPlatform.Build.Tasks.VSTestTask with following parameter..." Importance="Low" />
<Message Text="TestFileFullPath = $(TargetPath)" Importance="Low" />
<Message Text="VSTestSetting = $(VSTestSetting)" Importance="Low" />
<Message Text="VSTestTestAdapterPath = $(VSTestTestAdapterPath)" Importance="Low" />
<Message Text="VSTestFramework = $(TargetFrameworkMoniker)" Importance="Low" />
<Message Text="VSTestPlatform = $(PlatformTarget)" Importance="Low" />
<Message Text="VSTestTestCaseFilter = $(VSTestTestCaseFilter)" Importance="Low" />
<Message Text="VSTestLogger = $(VSTestLogger)" Importance="Low" />
<Message Text="VSTestListTests = $(VSTestListTests)" Importance="Low" />
<Message Text="VSTestDiag = $(VSTestDiag)" Importance="Low" />
<Message Text="VSTestCLIRunSettings = $(VSTestCLIRunSettings)" Importance="Low" />
<Message Text="VSTestResultsDirectory = $(VSTestResultsDirectory)" Importance="Low" />
<Message Text="VSTestConsolePath = $(VSTestConsolePath)" Importance="Low" />
<Message Text="VSTestVerbosity = $(VSTestVerbosity)" Importance="Low" />
<Message Text="VSTestCollect = $(VSTestCollect)" Importance="Low" />
<Message Text="VSTestBlame = $(VSTestBlame)" Importance="Low" />
<Message Text="VSTestTraceDataCollectorDirectoryPath = $(TraceDataCollectorDirectoryPath)" Importance="Low" />
<Message Text="VSTestNoLogo = $(VSTestNoLogo)" Importance="Low" />
</Target>

</Project>
64 changes: 0 additions & 64 deletions src/Microsoft.TestPlatform.Build/Tasks/VSTestForwardingApp.cs

This file was deleted.

Loading

0 comments on commit e2c6331

Please sign in to comment.