From fcbe997d783896a77cf88e6505651925274be5c0 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 7 Dec 2021 00:40:42 +0100 Subject: [PATCH] Fix source generator unit tests --- .../DiagnosticsTests.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/ComputeSharp.Tests.SourceGenerators/DiagnosticsTests.cs b/tests/ComputeSharp.Tests.SourceGenerators/DiagnosticsTests.cs index 0092a1ae..1943477d 100644 --- a/tests/ComputeSharp.Tests.SourceGenerators/DiagnosticsTests.cs +++ b/tests/ComputeSharp.Tests.SourceGenerators/DiagnosticsTests.cs @@ -1410,12 +1410,15 @@ public class DiagnosticsTests { public interface IComputeShader { } public class ReadWriteBuffer { } - public class EmbeddedBytecodeAttribute : Attribute { } + public class EmbeddedBytecodeAttribute : Attribute + { + public EmbeddedBytecodeAttribute(int threadsX, int threadsY, int threadsZ) { } + } } namespace MyFancyApp.Sample { - [EmbeddedBytecode] + [EmbeddedBytecode(8, 8, 1)] public struct MyShader : IComputeShader { public ReadWriteBuffer buffer; @@ -1476,7 +1479,7 @@ public class DiagnosticsTests /// The input source to process. /// The expected diagnostics ids to be generated. private static void VerifyGeneratedDiagnostics(string source, params string[] diagnosticsIds) - where TGenerator : class, ISourceGenerator, new() + where TGenerator : class, IIncrementalGenerator, new() { SyntaxTree syntaxTree = CSharpSyntaxTree.ParseText(source); @@ -1488,7 +1491,7 @@ public class DiagnosticsTests CSharpCompilation compilation = CSharpCompilation.Create("original", new SyntaxTree[] { syntaxTree }, references, new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)); - ISourceGenerator generator = new TGenerator(); + IIncrementalGenerator generator = new TGenerator(); CSharpGeneratorDriver driver = CSharpGeneratorDriver.Create(generator);