@@ -11,15 +11,15 @@ namespace Microsoft.Maui.Controls.SourceGen.UnitTests;
1111
1212public class SourceGenXamlInitializeComponentTestBase : SourceGenTestsBase
1313{
14- protected record AdditionalXamlFile ( string Path , string Content , string ? RelativePath = null , string ? TargetPath = null , string ? ManifestResourceName = null , string ? TargetFramework = null , string ? NoWarn = null , bool TreeOrder = false , bool Dry = false )
15- : AdditionalFile ( Text : ToAdditionalText ( Path , Content ) , Kind : "Xaml" , RelativePath : RelativePath ?? Path , TargetPath : TargetPath , ManifestResourceName : ManifestResourceName , TargetFramework : TargetFramework , NoWarn : NoWarn ) ;
14+ protected record AdditionalXamlFile ( string Path , string Content , string ? RelativePath = null , string ? TargetPath = null , string ? ManifestResourceName = null , string ? TargetFramework = null , string ? NoWarn = null , string Lineinfo = "enable" )
15+ : AdditionalFile ( Text : ToAdditionalText ( Path , Content ) , Kind : "Xaml" , RelativePath : RelativePath ?? Path , TargetPath : TargetPath , ManifestResourceName : ManifestResourceName , TargetFramework : TargetFramework , NoWarn : NoWarn , LineInfo : Lineinfo ) ;
1616
17- protected ( GeneratorDriverRunResult result , string ? text ) RunGenerator ( string xaml , string code , string noWarn = "" , string targetFramework = "" , string ? path = null , bool treeOrder = false , bool dry = false )
17+ protected ( GeneratorDriverRunResult result , string ? text ) RunGenerator ( string xaml , string code , string noWarn = "" , string targetFramework = "" , string ? path = null , string lineinfo = "enable" )
1818 {
1919 var compilation = CreateMauiCompilation ( ) ;
2020 compilation = compilation . AddSyntaxTrees ( CSharpSyntaxTree . ParseText ( code ) ) ;
2121 var workingDirectory = Environment . CurrentDirectory ;
22- var xamlFile = new AdditionalXamlFile ( Path . Combine ( workingDirectory , path ?? "Test.xaml" ) , xaml , RelativePath : path ?? "Test.xaml" , TargetFramework : targetFramework , NoWarn : noWarn , ManifestResourceName : $ "{ compilation . AssemblyName } .Test.xaml", TreeOrder : treeOrder , Dry : dry ) ;
22+ var xamlFile = new AdditionalXamlFile ( Path . Combine ( workingDirectory , path ?? "Test.xaml" ) , xaml , RelativePath : path ?? "Test.xaml" , TargetFramework : targetFramework , NoWarn : noWarn , ManifestResourceName : $ "{ compilation . AssemblyName } .Test.xaml", Lineinfo : lineinfo ) ;
2323 var result = RunGenerator < CodeBehindGenerator > ( compilation , xamlFile ) ;
2424 var generated = result . Results . SingleOrDefault ( ) . GeneratedSources . SingleOrDefault ( gs => gs . HintName . EndsWith ( ".xsg.cs" ) ) . SourceText ? . ToString ( ) ;
2525
0 commit comments