Follow package deprecation instructions

This commit is contained in:
Huo Yaoyuan
2024-11-28 01:21:04 +08:00
parent fea13d8282
commit 23f1c8e409
4 changed files with 6 additions and 10 deletions

View File

@@ -47,7 +47,7 @@ namespace osu.Framework.SourceGeneration.Tests.Dependencies
[Theory]
[MemberData(nameof(CheckWithStatisticsData))]
public void CheckWithStatistics(string name, (int, int, int)[] expectedStatistics)
public void CheckWithStatistics(string name, (int syntaxTargetCreated, int semanticTargetCreated, int emitHits)[] expectedStatistics)
{
GetTestSources(name,
out (string filename, string content)[] commonSources,

View File

@@ -7,7 +7,6 @@ using System.Text;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Testing;
using Microsoft.CodeAnalysis.Testing.Verifiers;
namespace osu.Framework.SourceGeneration.Tests
{
@@ -57,7 +56,7 @@ namespace osu.Framework.SourceGeneration.Tests
string actual = source.SourceText.ToString();
new XUnitVerifier().EqualOrDiff(content, actual, $"Phase {phase}: Generated source {filename} did not match expected content");
new DefaultVerifier().EqualOrDiff(content, actual, $"Phase {phase}: Generated source {filename} did not match expected content");
matches++;
}

View File

@@ -1,12 +1,12 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System;
using System.Collections.Generic;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Testing;
using Microsoft.CodeAnalysis.Testing;
using Microsoft.CodeAnalysis.Testing.Verifiers;
using osu.Framework.SourceGeneration.Generators;
namespace osu.Framework.SourceGeneration.Tests.Verifiers
@@ -14,14 +14,11 @@ namespace osu.Framework.SourceGeneration.Tests.Verifiers
public partial class CSharpSourceGeneratorVerifier<TSourceGenerator>
where TSourceGenerator : AbstractIncrementalGenerator, new()
{
public class Test : CSharpSourceGeneratorTest<EmptySourceGeneratorProvider, XUnitVerifier>
public class Test : CSharpSourceGeneratorTest<EmptySourceGeneratorProvider, DefaultVerifier>
{
public LanguageVersion LanguageVersion { get; set; } = LanguageVersion.Default;
protected override IEnumerable<ISourceGenerator> GetSourceGenerators() => new[]
{
new TSourceGenerator { ForceRun = true }.AsSourceGenerator()
};
protected override IEnumerable<Type> GetSourceGenerators() => [typeof(TSourceGenerator)];
protected override ParseOptions CreateParseOptions()
{

View File

@@ -6,7 +6,7 @@
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.8.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Common" Version="4.8.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing.XUnit" Version="1.1.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.SourceGenerators.Testing" Version="1.1.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">