199 references to WithWarningLevel
Microsoft.CodeAnalysis.CSharp.CodeStyle.UnitTests (1)
src\Analyzers\CSharp\Tests\RemoveUnnecessaryImports\RemoveUnnecessaryImportsTests.cs (1)
2023return solution.WithProjectCompilationOptions(projectId, compilationOptions.WithWarningLevel(warningLevel));
Microsoft.CodeAnalysis.CSharp.CSharp15.UnitTests (2)
UnsafeEvolutionTests.cs (2)
8726options: TestOptions.UnsafeReleaseDll.WithWarningLevel(10)) 8729options: TestOptions.UnsafeReleaseDll.WithWarningLevel(11))
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (6)
CodeGen\CodeGenAsyncTests.cs (1)
2211CreateCompilation(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)
2291CompileAndVerify(source, expectedOutput: "0", options: TestOptions.ReleaseExe.WithWarningLevel(5)).VerifyDiagnostics(
CodeGen\CodeGenOptimizedNullableOperators.cs (1)
1406CompileAndVerify(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 (2)
Emit\NumericIntPtrTests.cs (2)
1027var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5), parseOptions: TestOptions.Regular9, targetFramework: TargetFramework.Net70); 1030comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6), parseOptions: TestOptions.Regular9, targetFramework: TargetFramework.Net70);
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (21)
Attributes\AttributeTests_CallerInfoAttributes.cs (1)
3323CreateCompilationWithMscorlib461(source, options: TestOptions.ReleaseDll.WithWarningLevel(0)).VerifyDiagnostics(
Attributes\AttributeTests_MarshalAs.cs (2)
704options: TestOptions.ReleaseDll.WithWarningLevel(7)) 709options: TestOptions.ReleaseDll.WithWarningLevel(8))
Attributes\AttributeTests_NativeInteger.cs (1)
1423comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6), parseOptions: TestOptions.Regular9);
FlowAnalysis\StructTests.cs (16)
560options: TestOptions.ReleaseDll.WithWarningLevel(5), 570options: TestOptions.ReleaseDll.WithWarningLevel(5), 580options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel), 587options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel), 649CreateCompilation(source2, references: new MetadataReference[] { sourceReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics( 651CreateCompilation(source2, references: new MetadataReference[] { metadataReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics( 653CreateCompilation(source2, references: new MetadataReference[] { sourceReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics( 658CreateCompilation(source2, references: new MetadataReference[] { metadataReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics( 694CreateCompilation(source2, references: new MetadataReference[] { sourceReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics( 696CreateCompilation(source2, references: new MetadataReference[] { metadataReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics( 698CreateCompilation(source2, references: new MetadataReference[] { sourceReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics( 703CreateCompilation(source2, references: new MetadataReference[] { metadataReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics( 738CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics( 786CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: WithNullableEnable().WithWarningLevel(5)).VerifyDiagnostics( 814CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(CodeAnalysis.Diagnostic.DefaultWarningLevel)).VerifyDiagnostics( 816CreateCompilation(source2, references: new MetadataReference[] { moduleReference }, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics(
Semantics\RecordTests.cs (1)
2878comp = CreateCompilation(src, parseOptions: TestOptions.Regular8, options: TestOptions.ReleaseDll.WithWarningLevel(6));
Microsoft.CodeAnalysis.CSharp.Features.UnitTests (1)
src\Analyzers\CSharp\Tests\RemoveUnnecessaryImports\RemoveUnnecessaryImportsTests.cs (1)
2023return solution.WithProjectCompilationOptions(projectId, compilationOptions.WithWarningLevel(warningLevel));
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (56)
Semantics\InterceptorsTests.cs (2)
65var comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: RegularWithInterceptors, options: TestOptions.DebugExe.WithWarningLevel(8)); 68comp = CreateCompilation([source, interceptors, s_attributesSource], parseOptions: RegularWithInterceptors, options: TestOptions.DebugExe.WithWarningLevel(9));
Semantics\NameOfTests.cs (2)
241var option = TestOptions.ReleaseExe.WithWarningLevel(0); 421var option = TestOptions.ReleaseExe.WithWarningLevel(0);
Semantics\NativeIntegerTests.cs (2)
3494var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5), parseOptions: TestOptions.Regular9); 3497comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6), parseOptions: TestOptions.Regular9);
Semantics\NullableConversionTests.cs (1)
653var compilation = CreateCompilation(source, options: TestOptions.ReleaseExe.WithWarningLevel(0));
Semantics\RefFieldTests.cs (2)
5546CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(9), targetFramework: TargetFramework.Net70).VerifyDiagnostics(); 5555CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(10), targetFramework: TargetFramework.Net70).VerifyDiagnostics(expectedDiagnostics);
Semantics\SemanticErrorTests.cs (3)
12855CreateCompilation(text, options: TestOptions.ReleaseDll.WithWarningLevel(5)).VerifyDiagnostics( 18494CreateCompilation(source, options: TestOptions.DebugExe.WithWarningLevel(5)).VerifyDiagnostics(); 21192this.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)
1187verifyDiagnosticsWithOptions(options.WithWarningLevel(0)); 1189verifyDiagnosticsWithOptions(options.WithWarningLevel(2), 1192verifyDiagnosticsWithOptions(options.WithWarningLevel(3),
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (40)
Compilation\CompilationAPITests.cs (2)
229CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(0)).VerifyDiagnostics( 287var 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)
3050var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 3056comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 3094var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 3097comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 3122var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 3131comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 3426var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 3429comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 3453var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 3456comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 3534var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 3558comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6), parseOptions: TestOptions.RegularWithExtendedPartialMethods); 3641var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5)); 3644comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6)); 3679var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5)); 3697comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6)); 3740var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5)); 3743comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6)); 3781var comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(5)); 3784comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(6));
Symbols\SymbolErrorTests.cs (11)
13442var regularComp = CreateCompilation(text, options: TestOptions.ReleaseDll.WithWarningLevel(4)); 13868comp = CreateCompilation(source, options: TestOptions.ReleaseDll.WithWarningLevel(4)); 21400comp = CreateCompilation(text, parseOptions: TestOptions.Regular11, options: TestOptions.DebugDll.WithWarningLevel(6)); 21403comp = CreateCompilation(text, parseOptions: TestOptions.Regular11, options: TestOptions.DebugDll.WithWarningLevel(7)); 21461comp = CreateCompilation(text, parseOptions: TestOptions.Regular11, options: TestOptions.DebugDll.WithWarningLevel(6)); 21464comp = CreateCompilation(text, parseOptions: TestOptions.Regular11, options: TestOptions.DebugDll.WithWarningLevel(7)); 21506comp = CreateCompilation(text, parseOptions: TestOptions.Regular11, options: TestOptions.DebugDll.WithWarningLevel(6)); 21525comp = CreateCompilation(text, parseOptions: TestOptions.Regular11, options: TestOptions.DebugDll.WithWarningLevel(7)); 21548var comp = CreateCompilation(text, parseOptions: TestOptions.Regular11, options: TestOptions.DebugDll.WithWarningLevel(7)); 21566comp = CreateCompilation(text, parseOptions: TestOptions.Regular11, options: TestOptions.DebugDll.WithWarningLevel(7)); 21593comp = CreateCompilation(text, parseOptions: TestOptions.Regular11, options: TestOptions.DebugDll.WithWarningLevel(7));
Microsoft.CodeAnalysis.CSharp.Syntax.UnitTests (69)
Diagnostics\DiagnosticTest.cs (69)
640option = commonoption.WithWarningLevel(3); 649option = commonoption.WithWarningLevel(2); 652option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 655option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 690option = commonoption.WithWarningLevel(3); 696option = commonoption.WithWarningLevel(2); 699option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 702option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 744option = commonoption.WithWarningLevel(3); 753option = commonoption.WithWarningLevel(2); 756option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 759option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 800option = commonoption.WithWarningLevel(3); 809option = commonoption.WithWarningLevel(2); 812option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 815option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 856option = commonoption.WithWarningLevel(3); 865option = commonoption.WithWarningLevel(2); 868option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 871option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 914option = commonoption.WithWarningLevel(3); 923option = commonoption.WithWarningLevel(2); 926option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 929option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 972option = commonoption.WithWarningLevel(3); 981option = commonoption.WithWarningLevel(2); 984option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 987option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 1034option = commonoption.WithWarningLevel(3); 1046option = commonoption.WithWarningLevel(2); 1049option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 1052option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 1107option = commonoption.WithWarningLevel(3); 1122option = commonoption.WithWarningLevel(2); 1125option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 1128option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 1175option = commonoption.WithWarningLevel(3); 1187option = commonoption.WithWarningLevel(2); 1190option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 1193option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 1234option = commonoption.WithWarningLevel(3); 1240option = commonoption.WithWarningLevel(2); 1243option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 1246option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 1287option = commonoption.WithWarningLevel(3); 1293option = commonoption.WithWarningLevel(2); 1296option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 1299option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 1341option = commonoption.WithWarningLevel(3); 1347option = commonoption.WithWarningLevel(2); 1350option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 1353option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 1388option = commonoption.WithWarningLevel(3); 1391option = commonoption.WithWarningLevel(2); 1394option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 1397option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 1442option = commonoption.WithWarningLevel(3); 1448option = commonoption.WithWarningLevel(2); 1451option = commonoption.WithWarningLevel(2).WithGeneralDiagnosticOption(ReportDiagnostic.Error); 1454option = commonoption.WithWarningLevel(2).WithSpecificDiagnosticOptions(warnings); 1521option = commonoption.WithWarningLevel(2); 1571option = commonoption.WithWarningLevel(2); 1624option = commonoption.WithWarningLevel(2); 1677option = commonoption.WithWarningLevel(2); 1721option = commonoption.WithWarningLevel(2); 1752option = commonoption.WithWarningLevel(2); 1798option = commonoption.WithWarningLevel(2); 1853option = commonoption.WithWarningLevel(2); 2286option = commonoption.WithWarningLevel(2);
Microsoft.VisualStudio.LanguageServices.CSharp (1)
ProjectSystemShim\CSharpProjectShim.OptionsProcessor.cs (1)
151.WithWarningLevel(warningLevel);