-
Notifications
You must be signed in to change notification settings - Fork 868
/
Copy pathDirectory.Build.props
82 lines (63 loc) · 4.86 KB
/
Directory.Build.props
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove('$(MSBuildThisFile)', '$(MSBuildThisFileDirectory)../'))" />
<PropertyGroup>
<IsPackable>false</IsPackable>
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
</PropertyGroup>
<!-- .NET 9 or later run tests per TargetFramework in parallel by default.
It is necessary to disable this feature because there are tests that need to be executed sequentially that are marked with `[Collection("docfx STA")]`. -->
<PropertyGroup>
<TestTfmsInParallel>false</TestTfmsInParallel>
</PropertyGroup>
<!-- Configure `Microsoft.Testing.Platform` mode behaviors (https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-platform-integration-dotnet-test)-->
<PropertyGroup>
<!-- Enable `Microsoft.Testing.Platform` mode for `dotnet test` -->
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
<!-- Show failure per test -->
<TestingPlatformShowTestsFailure>true</TestingPlatformShowTestsFailure>
<!-- Show complete platform output -->
<TestingPlatformCaptureOutput>false</TestingPlatformCaptureOutput>
<!-- Use `Microsoft.Testing.Platform` entrypoint. -->
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
<!-- Show xUnit.net headers and information -->
<TestingPlatformCommandLineArguments>$(TestingPlatformCommandLineArguments) --xunit-info</TestingPlatformCommandLineArguments>
<!-- Change TestResults output directory. And enable detailed log outputs -->
<TestingPlatformCommandLineArguments>$(TestingPlatformCommandLineArguments) --results-directory "$(MSBuildThisFileDirectory)TestResults"</TestingPlatformCommandLineArguments>
<!-- Ignore exit code 8 (the test session run zero tests) -->
<TestingPlatformCommandLineArguments>$(TestingPlatformCommandLineArguments) --ignore-exit-code 8</TestingPlatformCommandLineArguments>
<!-- Enable output for passed tests -->
<TestingPlatformCommandLineArguments>$(TestingPlatformCommandLineArguments) --output Detailed</TestingPlatformCommandLineArguments>
</PropertyGroup>
<!-- Settings for CI environment -->
<PropertyGroup Condition="'$(ContinuousIntegrationBuild)' == 'true' AND '$(PERCY_TOKEN)' == ''">
<!-- Disable progress reports -->
<TestingPlatformCommandLineArguments>$(TestingPlatformCommandLineArguments) --no-progress</TestingPlatformCommandLineArguments>
<!-- Enable reporters (trx/html/ctrf ) -->
<TestingPlatformCommandLineArguments>$(TestingPlatformCommandLineArguments) --report-xunit-trx --report-xunit-trx-filename TestResults-$(MSBuildProjectName)-$(TargetFramework)-$(RUNNER_OS).trx</TestingPlatformCommandLineArguments>
<TestingPlatformCommandLineArguments>$(TestingPlatformCommandLineArguments) --report-xunit-html --report-xunit-html-filename TestResults-$(MSBuildProjectName)-$(TargetFramework)-$(RUNNER_OS).html</TestingPlatformCommandLineArguments>
<TestingPlatformCommandLineArguments>$(TestingPlatformCommandLineArguments) --report-ctrf --report-ctrf-filename TestResults-$(MSBuildProjectName)-$(TargetFramework)-$(RUNNER_OS).ctrf</TestingPlatformCommandLineArguments>
</PropertyGroup>
<!-- Settings for VSTest mode. These settings will be removed in future. -->
<PropertyGroup Condition="'$(ContinuousIntegrationBuild)' == 'true' AND '$(PERCY_TOKEN)' == ''">
<!-- See: https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-platform-vs-vstest#communication-protocol-preview -->
<VSTestResultsDirectory>$(MSBuildThisFileDirectory)TestResults</VSTestResultsDirectory>
<VSTestLogger>$(VSTestLogger);trx%3BLogFileName=TestResults-$(MSBuildProjectName)-$(TargetFramework)-$(RUNNER_OS).trx</VSTestLogger>
<VSTestLogger>$(VSTestLogger);html%3BLogFileName=TestResults-$(MSBuildProjectName)-$(TargetFramework)-$(RUNNER_OS).html</VSTestLogger>
</PropertyGroup>
<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<!-- Set [assembly:CaptureConsole] attribute to assembly -->
<AssemblyAttribute Include="Xunit.CaptureConsole" />
<None Include="TestData\**" CopyToOutputDirectory="PreserveNewest" />
<None Include="$(MSBuildThisFileDirectory)xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
<!-- Add Docfx.Tests.Common` project reference to test projects -->
<ProjectReference Include="$(MSBuildThisFileDirectory)Docfx.Tests.Common/Docfx.Tests.Common.csproj" />
<PackageReference Include="FluentAssertions" />
<PackageReference Include="xunit.v3" />
<!-- Following package will be removed when Microsoft.Testing.Platform is supported on major platforms. -->
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit.runner.visualstudio">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>
</Project>