-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Raise the default warning level in tests #47077
Conversation
src/Compilers/Core/CodeAnalysisTest/Diagnostics/CompilationWithAnalyzersTests.cs
Outdated
Show resolved
Hide resolved
@@ -37,6 +37,8 @@ public Exception LoadAnalyzer(string analyzerPath) | |||
|
|||
public class AnalyzerFileReferenceAppDomainTests : TestBase | |||
{ | |||
private const int MaxWarningLevel = 9999; |
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.
Because this project doesn't have a reference to TestOptions
, I created this const. But I don't feel this approach is good. This const is defined in a few other tests in this project.
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.
Perhaps it would be reasonable to define it next to
internal const int DefaultWarningLevel = 4; |
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.
Why isn't max warning level just int.MaxValue
?
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.
It should work, but it was documented here as 9999 so I matched that.
@jaredpar @RikkiGibson I've addressed your feedback and also updated more tests (there are still a few other tests that needs to be updated too). |
src/Compilers/CSharp/Test/Emit/Attributes/InternalsVisibleToAndStrongNameTests.cs
Show resolved
Hide resolved
src/Compilers/Core/CodeAnalysisTest/Diagnostics/CompilationWithAnalyzersTests.cs
Outdated
Show resolved
Hide resolved
src/Compilers/CSharp/Test/Emit/PDB/CSharpDeterministicBuildCompilationTests.cs
Outdated
Show resolved
Hide resolved
Pinging @RikkiGibson |
I think we should include the new warning in |
@RikkiGibson I included it. Can you re-run the failed jobs? the current failures seem unrelated to the changes. If this is ready to go, you may want consider a squash/merge. The number of commits here is unnecessarily large |
@RikkiGibson Build is green now. |
@dotnet/roslyn-compiler for another review. It's a test only change, but sweeping enough that it feels like getting another pair of eyes on it would be good. Suggest starting with the following files:
Then skimming the rest of it. |
Looking |
Note: commit-by-commit review is not recommended at all, the commits here are messy. I'd also recommend a squash/merge to not pollute the master history. |
/// <param name="optimizationLevel">The optimization level of the created compilation options.</param> | ||
/// <param name="allowUnsafe">A boolean specifying whether to allow unsafe code. Defaults to false.</param> | ||
/// <returns>A CSharpCompilationOptions with the specified <paramref name="outputKind"/>, <paramref name="optimizationLevel"/>, and <paramref name="allowUnsafe"/>.</returns> | ||
internal static CSharpCompilationOptions CreateTestOptions(OutputKind outputKind, OptimizationLevel optimizationLevel, bool allowUnsafe = false) |
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.
internal [](start = 8, length = 8)
private? Never mind. Somehow did a bad search ;-) #Closed
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.
LGTM Thanks (iteration 43). I'll re-run CI to make sure we didn't introduce new conflicts this the PR was last run.
@jcouv That was already done. The current CI run was succeeded 2 hours ago in 1h 44m 11s |
Thanks for the contribution @Youssef1313! |
Fixes #46976
@RikkiGibson Could you have a look if what I'm doing until now is the correct thing?