Skip to content

Commit 51d1971

Browse files
committed
Merge branch 'main' into size-tests
2 parents 3cc08c5 + 5919b4d commit 51d1971

File tree

6 files changed

+12
-49
lines changed

6 files changed

+12
-49
lines changed

src/ApiBuilderTests/ApiBuilderTests.csproj

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
<PackageReference Include="NUnit3TestAdapter" />
99
<PackageReference Include="Microsoft.NET.Test.Sdk" />
1010
<PackageReference Include="ProjectDefaults" PrivateAssets="all" />
11-
<Compile Include="..\Tests\SolutionDirectoryFinder.cs">
12-
<Link>SolutionDirectoryFinder.cs</Link>
13-
</Compile>
11+
<PackageReference Include="ProjectFiles" />
1412
</ItemGroup>
1513
</Project>

src/ApiBuilderTests/BuildApiTest.cs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1+
using ProjectFilesGenerator;
2+
13
[TestFixture]
24
public class BuildApiTest
35
{
4-
static string solutionDirectory;
5-
static string polyfillDir;
6-
7-
static BuildApiTest()
8-
{
9-
solutionDirectory = SolutionDirectoryFinder.Find();
10-
polyfillDir = Path.Combine(solutionDirectory, "Polyfill");
11-
}
6+
static string polyfillDir = Path.Combine(ProjectFiles.SolutionDirectory, "Polyfill");
127

138
[Test]
149
public void RunWithRoslyn()
1510
{
16-
var md = Path.Combine(solutionDirectory, "..", "api_list.include.md");
11+
var md = Path.Combine(ProjectFiles.SolutionDirectory, "..", "api_list.include.md");
1712
File.Delete(md);
1813
using var writer = File.CreateText(md);
1914
var count = 0;
@@ -31,7 +26,7 @@ public void RunWithRoslyn()
3126
//Nullability*
3227
count += 3;
3328

34-
var countMd = Path.Combine(solutionDirectory, "..", "apiCount.include.md");
29+
var countMd = Path.Combine(ProjectFiles.SolutionDirectory, "..", "apiCount.include.md");
3530
File.Delete(countMd);
3631
File.WriteAllText(countMd, $"**API count: {count}**");
3732
}

src/Directory.Packages.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<PackageVersion Include="NUnit3TestAdapter" Version="5.0.0" Pinned="true" />
1313
<PackageVersion Include="ProjectDefaults" Version="1.0.163" />
1414
<PackageVersion Include="Microsoft.Bcl.Memory" Version="10.0.1" />
15+
<PackageVersion Include="ProjectFiles" Version="0.2.0" />
1516
<PackageVersion Include="System.Memory" Version="4.6.3" />
1617
<PackageVersion Include="System.Net.Http" Version="4.3.4" />
1718
<PackageVersion Include="System.Threading.Tasks.Extensions" Version="4.6.3" />

src/Tests/SanityChecks.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#pragma warning disable IL2026
1+
using ProjectFilesGenerator;
2+
3+
#pragma warning disable IL2026
24

35
[TestFixture]
46
public class SanityChecks
@@ -21,7 +23,7 @@ public void NoPublicTypes()
2123
[Test]
2224
public void CodeChecks()
2325
{
24-
var dir = Path.Combine(SolutionDirectoryFinder.Find(), "Polyfill");
26+
var dir = Path.Combine(ProjectFiles.SolutionDirectory, "Polyfill");
2527
var errors = new List<string>();
2628
foreach (var file in Directory.EnumerateFiles(dir, "*.cs", SearchOption.AllDirectories))
2729
{

src/Tests/SolutionDirectoryFinder.cs

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/Tests/Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
<PackageReference Include="Microsoft.NET.Test.Sdk" />
1111
<PackageReference Include="MarkdownSnippets.MsBuild" PrivateAssets="all" />
1212
<PackageReference Include="ProjectDefaults" PrivateAssets="all" />
13+
<PackageReference Include="ProjectFiles" />
1314
<PackageReference Include="System.Memory" Condition="$(TargetFrameworkIdentifier) == '.NETStandard' or $(TargetFrameworkIdentifier) == '.NETFramework' or $(TargetFramework.StartsWith('netcoreapp'))" />
1415
<PackageReference Include="System.ValueTuple" Condition="$(TargetFramework.StartsWith('net46'))" />
1516
<PackageReference Include="System.Net.Http" Condition="$(TargetFramework.StartsWith('net4'))" />

0 commit comments

Comments
 (0)