Skip to content

Commit

Permalink
Fix flaky tests.
Browse files Browse the repository at this point in the history
Fixes #10250
  • Loading branch information
ThomasGoulet73 committed Jan 17, 2025
1 parent 0f380f7 commit 47039d3
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
1 change: 1 addition & 0 deletions eng/WpfArcadeSdk/tools/FolderPaths.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<WpfCycleBreakersDir>$(RepoRoot)src\Microsoft.DotNet.Wpf\cycle-breakers\</WpfCycleBreakersDir>
<WpfApiCompatBaselineDir>$(RepoRoot)src\Microsoft.DotNet.Wpf\ApiCompat\Baselines\</WpfApiCompatBaselineDir>
<WpfSourceDir>$(RepoRoot)src\Microsoft.DotNet.Wpf\src\</WpfSourceDir>
<WpfRedistDir>$(RepoRoot)src\Microsoft.DotNet.Wpf\redist\</WpfRedistDir>
<WpfGraphicsPath>$(WpfSourceDir)WpfGfx\</WpfGraphicsPath>
<WpfGraphicsDir>$(WpfGraphicsPath)</WpfGraphicsDir>
<WpfPresentationNativeDir>$(WpfSourceDir)PresentationNative\</WpfPresentationNativeDir>
Expand Down
36 changes: 34 additions & 2 deletions src/Microsoft.DotNet.Wpf/tests/UnitTests/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,45 @@
BeforeTargets="AssignTargetPaths"
Returns="@(None)">
<ItemGroup>
<!-- These exist to ensure that dependencies (esp. native ones) are binplaced with tests correctly -->
<None Include="$(_PackagingNativePath)\runtimes\$(WpfRuntimeIdentifier)\native\*.dll"
<!--
These exist to ensure that dependencies (esp. native ones) are binplaced with tests correctly.
We use the explicit file names instead of globbing to make the build fail if the dlls were not found.
-->
<_WpfNativeDependency Include="$(_PackagingNativePath)\runtimes\$(WpfRuntimeIdentifier)\native\D3DCompiler_47_cor3.dll" />
<_WpfNativeDependency Include="$(_PackagingNativePath)\runtimes\$(WpfRuntimeIdentifier)\native\PresentationNative_cor3.dll" />
<_WpfNativeDependency Include="$(_PackagingNativePath)\runtimes\$(WpfRuntimeIdentifier)\native\vcruntime140_cor3.dll" />
<_WpfNativeDependency Include="$(_PackagingNativePath)\runtimes\$(WpfRuntimeIdentifier)\native\PenImc_cor3.dll" />
<_WpfNativeDependency Include="$(_PackagingNativePath)\runtimes\$(WpfRuntimeIdentifier)\native\wpfgfx_cor3.dll" />
</ItemGroup>

<ItemGroup>
<None Include="@(_WpfNativeDependency)"
CopyToOutputDirectory="PreserveNewest"
Visible="False" />
</ItemGroup>
</Target>

<!--
Include native dependencies as project reference to make sure that they are built before the test projects and before the task IncludeNativeDependencies is executed.
-->
<ItemGroup>
<ProjectReference Include="$(WpfRedistDir)D3DCompiler\D3DCompiler.vcxproj"
ReferenceOutputAssembly="False"
Visible="False" />
<ProjectReference Include="$(WpfRedistDir)PresentationNative\PresentationNative.vcxproj"
ReferenceOutputAssembly="False"
Visible="False" />
<ProjectReference Include="$(WpfRedistDir)VCRuntime\VCRuntime.vcxproj"
ReferenceOutputAssembly="False"
Visible="False" />
<ProjectReference Include="$(WpfSourceDir)PenImc\dll\PenImc.vcxproj"
ReferenceOutputAssembly="False"
Visible="True" />
<ProjectReference Include="$(WpfSourceDir)WpfGfx\core\dll\wpfgfx.vcxproj"
ReferenceOutputAssembly="False"
Visible="False" />
</ItemGroup>

<!--
Referencing packages that reference the desktop package causes grief with building internally. Currently this
is only happening with referencing StaFact (for [WpfFact] tests). Remove the reference if it comes in directly
Expand Down

0 comments on commit 47039d3

Please sign in to comment.