Skip to content

[release/9.0] Fixing Analyzer issues, servicing, Part 2: Actual Fixes #13182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: servicing/RefactorAnalyzerTests9.0Rel
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Winforms.sln
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Windows.Forms.Analyz
EndProject
Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "System.Windows.Forms.Analyzers.VisualBasic.Tests", "src\System.Windows.Forms.Analyzers\vb\tests\System.Windows.Forms.Analyzers.VisualBasic.Tests.vbproj", "{ACF7ACC1-5163-8728-DEA7-7758DF20738E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Prompting", "Prompting", "{681B7522-35D1-4D58-8956-6E5E26D461B2}"
ProjectSection(SolutionItems) = preProject
src\System.Windows.Forms.Analyzers\prompting\AnalyzerTests-Copilot-Instructions.md = src\System.Windows.Forms.Analyzers\prompting\AnalyzerTests-Copilot-Instructions.md
src\System.Windows.Forms.Analyzers\prompting\SamplePrompt for AnalyzerTests.md = src\System.Windows.Forms.Analyzers\prompting\SamplePrompt for AnalyzerTests.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -1121,6 +1127,7 @@ Global
{6D3F4979-A444-778A-B6ED-6AA1786DADA0} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{1D7A95BF-545D-8D63-3CD1-75619B80A2A0} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{ACF7ACC1-5163-8728-DEA7-7758DF20738E} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
{681B7522-35D1-4D58-8956-6E5E26D461B2} = {02EA681E-C7D8-13C7-8484-4AC65E1B71E8}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7B1B0433-F612-4E5A-BE7E-FCF5B9F6E136}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,12 @@ public override IEnumerable<object[]> GetData(MethodInfo testMethod)
?? throw new InvalidOperationException(
$"The type '{baseType}' does not contain a static public method named 'GetFileSets'.");

// Invoke that method to get the object array:
IEnumerable<object> fileSets = (IEnumerable<object>) (getFileSetsMethod.Invoke(null, null)
?? throw new InvalidOperationException("GetFileSets method returned null or a value that couldn't be cast to IEnumerable<object[]>."));

// This is the data, which the test class directs itself to get.
var baseData = base.GetData(testMethod).ToList();

// Use LINQ to create the cross product more efficiently
return baseData
.SelectMany(referenceAssembly => fileSets.Select(fileSet =>
new object[] { referenceAssembly[0], fileSet }));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,26 @@

namespace System.Windows.Forms.Analyzers.Tests.Microsoft.WinForms;

[Flags]
internal enum NetVersion
{
Net6_0,
Net7_0,
Net8_0,
Net9_0
Net6_0 = 0x00000006,
Net7_0 = 0x00000007,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm concerned that eventually & will go out of support and will not be installed on the CI machines. Can we test only against 9 in the servicing branches?

Net8_0 = 0x00000008,
Net9_0 = 0x00000009,
Net10_0 = 0x0000000A,
Net11_0 = 0x0000000B,
Net12_0 = 0x0000000C,

/// <summary>
/// If this is selected, we're taking WinForms runtime build from
/// this repo and the .NET version, the runtime is build against.
/// </summary>
WinFormsBuild = 0x01000000,

/// <summary>
/// If this is OR'ed in, we're taking the specified runtime version,
/// and the WinForms runtime for this repo.
/// </summary>
BuildOutput = 0x10000000
}
Loading