Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify .NETFramework tfms #58558

Merged
merged 6 commits into from
Sep 10, 2021
Merged
Changes from 1 commit
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
26 changes: 15 additions & 11 deletions src/libraries/testPackages/build/packageTest.targets
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
Condition="'$(_targetFrameworkIdentifier)' != ''" />
<Import Project="packageSettings\$(TestPackageId)\$(TargetFramework)\*.targets"
Condition="'$(TargetFramework)' != ''" />

<ItemGroup>
<!-- Type duplicated: https://github.com/dotnet/runtime/issues/33998 -->
<IgnoredTypes Include="Microsoft.Extensions.Logging.LoggingBuilderExtensions" />
<!-- Type duplicated: https://github.com/dotnet/runtime/issues/34420 -->
<IgnoredTypes Include="System.Collections.Generic.CollectionExtensions" />
</ItemGroup>

<Target Name="LogBeginTest"
Condition="'$(TargetFramework)' != ''">
<Message Importance="High" Text="Testing $(TestPackageID) TFM=$(TargetFramework)" />
Expand All @@ -52,7 +52,7 @@
IgnoredReferences="@(IgnoredReference)" />
</Target>

<Target Name="VerifyReferenceTypes"
<Target Name="VerifyReferenceTypes"
DependsOnTargets="ResolveReferences"
Condition="'$(ShouldVerifyTypes)' == 'true'">
<ItemGroup>
Expand All @@ -72,6 +72,10 @@
<ItemGroup>
<ReferenceLibToTest Include="@(ReferencePath)" Condition="'%(ReferencePath.NuGetPackageId)' == '$(TestPackageId)'" />
<RuntimeLibToTest Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' == '$(TestPackageId)'" />
<!-- Don't verify RID specific libs that aren't compatible on .NETFramework, i.e. Unix. -->
<RuntimeLibToTest Remove="@(RuntimeLibToTest)" Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' and
'%(RuntimeLibToTest.RuntimeIdentifier)' != '' and
'%(RuntimeLibToTest.RuntimeIdentifier)' != 'win'" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

win- wouldn't catch "win" itself so I guess checking (eq "win" or startswith("win-")) is necessary:

image

<RuntimeLibToTest Condition="'%(RuntimeLibToTest.RuntimeIdentifier)' == ''" RuntimeIdentifier="none" />
</ItemGroup>

Expand All @@ -80,19 +84,19 @@

<!-- Some dependent packages may be excluded from compile, consider these as candiates as well.-->
<ReferenceCopyLocalPaths Original="%(Identity)" />
<_referenceCopyLocalPathsPackages Include="@(ReferenceCopyLocalPaths->'%(NuGetPackageId)')"
<_referenceCopyLocalPathsPackages Include="@(ReferenceCopyLocalPaths->'%(NuGetPackageId)')"
Condition="'%(ReferenceCopyLocalPaths.RuntimeIdentifier)' == ''"
Exclude="@(ReferencePath->'%(NuGetPackageId)');$(TestPackageId)" />
<RuntimeLibToTestDependency Include="@(_referenceCopyLocalPathsPackages->'%(Original)')" />
</ItemGroup>

<Error Condition="'@(RuntimeLibToTest)' == '' AND '@(ReferenceLibToTest)' != ''" Text="Could not locate any runtime items from Package $(TestPackageID)" />

<Message Condition="'@(RuntimeLibToTest)' != ''" Importance="High" Text="Testing $(TestPackageID) runtime on TFM=$(TargetFramework) RIDs=@(RuntimeLibToTest->'%(RuntimeIdentifier)'->Distinct())" />
</Target>

<Target Name="VerifyRuntimeClosure"
Inputs="%(RuntimeLibToTest.RuntimeIdentifier)"
<Target Name="VerifyRuntimeClosure"
Inputs="%(RuntimeLibToTest.RuntimeIdentifier)"
Outputs="unused"
DependsOnTargets="PrepareForRuntimeTesting"
Condition="'$(ShouldVerifyClosure)' == 'true' and '$(SkipVerifyClosureForRuntime)' != 'true' and '$(SkipVerifyRuntime)' != 'true'">
Expand All @@ -110,8 +114,8 @@
IgnoredReferences="@(IgnoredReference)" />
</Target>

<Target Name="VerifyRuntimeTypes"
Inputs="%(RuntimeLibToTest.RuntimeIdentifier)"
<Target Name="VerifyRuntimeTypes"
Inputs="%(RuntimeLibToTest.RuntimeIdentifier)"
Outputs="unused"
DependsOnTargets="PrepareForRuntimeTesting"
Condition="'$(ShouldVerifyTypes)' == 'true' and '$(SkipVerifyRuntime)' != 'true'">
Expand Down Expand Up @@ -147,7 +151,7 @@
</TestDependsOn>
<InnerTargets>Test</InnerTargets>
</PropertyGroup>

<!-- Runs all tests scenarios for this project -->
<Target Name="Test" DependsOnTargets="$(TestDependsOn)"/>
<Target Name="Test" DependsOnTargets="$(TestDependsOn)" />
</Project>