Skip to content

Commit fbff6e1

Browse files
Enable PresentationCore tests (#9471)
* Run PresentationCore tests * Use previously built package native files
1 parent d46166e commit fbff6e1

File tree

7 files changed

+63
-25
lines changed

7 files changed

+63
-25
lines changed

Microsoft.Dotnet.Wpf.sln

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -247,12 +247,14 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{34B64A4A
247247
EndProject
248248
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UnitTests", "UnitTests", "{A48B585E-6AB0-4F8D-8484-77F37CB44437}"
249249
EndProject
250-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFB}") = "System.Xaml.Tests", "src\Microsoft.DotNet.Wpf\tests\UnitTests\System.Xaml.Tests\System.Xaml.Tests.csproj", "{B2F2A89C-55C9-41B1-A645-0948609BD8BE}"
250+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Xaml.Tests", "src\Microsoft.DotNet.Wpf\tests\UnitTests\System.Xaml.Tests\System.Xaml.Tests.csproj", "{B2F2A89C-55C9-41B1-A645-0948609BD8BE}"
251251
EndProject
252252
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PresentationFramework.Fluent", "src\Microsoft.DotNet.Wpf\src\Themes\PresentationFramework.Fluent\PresentationFramework.Fluent.csproj", "{3F2C0E0E-BB13-46D9-8D9A-08256A49ECA9}"
253253
EndProject
254254
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PresentationFramework.Fluent-ref", "src\Microsoft.DotNet.Wpf\src\Themes\PresentationFramework.Fluent\ref\PresentationFramework.Fluent-ref.csproj", "{3C43C553-2C1F-4EB9-8BF8-371D4A42E0FD}"
255255
EndProject
256+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PresentationCore.Tests", "src\Microsoft.DotNet.Wpf\tests\UnitTests\PresentationCore.Tests\PresentationCore.Tests.csproj", "{A4377D3F-6BA1-4994-945C-88667993E4F3}"
257+
EndProject
256258
Global
257259
GlobalSection(SolutionConfigurationPlatforms) = preSolution
258260
Debug|Any CPU = Debug|Any CPU
@@ -1924,28 +1926,22 @@ Global
19241926
{AF9084C3-BF37-4A56-A851-89F3BAE731B3}.Release|x86.ActiveCfg = Release|Win32
19251927
{AF9084C3-BF37-4A56-A851-89F3BAE731B3}.Release|x86.Build.0 = Release|Win32
19261928
{AF9084C3-BF37-4A56-A851-89F3BAE731B3}.Release|x86.Deploy.0 = Release|Win32
1927-
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|Any CPU.ActiveCfg = Debug|Win32
1928-
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|Any CPU.Build.0 = Debug|Win32
1929-
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|Any CPU.Deploy.0 = Debug|Win32
1929+
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1930+
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|Any CPU.Build.0 = Debug|Any CPU
19301931
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|ARM64.ActiveCfg = Debug|ARM64
19311932
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|ARM64.Build.0 = Debug|ARM64
19321933
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|x64.ActiveCfg = Debug|x64
19331934
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|x64.Build.0 = Debug|x64
1934-
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|x64.Deploy.0 = Debug|x64
19351935
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|x86.ActiveCfg = Debug|x86
19361936
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|x86.Build.0 = Debug|x86
1937-
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Debug|x86.Deploy.0 = Debug|x86
1938-
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|Any CPU.ActiveCfg = Release|Win32
1939-
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|Any CPU.Build.0 = Release|Win32
1940-
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|Any CPU.Deploy.0 = Release|Win32
1937+
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|Any CPU.ActiveCfg = Release|Any CPU
1938+
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|Any CPU.Build.0 = Release|Any CPU
19411939
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|ARM64.ActiveCfg = Release|ARM64
19421940
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|ARM64.Build.0 = Release|ARM64
19431941
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|x64.ActiveCfg = Release|x64
19441942
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|x64.Build.0 = Release|x64
1945-
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|x64.Deploy.0 = Release|x64
19461943
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|x86.ActiveCfg = Release|x86
19471944
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|x86.Build.0 = Release|x86
1948-
{B2F2A89C-55C9-41B1-A645-0948609BD8BE}.Release|x86.Deploy.0 = Release|x86
19491945
{3F2C0E0E-BB13-46D9-8D9A-08256A49ECA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
19501946
{3F2C0E0E-BB13-46D9-8D9A-08256A49ECA9}.Debug|Any CPU.Build.0 = Debug|Any CPU
19511947
{3F2C0E0E-BB13-46D9-8D9A-08256A49ECA9}.Debug|ARM64.ActiveCfg = Debug|arm64
@@ -1978,6 +1974,22 @@ Global
19781974
{3C43C553-2C1F-4EB9-8BF8-371D4A42E0FD}.Release|x64.Build.0 = Release|x64
19791975
{3C43C553-2C1F-4EB9-8BF8-371D4A42E0FD}.Release|x86.ActiveCfg = Release|Any CPU
19801976
{3C43C553-2C1F-4EB9-8BF8-371D4A42E0FD}.Release|x86.Build.0 = Release|Any CPU
1977+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1978+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
1979+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Debug|ARM64.ActiveCfg = Debug|ARM64
1980+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Debug|ARM64.Build.0 = Debug|ARM64
1981+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Debug|x64.ActiveCfg = Debug|x64
1982+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Debug|x64.Build.0 = Debug|x64
1983+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Debug|x86.ActiveCfg = Debug|x86
1984+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Debug|x86.Build.0 = Debug|x86
1985+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
1986+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Release|Any CPU.Build.0 = Release|Any CPU
1987+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Release|ARM64.ActiveCfg = Release|ARM64
1988+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Release|ARM64.Build.0 = Release|ARM64
1989+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Release|x64.ActiveCfg = Release|x64
1990+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Release|x64.Build.0 = Release|x64
1991+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Release|x86.ActiveCfg = Release|x86
1992+
{A4377D3F-6BA1-4994-945C-88667993E4F3}.Release|x86.Build.0 = Release|x86
19811993
EndGlobalSection
19821994
GlobalSection(SolutionProperties) = preSolution
19831995
HideSolutionNode = FALSE
@@ -2100,6 +2112,7 @@ Global
21002112
{B2F2A89C-55C9-41B1-A645-0948609BD8BE} = {A48B585E-6AB0-4F8D-8484-77F37CB44437}
21012113
{3F2C0E0E-BB13-46D9-8D9A-08256A49ECA9} = {5ACFB055-649D-4A01-98C2-B0BFE7E543D6}
21022114
{3C43C553-2C1F-4EB9-8BF8-371D4A42E0FD} = {60F4058B-D35B-42D2-B276-D44B3AC579BD}
2115+
{A4377D3F-6BA1-4994-945C-88667993E4F3} = {A48B585E-6AB0-4F8D-8484-77F37CB44437}
21032116
EndGlobalSection
21042117
GlobalSection(ExtensibilityGlobals) = postSolution
21052118
SolutionGuid = {B4340004-DAC0-497D-B69D-CFA7CD93F567}

eng/Versions.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,10 @@
8686
</PropertyGroup>
8787
<!-- XUnit-related (not extensions) -->
8888
<PropertyGroup>
89-
<XUnitVersion>2.4.0</XUnitVersion>
89+
<XUnitVersion>2.9.0</XUnitVersion>
9090
<XUnitAssertVersion>$(XUnitVersion)</XUnitAssertVersion>
9191
<XUnitRunnerConsoleVersion>$(XUnitVersion)</XUnitRunnerConsoleVersion>
92-
<XUnitRunnerVisualStudioVersion>2.4.0</XUnitRunnerVisualStudioVersion>
92+
<XUnitRunnerVisualStudioVersion>2.8.1</XUnitRunnerVisualStudioVersion>
9393
<XUnitExtensibilityExecutionVersion>$(XUnitVersion)</XUnitExtensibilityExecutionVersion>
9494
<XUnitStaFactPackageVersion>1.2.46-alpha</XUnitStaFactPackageVersion>
9595
</PropertyGroup>

src/Microsoft.DotNet.Wpf/src/PresentationCore/OtherAssemblyAttrs.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
[assembly:InternalsVisibleTo(BuildInfo.PresentationFrameworkSystemDrawing)]
1919
[assembly:InternalsVisibleTo(BuildInfo.SystemWindowsControlsRibbon)]
2020
[assembly:InternalsVisibleTo(BuildInfo.WindowsFormsIntegration)]
21-
[assembly:InternalsVisibleTo("PresentationCore.Tests,PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
21+
[assembly:InternalsVisibleTo($"PresentationCore.Tests, PublicKey={BuildInfo.WCP_PUBLIC_KEY_STRING}")]
2222
[assembly: TypeForwardedTo(typeof(System.Windows.Markup.IUriContext))]
2323
[assembly: TypeForwardedTo(typeof(System.Windows.Media.TextFormattingMode))]
2424
[assembly: TypeForwardedTo(typeof(System.Windows.Input.ICommand))]

src/Microsoft.DotNet.Wpf/tests/Directory.Build.props

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<Project>
22
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
33
<PropertyGroup>
4-
<SignAssembly>false</SignAssembly>
54
<IsShipping>false</IsShipping>
65
<CLSCompliant>false</CLSCompliant>
76
</PropertyGroup>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<Project>
2+
3+
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../'))" />
4+
5+
<PropertyGroup>
6+
<_PackagingNativePath Condition="'$(WpfRuntimeIdentifier)'=='win-x64' And '$(Configuration)' != 'Debug'">$(ArtifactsDir)packaging\$(Configuration)\x64\Microsoft.DotNet.Wpf.GitHub</_PackagingNativePath>
7+
<_PackagingNativePath Condition="'$(WpfRuntimeIdentifier)'=='win-x64' And '$(Configuration)' == 'Debug'">$(ArtifactsDir)packaging\$(Configuration)\x64\Microsoft.DotNet.Wpf.GitHub.Debug</_PackagingNativePath>
8+
<_PackagingNativePath Condition="'$(WpfRuntimeIdentifier)'=='win-x86' And '$(Configuration)' != 'Debug'">$(ArtifactsDir)packaging\$(Configuration)\Microsoft.DotNet.Wpf.GitHub</_PackagingNativePath>
9+
<_PackagingNativePath Condition="'$(WpfRuntimeIdentifier)'=='win-x86' And '$(Configuration)' == 'Debug'">$(ArtifactsDir)packaging\$(Configuration)\Microsoft.DotNet.Wpf.GitHub.Debug</_PackagingNativePath>
10+
</PropertyGroup>
11+
12+
<ItemGroup>
13+
<!-- These exist to ensure that dependencies (esp. native ones) are binplaced with tests correctly -->
14+
<None Include="$(_PackagingNativePath)\runtimes\$(WpfRuntimeIdentifier)\native\*.dll"
15+
CopyToOutputDirectory="PreserveNewest"
16+
Visible="False" />
17+
</ItemGroup>
18+
19+
<Target Name="RemoveWindowsBaseNetCoreAppReference"
20+
AfterTargets="ResolveTargetingPackAssets"
21+
Returns="@(Reference)">
22+
<ItemGroup>
23+
<Reference Remove="@(Reference)" Condition="'%(Reference.AssemblyName)' == 'WindowsBase' And '%(Reference.FrameworkReferenceName)' == 'Microsoft.NETCore.App'" />
24+
</ItemGroup>
25+
</Target>
26+
27+
</Project>

src/Microsoft.DotNet.Wpf/tests/UnitTests/PresentationCore.Tests/PresentationCore.Tests.csproj

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,24 @@
55
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
66
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
77
<Nullable>enable</Nullable>
8-
<TargetFramework>net9.0-windows</TargetFramework>
9-
<UseWPF>true</UseWPF>
10-
<Platforms>AnyCPU;x64;x86</Platforms>
11-
<SignAssembly>True</SignAssembly>
8+
<Platforms>AnyCPU;x64;x86;ARM64</Platforms>
129
<EnableUnsafeBinaryFormatterSerialization>true</EnableUnsafeBinaryFormatterSerialization>
1310
</PropertyGroup>
1411

1512
<ItemGroup>
16-
<ProjectReference Include="..\..\..\src\PresentationCore\PresentationCore.csproj" />
17-
<ProjectReference Include="..\..\..\src\WindowsBase\WindowsBase.csproj" />
13+
<ProjectReference Include="$(WpfSourceDir)DirectWriteForwarder\DirectWriteForwarder.vcxproj">
14+
<UndefineProperties>TargetFramework;TargetFrameworks</UndefineProperties>
15+
</ProjectReference>
16+
<ProjectReference Include="$(WpfSourceDir)PresentationCore\PresentationCore.csproj" />
17+
<ProjectReference Include="$(WpfSourceDir)WindowsBase\WindowsBase.csproj" />
1818
</ItemGroup>
1919

2020
<ItemGroup>
2121
<PackageReference Include="Moq" Version="$(MoqPackageVersion)" />
2222
<PackageReference Include="coverlet.msbuild" Version="$(CoverletMSBuildPackageVersion)" />
23-
<PackageReference Include="Xunit" Version="$(XUnitVersion)" />
2423
<PackageReference Include="xunit.stafact" Version="$(XUnitStaFactPackageVersion)" />
2524
<PackageReference Include="FluentAssertions" Version="$(FluentAssertionsVersion)" />
26-
<PackageReference Include="System.Collections.Concurrent" Version="4.3.0" />
27-
<PackageReference Include="System.Runtime.Serialization.Formatters" Version="9.0.0-preview.7.24359.11 " />
25+
<PackageReference Include="System.Configuration.ConfigurationManager" Version="$(SystemConfigurationConfigurationManagerPackageVersion)" />
2826
</ItemGroup>
2927

3028
</Project>

src/Microsoft.DotNet.Wpf/tests/UnitTests/System.Xaml.Tests/System.Xaml.Tests.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
66
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
77
<Nullable>enable</Nullable>
8+
<Platforms>AnyCPU;x64;x86;ARM64</Platforms>
89
</PropertyGroup>
910

1011
<ItemGroup>
11-
<ProjectReference Include="..\..\..\src\System.Xaml\System.Xaml.csproj" />
12+
<ProjectReference Include="$(WpfSourceDir)System.Xaml\System.Xaml.csproj" />
1213
</ItemGroup>
1314

1415
<ItemGroup>

0 commit comments

Comments
 (0)