未验证 提交 65b414c5 编写于 作者: J Jeremy Koritzinsky 提交者: GitHub

Add validation target to avoid losing test coverage with merged test wrappers (#66951)

Co-authored-by: NBruce Forstall <brucefo@microsoft.com>
上级 ca825411
<Project>
<Target Name="_ValidateNoTestProjectsDroppedByConflictResolution" AfterTargets="ResolveReferences">
<ItemGroup>
<_ProjectReferencesUsedByReferencePaths Include="@(ReferencePath->Metadata('ProjectReferenceOriginalItemSpec'))" />
<_ProjectAssemblyReferences Include="@(ProjectReference)" Condition="'%(ProjectReference.OutputItemType)' == ''" />
<_ProjectReferencesRemovedDueToConflictResolution Include="@(_ProjectAssemblyReferences)" Exclude="@(_ProjectReferencesUsedByReferencePaths)" />
</ItemGroup>
<!--
Produce an error if any project references were removed due to conflict resolution.
If a ProjectReference is removed due to conflict resolution, then we're likely losing test coverage as it's probably a test that has the same assembly name and version as another test.
-->
<Error Text="@(_ProjectReferencesRemovedDueToConflictResolution->'This project has an assembly name identical to another project: %(FullPath)', '&#010;')" Condition="'@(_ProjectReferencesRemovedDueToConflictResolution)' != ''" />
</Target>
<Import Project="$(RepoRoot)/src/tests/Common/mergedrunnermobile.targets" Condition="'$(TargetsMobile)' == 'true'" />
</Project>
\ No newline at end of file
......@@ -462,7 +462,7 @@
<Import Project="$(RepoRoot)/src/tests/Common/XUnitWrapperGenerator/XUnitWrapperGenerator.props" />
<Import Project="$(RepoRoot)eng/liveBuilds.targets" />
<Import Project="$(MSBuildProjectFullPath).targets" Condition="Exists('$(MSBuildProjectFullPath).targets')"/>
<Import Project="$(RepoRoot)/src/tests/Common/mergedrunnermobile.targets" Condition="'$(IsMergedTestRunnerAssembly)' == 'true' and '$(TargetsMobile)' == 'true'" />
<Import Project="$(RepoRoot)/src/tests/Common/mergedrunner.targets" Condition="'$(IsMergedTestRunnerAssembly)' == 'true'" />
<Target Name="GetBinPlaceTargetFramework" />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册