Skip to content

Commit 08e0c21

Browse files
committed
chore: cleanup test projects
1 parent 8546482 commit 08e0c21

File tree

21 files changed

+19
-31
lines changed

21 files changed

+19
-31
lines changed

Directory.Build.props

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,6 @@
4040
<PackageLicenseExpression>MIT</PackageLicenseExpression>
4141
</PropertyGroup>
4242

43-
<ItemGroup>
44-
<None Include="$(MSBuildThisFileDirectory)\README.md" Pack="true" PackagePath="\" />
45-
</ItemGroup>
46-
4743
<!-- Remove Node.js runtime dependencies that used by playwright -->
4844
<Target Name="RemoveNodeJsRuntimes" AfterTargets="CopyPlaywrightFilesToOutput">
4945
<ItemGroup>

Directory.Build.targets

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<Project>
2+
3+
<ItemGroup Condition="'$(IsPackable)' == 'true'">
4+
<None Include="$(MSBuildThisFileDirectory)\README.md" Pack="true" PackagePath="\" />
5+
</ItemGroup>
6+
7+
</Project>

docfx.slnx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<Folder Name="/Solution Items/">
33
<File Path=".editorconfig" />
44
<File Path="Directory.Build.props" />
5+
<File Path="Directory.Build.targets" />
56
<File Path="Directory.Packages.props" />
67
</Folder>
78
<Folder Name="/src/">
@@ -38,6 +39,7 @@
3839
</Folder>
3940
<Folder Name="/test/">
4041
<File Path="test/Directory.Build.props" />
42+
<File Path="test/Directory.Build.targets" />
4143
<File Path="test/Directory.Packages.props" />
4244
<Project Path="test/Docfx.Build.Common.Tests/Docfx.Build.Common.Tests.csproj" />
4345
<Project Path="test/Docfx.Build.Tests/Docfx.Build.Tests.csproj" />

test/Directory.Build.props

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<PropertyGroup>
55
<IsPackable>false</IsPackable>
66
<SatelliteResourceLanguages>en</SatelliteResourceLanguages>
7+
<IsTestingPlatformApplication>true</IsTestingPlatformApplication>
8+
<IsTestProject>true</IsTestProject>
79
</PropertyGroup>
810

911
<!-- .NET 9 or later run tests per TargetFramework in parallel by default.
@@ -51,19 +53,20 @@
5153
<TestingPlatformCommandLineArguments>$(TestingPlatformCommandLineArguments) --report-ctrf --report-ctrf-filename TestResults-$(MSBuildProjectName)-$(TargetFramework)-$(RUNNER_OS).ctrf</TestingPlatformCommandLineArguments>
5254
</PropertyGroup>
5355

54-
<ItemGroup Condition="'$(IsTestProject)' == 'true'">
55-
56+
<ItemGroup Condition="$(MSBuildProjectName.EndsWith('.Tests'))">
5657
<!-- Set [assembly:CaptureConsole] attribute to assembly -->
5758
<AssemblyAttribute Include="Xunit.CaptureConsole" />
5859

60+
<!-- Add project items -->
5961
<None Include="TestData\**" CopyToOutputDirectory="PreserveNewest" />
6062
<None Include="$(MSBuildThisFileDirectory)xunit.runner.json" CopyToOutputDirectory="PreserveNewest" />
6163

6264
<!-- Add Docfx.Tests.Common` project reference to test projects -->
6365
<ProjectReference Include="$(MSBuildThisFileDirectory)Docfx.Tests.Common/Docfx.Tests.Common.csproj" />
6466

67+
<!-- Add common test package references -->
6568
<PackageReference Include="AwesomeAssertions" />
6669
<PackageReference Include="xunit.v3.mtp-v2" />
67-
6870
</ItemGroup>
71+
6972
</Project>

test/Directory.Build.targets

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<Project>
2+
<Import Project="$([MSBuild]::GetPathOfFileAbove('$(MSBuildThisFile)', '$(MSBuildThisFileDirectory)../'))" />
3+
</Project>

test/Docfx.Build.Common.Tests/Docfx.Build.Common.Tests.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<IsTestProject>true</IsTestProject>
54
</PropertyGroup>
65

76
<ItemGroup>

test/Docfx.Build.ManagedReference.Tests/Docfx.Build.ManagedReference.Tests.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<IsTestProject>true</IsTestProject>
54
</PropertyGroup>
65

76
<ItemGroup>

test/Docfx.Build.OverwriteDocuments.Tests/Docfx.Build.OverwriteDocuments.Tests.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<IsTestProject>true</IsTestProject>
54
</PropertyGroup>
65

76
<ItemGroup>

test/Docfx.Build.RestApi.Tests/Docfx.Build.RestApi.Tests.csproj

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<IsTestProject>true</IsTestProject>
54
</PropertyGroup>
65

7-
<ItemGroup>
8-
<None Include="TestData\**" CopyToOutputDirectory="PreserveNewest" />
9-
</ItemGroup>
10-
116
<ItemGroup>
127
<ProjectReference Include="..\..\src\Docfx.YamlSerialization\Docfx.YamlSerialization.csproj" />
138
<ProjectReference Include="..\..\src\Docfx.Plugins\Docfx.Plugins.csproj" />

test/Docfx.Build.RestApi.WithPlugins.Tests/Docfx.Build.RestApi.WithPlugins.Tests.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
4-
<IsTestProject>true</IsTestProject>
54
</PropertyGroup>
65

76
<ItemGroup>

0 commit comments

Comments
 (0)