Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/verify-nupkgs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function Confirm-NugetPackages {
$expectedNumOfFiles = @{
"MSTest.Sdk" = 15
"MSTest.TestFramework" = 105
"MSTest.TestAdapter" = 49
"MSTest.TestAdapter" = 53
"MSTest" = 10
"MSTest.Analyzers" = 56
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<!-- net8.0 -->
<file src="net8.0\buildTransitive\common\MSTest.TestAdapter.props" target="buildTransitive\net8.0\MSTest.TestAdapter.props" />
<file src="net8.0\buildTransitive\common\MSTest.TestAdapter.targets" target="buildTransitive\net8.0\MSTest.TestAdapter.targets" />
<file src="net8.0\buildTransitive\Parallelize.targets" target="buildTransitive\net8.0\Parallelize.targets" />
<file src="net8.0\MSTestAdapter.PlatformServices.dll" target="buildTransitive\net8.0\" />
<file src="net8.0\MSTest.TestAdapter.dll" target="buildTransitive\net8.0\" />
<file src="$RepoRoot$src\Adapter\MSTest.TestAdapter\build\net8.0\MSTest.TestAdapter.props" target="build\net8.0\" />
Expand All @@ -28,6 +29,7 @@
<!-- net9.0 -->
<file src="net9.0\buildTransitive\common\MSTest.TestAdapter.props" target="buildTransitive\net9.0\MSTest.TestAdapter.props" />
<file src="net9.0\buildTransitive\common\MSTest.TestAdapter.targets" target="buildTransitive\net9.0\MSTest.TestAdapter.targets" />
<file src="net9.0\buildTransitive\Parallelize.targets" target="buildTransitive\net9.0\Parallelize.targets" />
<file src="net9.0\MSTestAdapter.PlatformServices.dll" target="buildTransitive\net9.0\" />
<file src="net9.0\MSTest.TestAdapter.dll" target="buildTransitive\net9.0\" />
<file src="$RepoRoot$src\Adapter\MSTest.TestAdapter\build\net9.0\MSTest.TestAdapter.props" target="build\net9.0\" />
Expand Down
3 changes: 3 additions & 0 deletions src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
<None Update="buildTransitive\uwp\*" Condition=" '$(TargetFramework)' == '$(UwpMinimum)' ">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="buildTransitive\Parallelize.targets">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
Comment thread
Evangelink marked this conversation as resolved.
</None>
<None Update="PACKAGE.md">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down
4 changes: 4 additions & 0 deletions src/Adapter/MSTest.TestAdapter/MSTest.TestAdapter.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<!-- uap10.0 -->
<file src="uap10.0.16299\buildTransitive\uwp\MSTest.TestAdapter.props" target="buildTransitive\uap10.0\MSTest.TestAdapter.props" />
<file src="uap10.0.16299\buildTransitive\uwp\MSTest.TestAdapter.targets" target="buildTransitive\uap10.0\MSTest.TestAdapter.targets" />
<file src="uap10.0.16299\buildTransitive\Parallelize.targets" target="buildTransitive\uap10.0\Parallelize.targets" />
<file src="$ArtifactsBinDir$MSTestAdapter.PlatformServices\$Configuration$\uap10.0.16299\MSTestAdapter.PlatformServices.dll" target="buildTransitive\uap10.0\" />
<file src="uap10.0.16299\MSTest.TestAdapter.dll" target="buildTransitive\uap10.0\" />
<file src="$RepoRoot$src\Adapter\MSTest.TestAdapter\build\uap10.0\MSTest.TestAdapter.props" target="build\uap10.0\" />
Expand All @@ -40,6 +41,7 @@
<!-- net8.0 -->
<file src="net8.0\buildTransitive\common\MSTest.TestAdapter.props" target="buildTransitive\net8.0\MSTest.TestAdapter.props" />
<file src="net8.0\buildTransitive\common\MSTest.TestAdapter.targets" target="buildTransitive\net8.0\MSTest.TestAdapter.targets" />
<file src="net8.0\buildTransitive\Parallelize.targets" target="buildTransitive\net8.0\Parallelize.targets" />
<file src="net8.0\MSTestAdapter.PlatformServices.dll" target="buildTransitive\net8.0\" />
<file src="net8.0\MSTest.TestAdapter.dll" target="buildTransitive\net8.0\" />
<file src="$RepoRoot$src\Adapter\MSTest.TestAdapter\build\net8.0\MSTest.TestAdapter.props" target="build\net8.0\" />
Expand All @@ -50,6 +52,7 @@
<!-- net9.0 -->
<file src="net9.0\buildTransitive\common\MSTest.TestAdapter.props" target="buildTransitive\net9.0\MSTest.TestAdapter.props" />
<file src="net9.0\buildTransitive\common\MSTest.TestAdapter.targets" target="buildTransitive\net9.0\MSTest.TestAdapter.targets" />
<file src="net9.0\buildTransitive\Parallelize.targets" target="buildTransitive\net9.0\Parallelize.targets" />
<file src="net9.0\MSTestAdapter.PlatformServices.dll" target="buildTransitive\net9.0\" />
<file src="net9.0-windows10.0.17763.0\MSTestAdapter.PlatformServices.dll" target="buildTransitive\net9.0\uwp" />
<file src="net9.0\MSTest.TestAdapter.dll" target="buildTransitive\net9.0\" />
Expand All @@ -60,6 +63,7 @@
<!-- net462 -->
<file src="net462\buildTransitive\common\MSTest.TestAdapter.props" target="buildTransitive\net462\" />
<file src="net462\buildTransitive\common\MSTest.TestAdapter.targets" target="buildTransitive\net462\" />
<file src="net462\buildTransitive\Parallelize.targets" target="buildTransitive\net462\" />
<file src="net462\MSTestAdapter.PlatformServices.dll" target="buildTransitive\net462\" />
<file src="net462\MSTest.TestAdapter.dll" target="buildTransitive\net462\" />
<file src="$RepoRoot$src\Adapter\MSTest.TestAdapter\build\net462\MSTest.TestAdapter.props" target="build\net462\" />
Expand Down
52 changes: 52 additions & 0 deletions src/Adapter/MSTest.TestAdapter/buildTransitive/Parallelize.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project>

<!--
MSTestParallelizeScope and MSTestParallelizeWorkers let users opt-in to assembly-level
parallelization without authoring an MSTestSettings.cs file, by emitting the corresponding
[assembly: Parallelize(...)] / [assembly: DoNotParallelize] attribute via the standard
AssemblyAttribute MSBuild item (consumed by WriteCodeFragment when GenerateAssemblyInfo is true).
-->
<!--
Only validate the silent-failure modes here. Invalid Scope values and non-integer Workers
flow through to WriteCodeFragment and produce a clear C# compile error on the generated source.
-->
<Target Name="_MSTestValidateParallelizeProperties" BeforeTargets="GenerateAssemblyInfo;CoreCompile">
Comment thread
Evangelink marked this conversation as resolved.
<Error Condition=" '$(MSTestParallelizeScope)' == 'None' and '$(MSTestParallelizeWorkers)' != '' "
Text="Property MSTestParallelizeWorkers cannot be set when MSTestParallelizeScope is 'None'." />
<Warning Condition=" ('$(MSTestParallelizeScope)' != '' or '$(MSTestParallelizeWorkers)' != '') and '$(GenerateAssemblyInfo)' == 'false' "
Comment thread
Evangelink marked this conversation as resolved.
Text="MSTestParallelizeScope and MSTestParallelizeWorkers require GenerateAssemblyInfo to be true to take effect." />
</Target>

<!-- Scope set to a parallel level, no explicit Workers => [assembly: Parallelize(Scope = ...)] -->
<ItemGroup Condition=" '$(MSTestParallelizeScope)' != '' and '$(MSTestParallelizeScope)' != 'None' and '$(MSTestParallelizeWorkers)' == '' ">
<AssemblyAttribute Include="Microsoft.VisualStudio.TestTools.UnitTesting.Parallelize">
<_Parameter1>Scope = Microsoft.VisualStudio.TestTools.UnitTesting.ExecutionScope.$(MSTestParallelizeScope)</_Parameter1>
<_Parameter1_IsLiteral>true</_Parameter1_IsLiteral>
</AssemblyAttribute>
</ItemGroup>

<!-- Workers set, Scope unset => [assembly: Parallelize(Workers = ...)] -->
<ItemGroup Condition=" '$(MSTestParallelizeScope)' == '' and '$(MSTestParallelizeWorkers)' != '' ">
<AssemblyAttribute Include="Microsoft.VisualStudio.TestTools.UnitTesting.Parallelize">
<_Parameter1>Workers = $(MSTestParallelizeWorkers)</_Parameter1>
<_Parameter1_IsLiteral>true</_Parameter1_IsLiteral>
</AssemblyAttribute>
</ItemGroup>

<!-- Both set => [assembly: Parallelize(Scope = ..., Workers = ...)] -->
<ItemGroup Condition=" '$(MSTestParallelizeScope)' != '' and '$(MSTestParallelizeScope)' != 'None' and '$(MSTestParallelizeWorkers)' != '' ">
<AssemblyAttribute Include="Microsoft.VisualStudio.TestTools.UnitTesting.Parallelize">
<_Parameter1>Scope = Microsoft.VisualStudio.TestTools.UnitTesting.ExecutionScope.$(MSTestParallelizeScope)</_Parameter1>
<_Parameter1_IsLiteral>true</_Parameter1_IsLiteral>
<_Parameter2>Workers = $(MSTestParallelizeWorkers)</_Parameter2>
<_Parameter2_IsLiteral>true</_Parameter2_IsLiteral>
</AssemblyAttribute>
</ItemGroup>

<!-- Scope set to None => [assembly: DoNotParallelize] -->
<ItemGroup Condition=" '$(MSTestParallelizeScope)' == 'None' ">
<AssemblyAttribute Include="Microsoft.VisualStudio.TestTools.UnitTesting.DoNotParallelize" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,6 @@
</Content>
</ItemGroup>
</Target>

<Import Project="$(MSBuildThisFileDirectory)Parallelize.targets" />
Comment thread
Evangelink marked this conversation as resolved.
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,6 @@
</ItemGroup>
</Target>

<Import Project="$(MSBuildThisFileDirectory)Parallelize.targets" />

</Project>
Loading