191 references to WithWarningLevel
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (1)
RemoveUnnecessaryImportsTests.cs (1)
2087return solution.WithProjectCompilationOptions(projectId, compilationOptions.WithWarningLevel(warningLevel));
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
RemoveUnnecessaryImportsTests.cs (1)
2087return solution.WithProjectCompilationOptions(projectId, compilationOptions.WithWarningLevel(warningLevel));
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (6)
CodeGen\CodeGenAsyncTests.cs (1)
1063CreateCompilation(source, options: TestOptions.UnsafeDebugExe.WithWarningLevel(7)).VerifyDiagnostics(
CodeGen\CodeGenLocalFunctionTests.cs (2)
2439VerifyOutput(source, "2", TestOptions.ReleaseExe.WithWarningLevel(0)); 4609VerifyOutput(source, output, TestOptions.ReleaseExe.WithAllowUnsafe(true).WithWarningLevel(0), verify: Verification.Passes);
CodeGen\CodeGenOperators.cs (1)
2293CompileAndVerify(source, expectedOutput: "0", options: TestOptions.ReleaseExe.WithWarningLevel(5)).VerifyDiagnostics(
CodeGen\CodeGenOptimizedNullableOperators.cs (1)
1098CompileAndVerify(source, expectedOutput: expectedOutput, options: TestOptions.ReleaseExe.WithWarningLevel(4)).VerifyDiagnostics(
Emit\EntryPointTests.cs (1)
18return CreateCompilation(source, options: TestOptions.ReleaseExe.WithWarningLevel(5).WithMainTypeName(mainTypeName), parseOptions: parseOptions);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (20)
Attributes\AttributeTests_CallerInfoAttributes.cs (1)
3310CreateCompilationWithMscorlib45(source, options: TestOptions.ReleaseDll.WithWarningLevel(0)).VerifyDiagnostics(
Attributes\AttributeTests_NativeInteger.cs (1)
1421comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6), parseOptions: TestOptions.Regular9);
Emit\NumericIntPtrTests.cs (2)
1021var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5), parseOptions: TestOptions.Regular9, targetFramework: TargetFramework.Net70); 1024comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6), parseOptions: TestOptions.Regular9, targetFramework: TargetFramework.Net70);
FlowAnalysis\StructTests.cs (16)
250options: TestOptions.ReleaseDll.WithWarningLevel(5), 260options: TestOptions.ReleaseDll.WithWarningLevel(5), 270options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel), 277options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel), 339CreateCompilation(source2, references: new MetadataReference[] { sourceReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics( 341CreateCompilation(source2, references: new MetadataReference[] { metadataReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics( 343CreateCompilation(source2, references: new MetadataReference[] { sourceReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics( 348CreateCompilation(source2, references: new MetadataReference[] { metadataReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics( 384CreateCompilation(source2, references: new MetadataReference[] { sourceReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics( 386CreateCompilation(source2, references: new MetadataReference[] { metadataReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics( 388CreateCompilation(source2, references: new MetadataReference[] { sourceReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics( 393CreateCompilation(source2, references: new MetadataReference[] { metadataReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics( 428CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics( 476CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: WithNullableEnable().WithWarningLevel(5)).VerifyDiagnostics( 504CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics( 506CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics(
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (53)
Semantics\NameOfTests.cs (2)
239var option = TestOptions.ReleaseExe.WithWarningLevel(0); 425var option = TestOptions.ReleaseExe.WithWarningLevel(0);
Semantics\NativeIntegerTests.cs (2)
3489var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5), parseOptions: TestOptions.Regular9); 3492comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6), parseOptions: TestOptions.Regular9);
Semantics\NullableConversionTests.cs (1)
653var compilation = CreateCompilation(source, options: TestOptions.ReleaseExe.WithWarningLevel(0));
Semantics\RecordTests.cs (1)
2823comp = CreateCompilation(src, parseOptions: TestOptions.Regular8, options: TestOptions.ReleaseDll.WithWarningLevel(6));
Semantics\SemanticErrorTests.cs (3)
12760CreateCompilation(text, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics( 18340CreateCompilation(source, options: TestOptions.DebugExe.WithWarningLevel(5)).VerifyDiagnostics(); 20921this.CompileAndVerify(source: text, expectedOutput: expected, options: TestOptions.ReleaseExe.WithWarningLevel(4)).VerifyDiagnostics(compatibleExpected);
Semantics\WarningVersionTests.cs (41)
48CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics(); 49CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(3)).VerifyDiagnostics(); 50CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(4)).VerifyDiagnostics(); 51CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics(whenWave5); 52CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6)).VerifyDiagnostics(whenWave5); 78CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics(); 79CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(4)).VerifyDiagnostics(); 80CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics(whenWave5); 117CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics(); 118CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(4)).VerifyDiagnostics(); 119CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics(whenWave5); 157options: TestOptions.DebugDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel), 166options: TestOptions.DebugDll.WithWarningLevel(5), 179options: TestOptions.DebugDll.WithWarningLevel(5), 189.WithWarningLevel(5) 235options: TestOptions.DebugDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel), 244options: TestOptions.DebugDll.WithWarningLevel(5), 258.WithWarningLevel(5), 268.WithWarningLevel(5) 321options: TestOptions.DebugDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel), 330options: TestOptions.DebugDll.WithWarningLevel(5), 346options: TestOptions.DebugDll.WithWarningLevel(5), 359.WithWarningLevel(5) 392CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics( 394CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics( 445options: TestOptions.DebugDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel), 454options: TestOptions.DebugDll.WithWarningLevel(5), 467options: TestOptions.DebugDll.WithWarningLevel(5), 477.WithWarningLevel(5) 532options: TestOptions.DebugDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel), 541options: TestOptions.DebugDll.WithWarningLevel(5), 554options: TestOptions.DebugDll.WithWarningLevel(5), 564.WithWarningLevel(5) 619options: TestOptions.DebugDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel), 628options: TestOptions.DebugDll.WithWarningLevel(5), 641options: TestOptions.DebugDll.WithWarningLevel(5), 651.WithWarningLevel(5) 683CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics( 685CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics( 713CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics( 715CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics(
SourceGeneration\GeneratorDriverTests.cs (3)
1183verifyDiagnosticsWithOptions(options.WithWarningLevel(0)); 1185verifyDiagnosticsWithOptions(options.WithWarningLevel(2), 1188verifyDiagnosticsWithOptions(options.WithWarningLevel(3),
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (40)
Compilation\CompilationAPITests.cs (2)
231CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(0)).VerifyDiagnostics( 289var compilationOptions = TestOptions.DebugDll.WithWarningLevel(0);
Compilation\CSharpCompilationOptionsTests.cs (5)
123TestProperty((old, value) => old.WithWarningLevel(value), opt => opt.WarningLevel, 3); 239Assert.Equal(1, new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithWarningLevel(1).WarningLevel); 240new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithWarningLevel(-1).VerifyErrors( 244new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithWarningLevel(5).VerifyErrors(); 245new CSharpCompilationOptions(OutputKind.ConsoleApplication).WithWarningLevel(int.MaxValue).VerifyErrors();
Compilation\GetUnusedImportDirectivesTests.cs (2)
291comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(3)); 317var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(0));
Symbols\ExtendedPartialMethodsTests.cs (20)
2658var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 2664comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 2702var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 2705comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 2730var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 2739comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 3034var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 3037comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 3061var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 3064comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 3142var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 3166comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 3249var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5)); 3252comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6)); 3287var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5)); 3305comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6)); 3348var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5)); 3351comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6)); 3389var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5)); 3392comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6));
Symbols\SymbolErrorTests.cs (11)
13283var regularComp = CreateCompilation(text, options: TestOptions.ReleaseDll.WithWarningLevel(4)); 13709comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(4)); 21231comp = CreateCompilation(text, parseOptions: TestOptions.Regular11, options: TestOptions.DebugDll.WithWarningLevel(6)); 21234comp = CreateCompilation(text, parseOptions: TestOptions.Regular11, options: TestOptions.DebugDll.WithWarningLevel(7)); 21292comp = CreateCompilation(text, parseOptions: TestOptions.Regular11, options: TestOptions.DebugDll.WithWarningLevel(6)); 21295comp = CreateCompilation(text, parseOptions: TestOptions.Regular11, options: TestOptions.DebugDll.WithWarningLevel(7)); 21337comp = CreateCompilation(text, parseOptions: TestOptions.Regular11, options: TestOptions.DebugDll.WithWarningLevel(6)); 21356comp = CreateCompilation(text, parseOptions: TestOptions.Regular11, options: TestOptions.DebugDll.WithWarningLevel(7)); 21379var comp = CreateCompilation(text, parseOptions: TestOptions.Regular11, options: TestOptions.DebugDll.WithWarningLevel(7)); 21397comp = CreateCompilation(text, parseOptions: TestOptions.Regular11, options: TestOptions.DebugDll.WithWarningLevel(7)); 21424comp = CreateCompilation(text, parseOptions: TestOptions.Regular11, options: TestOptions.DebugDll.WithWarningLevel(7));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (69)
Diagnostics\DiagnosticTest.cs (69)
599option = commonoption.WithWarningLevel(3); 608option = commonoption.WithWarningLevel(2); 611option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 614option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 649option = commonoption.WithWarningLevel(3); 655option = commonoption.WithWarningLevel(2); 658option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 661option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 703option = commonoption.WithWarningLevel(3); 712option = commonoption.WithWarningLevel(2); 715option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 718option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 759option = commonoption.WithWarningLevel(3); 768option = commonoption.WithWarningLevel(2); 771option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 774option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 815option = commonoption.WithWarningLevel(3); 824option = commonoption.WithWarningLevel(2); 827option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 830option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 873option = commonoption.WithWarningLevel(3); 882option = commonoption.WithWarningLevel(2); 885option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 888option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 931option = commonoption.WithWarningLevel(3); 940option = commonoption.WithWarningLevel(2); 943option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 946option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 993option = commonoption.WithWarningLevel(3); 1005option = commonoption.WithWarningLevel(2); 1008option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 1011option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 1066option = commonoption.WithWarningLevel(3); 1081option = commonoption.WithWarningLevel(2); 1084option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 1087option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 1134option = commonoption.WithWarningLevel(3); 1146option = commonoption.WithWarningLevel(2); 1149option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 1152option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 1193option = commonoption.WithWarningLevel(3); 1199option = commonoption.WithWarningLevel(2); 1202option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 1205option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 1246option = commonoption.WithWarningLevel(3); 1252option = commonoption.WithWarningLevel(2); 1255option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 1258option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 1300option = commonoption.WithWarningLevel(3); 1306option = commonoption.WithWarningLevel(2); 1309option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 1312option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 1347option = commonoption.WithWarningLevel(3); 1350option = commonoption.WithWarningLevel(2); 1353option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 1356option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 1401option = commonoption.WithWarningLevel(3); 1407option = commonoption.WithWarningLevel(2); 1410option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 1413option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 1480option = commonoption.WithWarningLevel(2); 1530option = commonoption.WithWarningLevel(2); 1583option = commonoption.WithWarningLevel(2); 1636option = commonoption.WithWarningLevel(2); 1680option = commonoption.WithWarningLevel(2); 1711option = commonoption.WithWarningLevel(2); 1757option = commonoption.WithWarningLevel(2); 1812option = commonoption.WithWarningLevel(2); 2245option = commonoption.WithWarningLevel(2);
Microsoft.VisualStudio.LanguageServices.CSharp (1)
ProjectSystemShim\CSharpProjectShim.OptionsProcessor.cs (1)
151.WithWarningLevel(warningLevel);