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)
8451
MockCSharpCompiler csc = new
MockCSharpCompiler
(
12310
var csc = new
MockCSharpCompiler
(null, buildPaths, args: new[] { "/features:UseLegacyStrongNameProvider", "/nostdlib", "a.cs" });
12325
var csc = new
MockCSharpCompiler
(null, buildPaths, args: new[] { features, "a.cs" });
12345
var csc = new
MockCSharpCompiler
(null, buildPaths, args: new[] { @"/features:InterceptorsNamespaces=NS1.NS2", @"/features:InterceptorsNamespaces=NS3.NS4", "a.cs" });
12366
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" });
1865
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/langversion:?" });
2239
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/debug:embedded", "/sourcelink:sl.json", "a.cs" });
2271
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/debug:portable", "/sourcelink:sl.json", "a.cs" });
2300
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/debug:full", "/sourcelink:sl.json", "a.cs" });
2443
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", debugSwitch, embedSwitch, "embed.cs", "embed2.cs" });
2774
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/a:missing.dll", "a.cs" });
2797
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + typeof(object).Assembly.Location, "a.cs" });
2914
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs" });
2950
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs", "/ruleset:" + ruleSetFile.Path });
2983
var
csc = CreateCSharpCompiler(null, dir.Path,
3502
var
csc = CreateCSharpCompiler(null, dir.Path,
3571
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "a.cs" });
4480
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/modulename:hocusPocus ", "/out:" + exeName + " ", file1.Path });
6331
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", binaryPath });
6424
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
6523
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
6565
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
6606
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
6941
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/target:exe", "a.cs" });
6963
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/target:exe", "a.cs" });
6987
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/target:library", "a.cs" });
7010
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/preferreduilang:en", "a.cs" });
7068
var
csc = CreateCSharpCompiler(null, dir.Path, commandLineArguments.Concat(new[] { inputName1, inputName2 }).ToArray());
7112
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/r:missing.dll", "a.cs" });
7188
var
csc = CreateCSharpCompiler(null, dir.Path, commandLineArguments.Concat(new[] { fileName }).ToArray());
7211
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\a.exe" });
7237
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\" });
7265
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\ " });
7293
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:aaa:\\a.exe" });
7319
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out: " });
7353
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keyfile:key.snk", });
7375
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keycontainer:bbb", });
7397
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keyFile:key.snk", "/features:UseLegacyStrongNameProvider" });
7417
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "a.cs", "/features:disable-length-based-switch" });
7790
MockCSharpCompiler
csc;
7857
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
7904
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
7938
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
7972
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
8392
var
csc = CreateCSharpCompiler(null, baseDir, new[] { source, "/preferreduilang:en" });
8451
MockCSharpCompiler
csc = new MockCSharpCompiler(
8502
MockCSharpCompiler
csc = CreateCSharpCompiler(GetDefaultResponseFilePath(), WorkingDirectory, new[] { "/noconfig" });
8981
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", $"/out:{exePath}", srcPath });
9004
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", "/debug", $"/out:{exePath}", srcPath });
9026
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", $"/doc:{xmlPath}", srcPath });
9050
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", "/debug:" + format, $"/sourcelink:{sourceLinkPath}", srcPath });
9078
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", $"/out:{exePath}", sourcePath });
9104
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/debug-", $"/out:{exePath}", sourcePath });
9129
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", "/doc:" + xmlPath, sourcePath });
9232
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/target:library", "/out:Test.dll", "/doc:" + xmlPath, sourcePath });
9403
var
comp = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/errorendlocation" });
9430
var
csc = CreateCSharpCompiler(
9488
var
csc = CreateCSharpCompiler(
9524
var
csc = CreateCSharpCompiler(
9556
var
csc = CreateCSharpCompiler(
9581
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", srcFile.Path },
9606
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", $"/warnaserror:{AnalyzerExecutor.AnalyzerExceptionDiagnosticId}", srcFile.Path },
9628
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", srcFile.Path },
9650
var
comp = CreateCSharpCompiler(null, WorkingDirectory, new string[] { });
9733
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/target:library", filePath });
9826
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/r:com2.dll", "/target:library", "/preferreduilang:en", filePath });
10027
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, args);
10069
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, args);
10577
var
csc = CreateCSharpCompiler(null, sourceDir.Path, args, analyzers: analyzers, generators: generators, driverCache: driverCache);
11197
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
11209
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:\"\"", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
11221
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:", "/publicsign", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
11233
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:\"\"", "/publicsign", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
11615
var
csc = CreateCSharpCompiler(null, dir.Path, args);
11793
var
csc = CreateCSharpCompiler(null, dir.Path,
11858
var
csc = CreateCSharpCompiler(null, dir.Path,
11909
var
csc = CreateCSharpCompiler(null, dir.Path,
12287
var
csc = CreateCSharpCompiler(null, dir.Path, args);
12310
var
csc = new MockCSharpCompiler(null, buildPaths, args: new[] { "/features:UseLegacyStrongNameProvider", "/nostdlib", "a.cs" });
12325
var
csc = new MockCSharpCompiler(null, buildPaths, args: new[] { features, "a.cs" });
12345
var
csc = new MockCSharpCompiler(null, buildPaths, args: new[] { @"/features:InterceptorsNamespaces=NS1.NS2", @"/features:InterceptorsNamespaces=NS3.NS4", "a.cs" });
12366
var
csc = new MockCSharpCompiler(null, buildPaths, args: new[] { @"/features:InterceptorsPreviewNamespaces=NS1.NS2", "a.cs" });
12491
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, new[]
12511
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, new[]
13416
var
cmd = CreateCSharpCompiler(null, dir.Path, arguments,
13661
var
cmd = CreateCSharpCompiler(null, dir.Path, arguments,
13752
var
cmd = CreateCSharpCompiler(null, dir.Path, args, analyzers: new[] { analyzer });
13789
var
cmd = CreateCSharpCompiler(null, dir.Path, args, analyzers: new[] { analyzer });
14715
var
cmd = CreateCSharpCompiler(null, dir.Path, args, generators: new[] { generator });
14775
var
cmd = CreateCSharpCompiler(null, dir.Path,
14795
var
cmd = CreateCSharpCompiler(null, dir.Path,
14820
var
cmd = CreateCSharpCompiler(null, dir.Path,
14840
var
cmd = CreateCSharpCompiler(null, dir.Path,
14918
var
csc = CreateCSharpCompiler(
14946
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15027
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15552
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15604
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15686
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15739
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15817
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15856
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15896
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(