7 instantiations of MockCSharpCompiler
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (6)
CommandLineTestBase.cs (1)
63
return new
MockCSharpCompiler
(responseFile, buildPaths, args, analyzers.AsImmutableOrEmpty(), generators.AsImmutableOrEmpty(), loader, driverCache, additionalReferences.AsImmutableOrEmpty());
CommandLineTests.cs (5)
8449
MockCSharpCompiler csc = new
MockCSharpCompiler
(
12306
var csc = new
MockCSharpCompiler
(null, buildPaths, args: new[] { "/features:UseLegacyStrongNameProvider", "/nostdlib", "a.cs" });
12321
var csc = new
MockCSharpCompiler
(null, buildPaths, args: new[] { features, "a.cs" });
12341
var csc = new
MockCSharpCompiler
(null, buildPaths, args: new[] { @"/features:InterceptorsNamespaces=NS1.NS2", @"/features:InterceptorsNamespaces=NS3.NS4", "a.cs" });
12362
var csc = new
MockCSharpCompiler
(null, buildPaths, args: new[] { @"/features:InterceptorsPreviewNamespaces=NS1.NS2", "a.cs" });
Microsoft.CodeAnalysis.Rebuild.UnitTests (1)
CSharpDeterministicKeyBuilderTests.cs (1)
376
var compiler = new
MockCSharpCompiler
(
155 references to MockCSharpCompiler
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (154)
CommandLineIVTTests.cs (7)
33
var
compiler = CreateCSharpCompiler(new[] {
110
var
compiler = CreateCSharpCompiler(new[] {
189
var
compiler = CreateCSharpCompiler(new[] {
274
var
compiler = CreateCSharpCompiler(new[] {
336
var
compiler = CreateCSharpCompiler(new[] {
350
var
compiler = CreateCSharpCompiler(new[] {
362
var
compiler = CreateCSharpCompiler(new[] {
CommandLineTestBase.cs (2)
55
internal
MockCSharpCompiler
CreateCSharpCompiler(string[] args, DiagnosticAnalyzer[]? analyzers = null, ISourceGenerator[]? generators = null, AnalyzerAssemblyLoader? loader = null, GeneratorDriverCache? driverCache = null, MetadataReference[]? additionalReferences = null)
60
internal
MockCSharpCompiler
CreateCSharpCompiler(string? responseFile, string workingDirectory, string[] args, DiagnosticAnalyzer[]? analyzers = null, ISourceGenerator[]? generators = null, AnalyzerAssemblyLoader? loader = null, GeneratorDriverCache? driverCache = null, MetadataReference[]? additionalReferences = null)
CommandLineTests.cs (109)
147
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/errorlog:errorlog", $"/doc:{docName}", "/warnaserror", src.Path });
167
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/t:library", "/preferreduilang:en", $"/doc:{docName}", src.Path });
196
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
238
var
cmd = CreateCSharpCompiler(
289
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
341
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
377
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
401
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", src.Path });
421
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/codepage:932", src.Path });
455
var
cmd = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { "b.cs" });
584
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/nosdkpath", "/r:System.dll", "a.cs" });
1876
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/langversion:?" });
2250
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/debug:embedded", "/sourcelink:sl.json", "a.cs" });
2282
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/debug:portable", "/sourcelink:sl.json", "a.cs" });
2311
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/debug:full", "/sourcelink:sl.json", "a.cs" });
2454
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", debugSwitch, embedSwitch, "embed.cs", "embed2.cs" });
2785
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/a:missing.dll", "a.cs" });
2808
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + typeof(object).Assembly.Location, "a.cs" });
2925
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs" });
2961
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs", "/ruleset:" + ruleSetFile.Path });
2994
var
csc = CreateCSharpCompiler(null, dir.Path,
3513
var
csc = CreateCSharpCompiler(null, dir.Path,
3582
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "a.cs" });
4491
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/modulename:hocusPocus ", "/out:" + exeName + " ", file1.Path });
6342
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", binaryPath });
6435
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
6534
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
6576
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
6617
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
6952
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/target:exe", "a.cs" });
6974
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/target:exe", "a.cs" });
6998
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/target:library", "a.cs" });
7021
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/preferreduilang:en", "a.cs" });
7066
var
csc = CreateCSharpCompiler(null, dir.Path, commandLineArguments.Concat(new[] { inputName1, inputName2 }).ToArray());
7110
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/r:missing.dll", "a.cs" });
7186
var
csc = CreateCSharpCompiler(null, dir.Path, commandLineArguments.Concat(new[] { fileName }).ToArray());
7209
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\a.exe" });
7235
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\" });
7263
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\ " });
7291
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:aaa:\\a.exe" });
7317
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out: " });
7351
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keyfile:key.snk", });
7373
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keycontainer:bbb", });
7395
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keyFile:key.snk", "/features:UseLegacyStrongNameProvider" });
7415
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "a.cs", "/features:disable-length-based-switch" });
7788
MockCSharpCompiler
csc;
7855
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
7902
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
7936
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
7970
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
8390
var
csc = CreateCSharpCompiler(null, baseDir, new[] { source, "/preferreduilang:en" });
8449
MockCSharpCompiler
csc = new MockCSharpCompiler(
8500
MockCSharpCompiler
csc = CreateCSharpCompiler(GetDefaultResponseFilePath(), WorkingDirectory, new[] { "/noconfig" });
8977
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", $"/out:{exePath}", srcPath });
9000
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", "/debug", $"/out:{exePath}", srcPath });
9022
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", $"/doc:{xmlPath}", srcPath });
9046
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", "/debug:" + format, $"/sourcelink:{sourceLinkPath}", srcPath });
9074
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", $"/out:{exePath}", sourcePath });
9100
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/debug-", $"/out:{exePath}", sourcePath });
9125
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", "/doc:" + xmlPath, sourcePath });
9228
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/target:library", "/out:Test.dll", "/doc:" + xmlPath, sourcePath });
9399
var
comp = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/errorendlocation" });
9426
var
csc = CreateCSharpCompiler(
9484
var
csc = CreateCSharpCompiler(
9520
var
csc = CreateCSharpCompiler(
9552
var
csc = CreateCSharpCompiler(
9577
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", srcFile.Path },
9602
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", $"/warnaserror:{AnalyzerExecutor.AnalyzerExceptionDiagnosticId}", srcFile.Path },
9624
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", srcFile.Path },
9646
var
comp = CreateCSharpCompiler(null, WorkingDirectory, new string[] { });
9729
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/target:library", filePath });
9822
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/r:com2.dll", "/target:library", "/preferreduilang:en", filePath });
10023
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, args);
10065
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, args);
10573
var
csc = CreateCSharpCompiler(null, sourceDir.Path, args, analyzers: analyzers, generators: generators, driverCache: driverCache);
11193
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
11205
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:\"\"", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
11217
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:", "/publicsign", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
11229
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:\"\"", "/publicsign", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
11611
var
csc = CreateCSharpCompiler(null, dir.Path, args);
11789
var
csc = CreateCSharpCompiler(null, dir.Path,
11854
var
csc = CreateCSharpCompiler(null, dir.Path,
11905
var
csc = CreateCSharpCompiler(null, dir.Path,
12283
var
csc = CreateCSharpCompiler(null, dir.Path, args);
12306
var
csc = new MockCSharpCompiler(null, buildPaths, args: new[] { "/features:UseLegacyStrongNameProvider", "/nostdlib", "a.cs" });
12321
var
csc = new MockCSharpCompiler(null, buildPaths, args: new[] { features, "a.cs" });
12341
var
csc = new MockCSharpCompiler(null, buildPaths, args: new[] { @"/features:InterceptorsNamespaces=NS1.NS2", @"/features:InterceptorsNamespaces=NS3.NS4", "a.cs" });
12362
var
csc = new MockCSharpCompiler(null, buildPaths, args: new[] { @"/features:InterceptorsPreviewNamespaces=NS1.NS2", "a.cs" });
12487
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, new[]
12507
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, new[]
13412
var
cmd = CreateCSharpCompiler(null, dir.Path, arguments,
13657
var
cmd = CreateCSharpCompiler(null, dir.Path, arguments,
13748
var
cmd = CreateCSharpCompiler(null, dir.Path, args, analyzers: new[] { analyzer });
13785
var
cmd = CreateCSharpCompiler(null, dir.Path, args, analyzers: new[] { analyzer });
14711
var
cmd = CreateCSharpCompiler(null, dir.Path, args, generators: new[] { generator });
14771
var
cmd = CreateCSharpCompiler(null, dir.Path,
14791
var
cmd = CreateCSharpCompiler(null, dir.Path,
14816
var
cmd = CreateCSharpCompiler(null, dir.Path,
14836
var
cmd = CreateCSharpCompiler(null, dir.Path,
14914
var
csc = CreateCSharpCompiler(
14942
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15023
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15548
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15600
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15682
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15735
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15813
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15852
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15892
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
SarifErrorLoggerTests.cs (15)
23
internal abstract string GetExpectedOutputForNoDiagnostics(
MockCSharpCompiler
cmd);
24
internal abstract string GetExpectedOutputForSimpleCompilerDiagnostics(
MockCSharpCompiler
cmd, string sourceFile);
25
internal abstract string GetExpectedOutputForSimpleCompilerDiagnosticsSuppressed(
MockCSharpCompiler
cmd, string sourceFile, params string[] suppressionKinds);
26
internal abstract string GetExpectedOutputForAnalyzerDiagnosticsWithAndWithoutLocation(
MockCSharpCompiler
cmd);
27
internal abstract string GetExpectedOutputForAnalyzerDiagnosticsWithSuppression(
MockCSharpCompiler
cmd, string justification, string suppressionType, params string[] suppressionKinds);
28
internal abstract string GetExpectedOutputForAnalyzerDiagnosticsWithWarnAsError(
MockCSharpCompiler
cmd);
47
var
cmd = CreateCSharpCompiler(arguments);
78
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, arguments);
112
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, arguments);
145
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, arguments,
181
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, arguments,
216
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, arguments,
251
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, arguments,
286
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, arguments,
319
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, arguments,
SarifV1ErrorLoggerTests.cs (6)
21
internal override string GetExpectedOutputForNoDiagnostics(
MockCSharpCompiler
cmd)
39
internal override string GetExpectedOutputForSimpleCompilerDiagnostics(
MockCSharpCompiler
cmd, string sourceFile)
114
internal override string GetExpectedOutputForSimpleCompilerDiagnosticsSuppressed(
MockCSharpCompiler
cmd, string sourceFile, params string[] suppressionKinds)
192
internal override string GetExpectedOutputForAnalyzerDiagnosticsWithAndWithoutLocation(
MockCSharpCompiler
cmd)
199
internal override string GetExpectedOutputForAnalyzerDiagnosticsWithSuppression(
MockCSharpCompiler
cmd, string justification, string suppressionType, params string[] suppressionKinds)
206
internal override string GetExpectedOutputForAnalyzerDiagnosticsWithWarnAsError(
MockCSharpCompiler
cmd)
SarifV2ErrorLoggerTests.cs (11)
28
internal override string GetExpectedOutputForNoDiagnostics(
MockCSharpCompiler
cmd)
60
internal override string GetExpectedOutputForSimpleCompilerDiagnostics(
MockCSharpCompiler
cmd, string sourceFile)
163
internal override string GetExpectedOutputForSimpleCompilerDiagnosticsSuppressed(
MockCSharpCompiler
cmd, string sourceFile, params string[] suppressionKinds)
273
internal override string GetExpectedOutputForAnalyzerDiagnosticsWithAndWithoutLocation(
MockCSharpCompiler
cmd)
307
internal override string GetExpectedOutputForAnalyzerDiagnosticsWithSuppression(
MockCSharpCompiler
cmd, string justification, string suppressionType, params string[] suppressionKinds)
341
internal override string GetExpectedOutputForAnalyzerDiagnosticsWithWarnAsError(
MockCSharpCompiler
cmd)
418
MockCSharpCompiler
compiler,
451
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, arguments,
533
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, arguments,
603
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, arguments,
683
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, arguments);
TouchedFileLoggingTests.cs (4)
42
var
cmd = CreateCSharpCompiler(new[] { "/nologo", hello,
83
var
cmd = CreateCSharpCompiler(
118
var
cmd = CreateCSharpCompiler(
156
var
cmd = CreateCSharpCompiler(new[]
Microsoft.CodeAnalysis.Rebuild.UnitTests (1)
CSharpDeterministicKeyBuilderTests.cs (1)
376
var
compiler = new MockCSharpCompiler(