4 instantiations of MockCSharpCompiler
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (3)
CommandLineTestBase.cs (1)
64
return new
MockCSharpCompiler
(responseFile, buildPaths, args, analyzers.AsImmutableOrEmpty(), generators.AsImmutableOrEmpty(), loader, driverCache);
CommandLineTests.cs (2)
8241
MockCSharpCompiler csc = new
MockCSharpCompiler
(
12053
var csc = new
MockCSharpCompiler
(null, buildPaths, args: new[] { "/features:UseLegacyStrongNameProvider", "/nostdlib", "a.cs" });
Microsoft.CodeAnalysis.Rebuild.UnitTests (1)
CSharpDeterministicKeyBuilderTests.cs (1)
382
var compiler = new
MockCSharpCompiler
(
122 references to MockCSharpCompiler
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (121)
CommandLineTestBase.cs (2)
56
internal
MockCSharpCompiler
CreateCSharpCompiler(string[] args, DiagnosticAnalyzer[]? analyzers = null, ISourceGenerator[]? generators = null, AnalyzerAssemblyLoader? loader = null, GeneratorDriverCache? driverCache = null)
61
internal
MockCSharpCompiler
CreateCSharpCompiler(string? responseFile, string workingDirectory, string[] args, DiagnosticAnalyzer[]? analyzers = null, ISourceGenerator[]? generators = null, AnalyzerAssemblyLoader? loader = null, GeneratorDriverCache? driverCache = null)
CommandLineTests.cs (98)
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[] {
232
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
284
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
320
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
344
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", src.Path });
364
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/codepage:932", src.Path });
398
var
cmd = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { "b.cs" });
527
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/nosdkpath", "/r:System.dll", "a.cs" });
1812
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/langversion:?" });
2186
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/debug:embedded", "/sourcelink:sl.json", "a.cs" });
2218
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/debug:portable", "/sourcelink:sl.json", "a.cs" });
2247
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/debug:full", "/sourcelink:sl.json", "a.cs" });
2390
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", debugSwitch, embedSwitch, "embed.cs", "embed2.cs" });
2668
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/a:missing.dll", "a.cs" });
2691
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + typeof(object).Assembly.Location, "a.cs" });
2808
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs" });
2844
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs", "/ruleset:" + ruleSetFile.Path });
2877
var
csc = CreateCSharpCompiler(null, dir.Path,
3396
var
csc = CreateCSharpCompiler(null, dir.Path,
3465
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "a.cs" });
4299
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/modulename:hocusPocus ", "/out:" + exeName + " ", file1.Path });
6121
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", binaryPath });
6214
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
6313
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
6355
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
6396
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
6731
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/target:exe", "a.cs" });
6753
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/target:exe", "a.cs" });
6777
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/target:library", "a.cs" });
6800
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/preferreduilang:en", "a.cs" });
6858
var
csc = CreateCSharpCompiler(null, dir.Path, commandLineArguments.Concat(new[] { inputName1, inputName2 }).ToArray());
6902
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/r:missing.dll", "a.cs" });
6978
var
csc = CreateCSharpCompiler(null, dir.Path, commandLineArguments.Concat(new[] { fileName }).ToArray());
7001
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\a.exe" });
7027
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\" });
7055
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\ " });
7083
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:aaa:\\a.exe" });
7109
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out: " });
7143
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keyfile:key.snk", });
7165
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keycontainer:bbb", });
7187
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keyFile:key.snk", "/features:UseLegacyStrongNameProvider" });
7207
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "a.cs", "/features:disable-length-based-switch" });
7580
MockCSharpCompiler
csc;
7647
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
7694
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
7728
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
7762
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
8182
var
csc = CreateCSharpCompiler(null, baseDir, new[] { source, "/preferreduilang:en" });
8241
MockCSharpCompiler
csc = new MockCSharpCompiler(
8292
MockCSharpCompiler
csc = CreateCSharpCompiler(GetDefaultResponseFilePath(), WorkingDirectory, new[] { "/noconfig" });
8771
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", $"/out:{exePath}", srcPath });
8794
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", "/debug", $"/out:{exePath}", srcPath });
8816
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", $"/doc:{xmlPath}", srcPath });
8840
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", "/debug:" + format, $"/sourcelink:{sourceLinkPath}", srcPath });
8868
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", $"/out:{exePath}", sourcePath });
8894
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/debug-", $"/out:{exePath}", sourcePath });
8919
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", "/doc:" + xmlPath, sourcePath });
9022
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/target:library", "/out:Test.dll", "/doc:" + xmlPath, sourcePath });
9193
var
comp = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/errorendlocation" });
9220
var
csc = CreateCSharpCompiler(
9277
var
csc = CreateCSharpCompiler(
9313
var
csc = CreateCSharpCompiler(
9345
var
csc = CreateCSharpCompiler(
9370
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", srcFile.Path },
9395
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", $"/warnaserror:{AnalyzerExecutor.AnalyzerExceptionDiagnosticId}", srcFile.Path },
9417
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", srcFile.Path },
9439
var
comp = CreateCSharpCompiler(null, WorkingDirectory, new string[] { });
9522
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/target:library", filePath });
9615
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/r:com2.dll", "/target:library", "/preferreduilang:en", filePath });
9816
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, args);
9858
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, args);
10321
var
csc = CreateCSharpCompiler(null, sourceDir.Path, args, analyzers: analyzers, generators: generators, driverCache: driverCache);
10941
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
10953
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:\"\"", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
10965
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:", "/publicsign", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
10977
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:\"\"", "/publicsign", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
11359
var
csc = CreateCSharpCompiler(null, dir.Path, args);
11537
var
csc = CreateCSharpCompiler(null, dir.Path,
11602
var
csc = CreateCSharpCompiler(null, dir.Path,
11653
var
csc = CreateCSharpCompiler(null, dir.Path,
12030
var
csc = CreateCSharpCompiler(null, dir.Path, args);
12053
var
csc = new MockCSharpCompiler(null, buildPaths, args: new[] { "/features:UseLegacyStrongNameProvider", "/nostdlib", "a.cs" });
12172
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, new[]
12192
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, new[]
12781
var
cmd = CreateCSharpCompiler(null, dir.Path, arguments,
13022
var
cmd = CreateCSharpCompiler(null, dir.Path, arguments,
13112
var
cmd = CreateCSharpCompiler(null, dir.Path, args, analyzers: new[] { analyzer });
13148
var
cmd = CreateCSharpCompiler(null, dir.Path, args, analyzers: new[] { analyzer });
13819
var
cmd = CreateCSharpCompiler(null, dir.Path, args, generators: new[] { generator });
13879
var
cmd = CreateCSharpCompiler(null, dir.Path,
13899
var
cmd = CreateCSharpCompiler(null, dir.Path,
13924
var
cmd = CreateCSharpCompiler(null, dir.Path,
13944
var
cmd = CreateCSharpCompiler(null, dir.Path,
14022
var
csc = CreateCSharpCompiler(
14050
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
14131
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
SarifErrorLoggerTests.cs (10)
26
internal abstract string GetExpectedOutputForAnalyzerDiagnosticsWithAndWithoutLocation(
MockCSharpCompiler
cmd);
27
internal abstract string GetExpectedOutputForAnalyzerDiagnosticsWithSuppression(
MockCSharpCompiler
cmd, string justification, string suppressionType, params string[] suppressionKinds);
46
var
cmd = CreateCSharpCompiler(arguments);
77
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, arguments);
111
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, arguments);
144
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, arguments,
180
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, arguments,
215
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, arguments,
250
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, arguments,
285
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, arguments,
SarifV1ErrorLoggerTests.cs (2)
192
internal override string GetExpectedOutputForAnalyzerDiagnosticsWithAndWithoutLocation(
MockCSharpCompiler
cmd)
199
internal override string GetExpectedOutputForAnalyzerDiagnosticsWithSuppression(
MockCSharpCompiler
cmd, string justification, string suppressionType, params string[] suppressionKinds)
SarifV2ErrorLoggerTests.cs (5)
268
internal override string GetExpectedOutputForAnalyzerDiagnosticsWithAndWithoutLocation(
MockCSharpCompiler
cmd)
298
internal override string GetExpectedOutputForAnalyzerDiagnosticsWithSuppression(
MockCSharpCompiler
cmd, string justification, string suppressionType, params string[] suppressionKinds)
387
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, arguments,
461
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, arguments,
523
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, arguments,
TouchedFileLoggingTests.cs (4)
43
var
cmd = CreateCSharpCompiler(new[] { "/nologo", hello,
84
var
cmd = CreateCSharpCompiler(
119
var
cmd = CreateCSharpCompiler(
157
var
cmd = CreateCSharpCompiler(new[]
Microsoft.CodeAnalysis.Rebuild.UnitTests (1)
CSharpDeterministicKeyBuilderTests.cs (1)
382
var
compiler = new MockCSharpCompiler(