-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add some checks for merged test groups #89521
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
baba1b4
First attempt at first rules
markples 0caf13d
Fix CLRTestExecutionArguments in CLRTest.Execute.Batch.targets, impro…
markples 453e637
XUWG: Display exceptions in stdout, factor a bit
markples 8c7bc27
JIT/opt/Devirtualization/box2: Use Task.Run to de-async Main and then…
markples e0f9528
hfa_nested_f64_interop_cpp.csproj: No RequiresProcessIsolation on lib…
markples b2cbac0
Runtime_82535: Use Fact, remove tabs
markples 11d7bd2
JIT/Methodical/delegate: Use Fact, leave exception for harness
markples 305808c
b08046cs: Remove Environment.ExitCode, improve logic
markples c79f25e
Runtime_75832: Use Assert.Throws
markples 0d5f37f
Factor XUWG
markples fa6db9c
typos
markples 4df2ebf
Make XUW1001 a warning
markples 40753c8
Fix box2.cs
markples 3dd47f2
Reinstate RefXUWG disjuncts in D.B.t
markples d6b3353
Merge remote-tracking branch 'origin/start-merged-checks' into start-…
markples 41a8dcc
Add flush for consistency
markples 31e281f
Limit new checks to merged test groups
markples b9eeedb
box2 - make class public
markples 2b0269f
Remove check that any tests exist
markples 985534e
Revert "Reenable a test which doesn't seem to fail any more. (#85576)"
markples a5bab7b
Merge remote-tracking branch 'dotnet/main' into start-merged-checks
markples 7969174
static for Descriptor; only write entrypoints for apps
markples File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Microsoft.CodeAnalysis; | ||
|
||
namespace XUnitWrapperGenerator; | ||
|
||
public static class Descriptors | ||
{ | ||
public static readonly DiagnosticDescriptor XUWG1001 = | ||
new DiagnosticDescriptor( | ||
"XUW1001", | ||
"Projects in merged tests group should not have entry points", | ||
"Projects in merged tests group should not have entry points. Convert to Facts or Theories.", | ||
"XUnitWrapperGenerator", | ||
DiagnosticSeverity.Warning, | ||
isEnabledByDefault: true); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading; | ||
using Microsoft.CodeAnalysis; | ||
using Microsoft.CodeAnalysis.CSharp; | ||
using Microsoft.CodeAnalysis.CSharp.Syntax; | ||
|
||
namespace XUnitWrapperGenerator | ||
{ | ||
internal class RoslynUtils | ||
{ | ||
/// <summary> | ||
/// Returns the Main method that would serve as the entry point of the assembly, ignoring | ||
/// whether the current target is an executable. | ||
/// </summary> | ||
/// <remarks> | ||
/// Replacement for CSharpCompilation.GetEntryPoint() which only works for executables. | ||
/// Replacement for its helpers that are internal. | ||
/// | ||
/// Intended for the analyzer that is trying to find Main methods that won't be called in | ||
/// merged test groups. Ignores details such as SynthesizedSimpleProgramEntryPointSymbol. | ||
/// Ignores top-level statements as (1) in exes, they will generate an error for conflicting | ||
/// with the auto-generated main, and (2) in libs, they will generate an error for existing | ||
/// at all. | ||
/// </remarks> | ||
internal static IEnumerable<IMethodSymbol> GetPossibleEntryPoints(Compilation comp, CancellationToken cancellationToken) | ||
=> comp | ||
.GetSymbolsWithName(WellKnownMemberNames.EntryPointMethodName, SymbolFilter.Member) | ||
.OfType<IMethodSymbol>() | ||
.Where(m => m.IsStatic && !m.IsAbstract && !m.IsVirtual); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@markples This line results in printing "HH:mm:ssfff Passed test: 1" always -- presumably it shouldn't be a string interpolation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, that's leftover from the original
but was for the outer level. It's weird though; I thought that I looked at the output.