diff --git a/osu.Framework.SourceGeneration.Tests/Dependencies/DependencyInjectionMultiPhaseSourceGeneratorTests.cs b/osu.Framework.SourceGeneration.Tests/Dependencies/DependencyInjectionMultiPhaseSourceGeneratorTests.cs index cd99dce75..e9a5db327 100644 --- a/osu.Framework.SourceGeneration.Tests/Dependencies/DependencyInjectionMultiPhaseSourceGeneratorTests.cs +++ b/osu.Framework.SourceGeneration.Tests/Dependencies/DependencyInjectionMultiPhaseSourceGeneratorTests.cs @@ -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, diff --git a/osu.Framework.SourceGeneration.Tests/GeneratorTestHelper.cs b/osu.Framework.SourceGeneration.Tests/GeneratorTestHelper.cs index 36542417d..9769eff76 100644 --- a/osu.Framework.SourceGeneration.Tests/GeneratorTestHelper.cs +++ b/osu.Framework.SourceGeneration.Tests/GeneratorTestHelper.cs @@ -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++; } diff --git a/osu.Framework.SourceGeneration.Tests/Verifiers/CSharpSourceGeneratorVerifier_Test.cs b/osu.Framework.SourceGeneration.Tests/Verifiers/CSharpSourceGeneratorVerifier_Test.cs index b45a96e67..3a7417030 100644 --- a/osu.Framework.SourceGeneration.Tests/Verifiers/CSharpSourceGeneratorVerifier_Test.cs +++ b/osu.Framework.SourceGeneration.Tests/Verifiers/CSharpSourceGeneratorVerifier_Test.cs @@ -1,12 +1,12 @@ // Copyright (c) ppy Pty Ltd . 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 where TSourceGenerator : AbstractIncrementalGenerator, new() { - public class Test : CSharpSourceGeneratorTest + public class Test : CSharpSourceGeneratorTest { public LanguageVersion LanguageVersion { get; set; } = LanguageVersion.Default; - protected override IEnumerable GetSourceGenerators() => new[] - { - new TSourceGenerator { ForceRun = true }.AsSourceGenerator() - }; + protected override IEnumerable GetSourceGenerators() => [typeof(TSourceGenerator)]; protected override ParseOptions CreateParseOptions() { diff --git a/osu.Framework.SourceGeneration.Tests/osu.Framework.SourceGeneration.Tests.csproj b/osu.Framework.SourceGeneration.Tests/osu.Framework.SourceGeneration.Tests.csproj index 92f4f7a24..2ef3ebb1a 100644 --- a/osu.Framework.SourceGeneration.Tests/osu.Framework.SourceGeneration.Tests.csproj +++ b/osu.Framework.SourceGeneration.Tests/osu.Framework.SourceGeneration.Tests.csproj @@ -6,7 +6,7 @@ - +