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)
8462
MockCSharpCompiler csc = new
MockCSharpCompiler
(
12321
var csc = new
MockCSharpCompiler
(null, buildPaths, args: new[] { "/features:UseLegacyStrongNameProvider", "/nostdlib", "a.cs" });
12336
var csc = new
MockCSharpCompiler
(null, buildPaths, args: new[] { features, "a.cs" });
12356
var csc = new
MockCSharpCompiler
(null, buildPaths, args: new[] { @"/features:InterceptorsNamespaces=NS1.NS2", @"/features:InterceptorsNamespaces=NS3.NS4", "a.cs" });
12377
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" });
7079
var
csc = CreateCSharpCompiler(null, dir.Path, commandLineArguments.Concat(new[] { inputName1, inputName2 }).ToArray());
7123
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/r:missing.dll", "a.cs" });
7199
var
csc = CreateCSharpCompiler(null, dir.Path, commandLineArguments.Concat(new[] { fileName }).ToArray());
7222
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\a.exe" });
7248
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\" });
7276
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\ " });
7304
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:aaa:\\a.exe" });
7330
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out: " });
7364
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keyfile:key.snk", });
7386
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keycontainer:bbb", });
7408
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keyFile:key.snk", "/features:UseLegacyStrongNameProvider" });
7428
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "a.cs", "/features:disable-length-based-switch" });
7801
MockCSharpCompiler
csc;
7868
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
7915
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
7949
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
7983
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
8403
var
csc = CreateCSharpCompiler(null, baseDir, new[] { source, "/preferreduilang:en" });
8462
MockCSharpCompiler
csc = new MockCSharpCompiler(
8513
MockCSharpCompiler
csc = CreateCSharpCompiler(GetDefaultResponseFilePath(), WorkingDirectory, new[] { "/noconfig" });
8992
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", $"/out:{exePath}", srcPath });
9015
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", "/debug", $"/out:{exePath}", srcPath });
9037
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", $"/doc:{xmlPath}", srcPath });
9061
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", "/debug:" + format, $"/sourcelink:{sourceLinkPath}", srcPath });
9089
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", $"/out:{exePath}", sourcePath });
9115
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/debug-", $"/out:{exePath}", sourcePath });
9140
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", "/doc:" + xmlPath, sourcePath });
9243
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/target:library", "/out:Test.dll", "/doc:" + xmlPath, sourcePath });
9414
var
comp = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/errorendlocation" });
9441
var
csc = CreateCSharpCompiler(
9499
var
csc = CreateCSharpCompiler(
9535
var
csc = CreateCSharpCompiler(
9567
var
csc = CreateCSharpCompiler(
9592
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", srcFile.Path },
9617
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", $"/warnaserror:{AnalyzerExecutor.AnalyzerExceptionDiagnosticId}", srcFile.Path },
9639
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", srcFile.Path },
9661
var
comp = CreateCSharpCompiler(null, WorkingDirectory, new string[] { });
9744
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/target:library", filePath });
9837
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/r:com2.dll", "/target:library", "/preferreduilang:en", filePath });
10038
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, args);
10080
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, args);
10588
var
csc = CreateCSharpCompiler(null, sourceDir.Path, args, analyzers: analyzers, generators: generators, driverCache: driverCache);
11208
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
11220
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:\"\"", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
11232
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:", "/publicsign", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
11244
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:\"\"", "/publicsign", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
11626
var
csc = CreateCSharpCompiler(null, dir.Path, args);
11804
var
csc = CreateCSharpCompiler(null, dir.Path,
11869
var
csc = CreateCSharpCompiler(null, dir.Path,
11920
var
csc = CreateCSharpCompiler(null, dir.Path,
12298
var
csc = CreateCSharpCompiler(null, dir.Path, args);
12321
var
csc = new MockCSharpCompiler(null, buildPaths, args: new[] { "/features:UseLegacyStrongNameProvider", "/nostdlib", "a.cs" });
12336
var
csc = new MockCSharpCompiler(null, buildPaths, args: new[] { features, "a.cs" });
12356
var
csc = new MockCSharpCompiler(null, buildPaths, args: new[] { @"/features:InterceptorsNamespaces=NS1.NS2", @"/features:InterceptorsNamespaces=NS3.NS4", "a.cs" });
12377
var
csc = new MockCSharpCompiler(null, buildPaths, args: new[] { @"/features:InterceptorsPreviewNamespaces=NS1.NS2", "a.cs" });
12502
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, new[]
12522
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, new[]
13427
var
cmd = CreateCSharpCompiler(null, dir.Path, arguments,
13672
var
cmd = CreateCSharpCompiler(null, dir.Path, arguments,
13763
var
cmd = CreateCSharpCompiler(null, dir.Path, args, analyzers: new[] { analyzer });
13800
var
cmd = CreateCSharpCompiler(null, dir.Path, args, analyzers: new[] { analyzer });
14726
var
cmd = CreateCSharpCompiler(null, dir.Path, args, generators: new[] { generator });
14786
var
cmd = CreateCSharpCompiler(null, dir.Path,
14806
var
cmd = CreateCSharpCompiler(null, dir.Path,
14831
var
cmd = CreateCSharpCompiler(null, dir.Path,
14851
var
cmd = CreateCSharpCompiler(null, dir.Path,
14929
var
csc = CreateCSharpCompiler(
14957
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15038
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15563
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15615
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15697
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15750
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15828
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15867
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15907
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(