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