Skip to content

Commit

Permalink
test(HR): Add several test scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
dr1rrb committed Dec 13, 2024
1 parent 7aae564 commit 6c3cc54
Show file tree
Hide file tree
Showing 125 changed files with 2,580 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ public async Task HR(string name, Scenario? scenario, Project[]? projects)
{
if (scenario != null)
{
if (scenario.IsCrashingRoslyn)
{
Assert.Inconclusive("Case is known to crash roslyn.");
return;
}

var results = await ApplyScenario(projects, scenario.IsDebug, scenario.IsMono, scenario.UseXamlReaderReload, name);

for (var i = 0; i < scenario.PassResults.Length; i++)
Expand All @@ -36,7 +42,7 @@ public record ScenariosDescriptor(

public record Project(string Name, ProjectReference[]? ProjectReferences);
public record ProjectReference(string Name);
public record Scenario(bool IsDebug, bool IsMono, bool UseXamlReaderReload, params PassResult[] PassResults)
public record Scenario(bool IsDebug, bool IsMono, bool IsCrashingRoslyn, bool UseXamlReaderReload, params PassResult[] PassResults)
{
public override string ToString()
=> $"{(IsDebug ? "Debug" : "Release")},{(IsMono ? "MonoVM" : "NetCore")},XR:{UseXamlReaderReload}";
Expand All @@ -53,7 +59,7 @@ public record DiagnosticsResult(string Id);
var path = Path.Combine(scenarioFolder, "Scenario.json");

#if DEBUG && false
if (!path.Contains("When_Simple_Xaml_Add_xBind_Function_Property_Add"))
if (!path.Contains("When_DataTemplate_xLoad_xBind_Remove"))
{
continue;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Page x:Class="Test01.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Test01"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Page.Resources>
<DataTemplate x:Key="MyDataTemplate" x:DataType="local:MainPage">
<Button Content="Hello" />
</DataTemplate>
</Page.Resources>

<Grid>
<ContentPresenter Content="Hello" ContentTemplate="{StaticResource MyDataTemplate}" />
</Grid>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Page x:Class="Test01.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Test01"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Page.Resources>
<DataTemplate x:Key="MyDataTemplate" x:DataType="local:MainPage">
<Button Content="Hello" Click="{x:Bind OnClick}" />
</DataTemplate>
</Page.Resources>

<Grid>
<ContentPresenter Content="Hello" ContentTemplate="{StaticResource MyDataTemplate}" />
</Grid>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;

namespace Test01;

public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}

public void OnClick()
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Page x:Class="Test01.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Test01"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Page.Resources>
<DataTemplate x:Key="MyDataTemplate" x:DataType="local:MainPage">
<Button Content="Hello" />
</DataTemplate>
</Page.Resources>

<Grid>
<ContentPresenter Content="Hello" ContentTemplate="{StaticResource MyDataTemplate}" />
</Grid>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;

namespace Test01;

public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Page x:Class="Test01.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Test01"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Page.Resources>
<DataTemplate x:Key="MyDataTemplate" x:DataType="local:MainPage">
<Button Content="Hello" Click="{x:Bind OnClick}" />
</DataTemplate>
</Page.Resources>

<Grid>
<ContentPresenter Content="Hello" ContentTemplate="{StaticResource MyDataTemplate}" />
</Grid>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;

namespace Test01;

public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}

public void OnClick()
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Page x:Class="Test01.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Test01"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Page.Resources>
<DataTemplate x:Key="MyDataTemplate" x:DataType="local:MainPage">
<Button Content="Hello" />
</DataTemplate>
</Page.Resources>

<Grid>
<ContentPresenter Content="Hello" ContentTemplate="{StaticResource MyDataTemplate}" />
</Grid>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;

namespace Test01;

public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"Scenarios": [
{
"IsDebug": true,
"IsMono": false,
"PassResults": [
{
"MetadataUpdates": 1,
"Diagnostics": []
}
]
},
{
"IsDebug": true,
"IsMono": true,
"PassResults": [
{
"MetadataUpdates": 1,
"Diagnostics": []
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Page x:Class="Test01.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Test01"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Page.Resources>
<DataTemplate x:Key="MyDataTemplate" x:DataType="local:MainPage">
<Button Content="Hello" Click="{x:Bind OnClick}" />
</DataTemplate>
</Page.Resources>

<Grid>
<ContentPresenter Content="Hello" ContentTemplate="{StaticResource MyDataTemplate}" />
</Grid>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;

namespace Test01;

public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}

public void OnClick()
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<Page x:Class="Test01.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Test01"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">

<Page.Resources>
<DataTemplate x:Key="MyDataTemplate" x:DataType="local:MainPage">
<Button Content="Hello" />
</DataTemplate>
</Page.Resources>

<Grid>
<ContentPresenter Content="Hello" ContentTemplate="{StaticResource MyDataTemplate}" />
</Grid>
</Page>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Controls.Primitives;
using Microsoft.UI.Xaml.Data;
using Microsoft.UI.Xaml.Input;
using Microsoft.UI.Xaml.Media;
using Microsoft.UI.Xaml.Navigation;

namespace Test01;

public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"Scenarios": [
{
"IsDebug": true,
"IsMono": false,
"PassResults": [
{
"MetadataUpdates": 1,
"Diagnostics": []
}
]
},
{
"IsDebug": true,
"IsMono": true,
"PassResults": [
{
"MetadataUpdates": 1,
"Diagnostics": []
}
]
}
]
}
Loading

0 comments on commit 6c3cc54

Please sign in to comment.