Skip to content

Commit 0ea5102

Browse files
Fix flaky tests.
Fixes #10250
1 parent b08d70d commit 0ea5102

File tree

2 files changed

+37
-6
lines changed

2 files changed

+37
-6
lines changed

eng/WpfArcadeSdk/tools/FolderPaths.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<WpfCycleBreakersDir>$(RepoRoot)src\Microsoft.DotNet.Wpf\cycle-breakers\</WpfCycleBreakersDir>
1010
<WpfApiCompatBaselineDir>$(RepoRoot)src\Microsoft.DotNet.Wpf\ApiCompat\Baselines\</WpfApiCompatBaselineDir>
1111
<WpfSourceDir>$(RepoRoot)src\Microsoft.DotNet.Wpf\src\</WpfSourceDir>
12+
<WpfRedistDir>$(RepoRoot)src\Microsoft.DotNet.Wpf\redist\</WpfRedistDir>
1213
<WpfGraphicsPath>$(WpfSourceDir)WpfGfx\</WpfGraphicsPath>
1314
<WpfGraphicsDir>$(WpfGraphicsPath)</WpfGraphicsDir>
1415
<WpfPresentationNativeDir>$(WpfSourceDir)PresentationNative\</WpfPresentationNativeDir>

src/Microsoft.DotNet.Wpf/tests/UnitTests/Directory.Build.targets

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.targets', '$(MSBuildThisFileDirectory)../'))" />
33

44
<PropertyGroup>
5-
<_PackagingNativePath Condition="'$(WpfRuntimeIdentifier)'=='win-x64' And '$(Configuration)' != 'Debug'">$(ArtifactsDir)packaging\$(Configuration)\x64\Microsoft.DotNet.Wpf.GitHub</_PackagingNativePath>
6-
<_PackagingNativePath Condition="'$(WpfRuntimeIdentifier)'=='win-x64' And '$(Configuration)' == 'Debug'">$(ArtifactsDir)packaging\$(Configuration)\x64\Microsoft.DotNet.Wpf.GitHub.Debug</_PackagingNativePath>
7-
<_PackagingNativePath Condition="'$(WpfRuntimeIdentifier)'=='win-x86' And '$(Configuration)' != 'Debug'">$(ArtifactsDir)packaging\$(Configuration)\Microsoft.DotNet.Wpf.GitHub</_PackagingNativePath>
8-
<_PackagingNativePath Condition="'$(WpfRuntimeIdentifier)'=='win-x86' And '$(Configuration)' == 'Debug'">$(ArtifactsDir)packaging\$(Configuration)\Microsoft.DotNet.Wpf.GitHub.Debug</_PackagingNativePath>
5+
<_PackagingNativePath>$(ArtifactsPackagingDir)$(GitHubTransportPackageName)\runtimes\$(WpfRuntimeIdentifier)\native\</_PackagingNativePath>
96
</PropertyGroup>
107

118
<!--
@@ -15,13 +12,46 @@
1512
BeforeTargets="AssignTargetPaths"
1613
Returns="@(None)">
1714
<ItemGroup>
18-
<!-- These exist to ensure that dependencies (esp. native ones) are binplaced with tests correctly -->
19-
<None Include="$(_PackagingNativePath)\runtimes\$(WpfRuntimeIdentifier)\native\*.dll"
15+
<!--
16+
These exist to ensure that dependencies (esp. native ones) are binplaced with tests correctly.
17+
We use the explicit file names instead of globbing to make the build fail if the dlls were not found.
18+
-->
19+
<_WpfNativeDependency Include="$(_PackagingNativePath)D3DCompiler_47_cor3.dll" Condition="'$(WpfRuntimeIdentifier)' != 'win-arm64'" />
20+
<_WpfNativeDependency Include="$(_PackagingNativePath)PresentationNative_cor3.dll" />
21+
<_WpfNativeDependency Include="$(_PackagingNativePath)vcruntime140d.dll" Condition="'$(Configuration)' == 'Debug'" />
22+
<_WpfNativeDependency Include="$(_PackagingNativePath)vcruntime140_cor3.dll" Condition="'$(Configuration)' != 'Debug'" />
23+
<_WpfNativeDependency Include="$(_PackagingNativePath)PenImc_cor3.dll" />
24+
<_WpfNativeDependency Include="$(_PackagingNativePath)wpfgfx_cor3.dll" />
25+
</ItemGroup>
26+
27+
<ItemGroup>
28+
<None Include="@(_WpfNativeDependency)"
2029
CopyToOutputDirectory="PreserveNewest"
2130
Visible="False" />
2231
</ItemGroup>
2332
</Target>
2433

34+
<!--
35+
Include native dependencies as project reference to make sure that they are built before the test projects and before the task IncludeNativeDependencies is executed.
36+
-->
37+
<ItemGroup>
38+
<ProjectReference Include="$(WpfRedistDir)D3DCompiler\D3DCompiler.vcxproj"
39+
ReferenceOutputAssembly="False"
40+
Visible="False" />
41+
<ProjectReference Include="$(WpfRedistDir)PresentationNative\PresentationNative.vcxproj"
42+
ReferenceOutputAssembly="False"
43+
Visible="False" />
44+
<ProjectReference Include="$(WpfRedistDir)VCRuntime\VCRuntime.vcxproj"
45+
ReferenceOutputAssembly="False"
46+
Visible="False" />
47+
<ProjectReference Include="$(WpfSourceDir)PenImc\dll\PenImc.vcxproj"
48+
ReferenceOutputAssembly="False"
49+
Visible="True" />
50+
<ProjectReference Include="$(WpfSourceDir)WpfGfx\core\dll\wpfgfx.vcxproj"
51+
ReferenceOutputAssembly="False"
52+
Visible="False" />
53+
</ItemGroup>
54+
2555
<!--
2656
Referencing packages that reference the desktop package causes grief with building internally. Currently this
2757
is only happening with referencing StaFact (for [WpfFact] tests). Remove the reference if it comes in directly

0 commit comments

Comments
 (0)