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)
8455
MockCSharpCompiler csc = new
MockCSharpCompiler
(
12313
var csc = new
MockCSharpCompiler
(null, buildPaths, args: new[] { "/features:UseLegacyStrongNameProvider", "/nostdlib", "a.cs" });
12329
var csc = new
MockCSharpCompiler
(null, buildPaths, args: new[] { features, "a.cs" });
12349
var csc = new
MockCSharpCompiler
(null, buildPaths, args: new[] { @"/features:InterceptorsNamespaces=NS1.NS2", @"/features:InterceptorsNamespaces=NS3.NS4", "a.cs" });
12370
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 });
6346
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", binaryPath });
6439
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
6538
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
6580
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
6621
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
6956
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/target:exe", "a.cs" });
6978
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/target:exe", "a.cs" });
7002
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/target:library", "a.cs" });
7025
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/preferreduilang:en", "a.cs" });
7070
var
csc = CreateCSharpCompiler(null, dir.Path, commandLineArguments.Concat(new[] { inputName1, inputName2 }).ToArray());
7114
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/r:missing.dll", "a.cs" });
7190
var
csc = CreateCSharpCompiler(null, dir.Path, commandLineArguments.Concat(new[] { fileName }).ToArray());
7213
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\a.exe" });
7239
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\" });
7267
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\ " });
7295
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:aaa:\\a.exe" });
7321
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out: " });
7355
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keyfile:key.snk", });
7377
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keycontainer:bbb", });
7400
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keyFile:key.snk", "/features:UseLegacyStrongNameProvider" });
7420
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "a.cs", "/features:disable-length-based-switch" });
7793
MockCSharpCompiler
csc;
7860
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
7907
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
7941
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
7975
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
8396
var
csc = CreateCSharpCompiler(null, baseDir, new[] { source, "/preferreduilang:en" });
8455
MockCSharpCompiler
csc = new MockCSharpCompiler(
8506
MockCSharpCompiler
csc = CreateCSharpCompiler(GetDefaultResponseFilePath(), WorkingDirectory, new[] { "/noconfig" });
8983
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", $"/out:{exePath}", srcPath });
9006
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", "/debug", $"/out:{exePath}", srcPath });
9028
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", $"/doc:{xmlPath}", srcPath });
9052
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", "/debug:" + format, $"/sourcelink:{sourceLinkPath}", srcPath });
9080
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", $"/out:{exePath}", sourcePath });
9106
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/debug-", $"/out:{exePath}", sourcePath });
9131
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", "/doc:" + xmlPath, sourcePath });
9234
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/target:library", "/out:Test.dll", "/doc:" + xmlPath, sourcePath });
9405
var
comp = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/errorendlocation" });
9432
var
csc = CreateCSharpCompiler(
9490
var
csc = CreateCSharpCompiler(
9526
var
csc = CreateCSharpCompiler(
9558
var
csc = CreateCSharpCompiler(
9583
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", srcFile.Path },
9608
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", $"/warnaserror:{AnalyzerExecutor.AnalyzerExceptionDiagnosticId}", srcFile.Path },
9630
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", srcFile.Path },
9652
var
comp = CreateCSharpCompiler(null, WorkingDirectory, new string[] { });
9735
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/target:library", filePath });
9828
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/r:com2.dll", "/target:library", "/preferreduilang:en", filePath });
10029
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, args);
10071
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, args);
10579
var
csc = CreateCSharpCompiler(null, sourceDir.Path, args, analyzers: analyzers, generators: generators, driverCache: driverCache);
11199
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
11211
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:\"\"", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
11223
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:", "/publicsign", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
11235
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:\"\"", "/publicsign", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
11617
var
csc = CreateCSharpCompiler(null, dir.Path, args);
11796
var
csc = CreateCSharpCompiler(null, dir.Path,
11861
var
csc = CreateCSharpCompiler(null, dir.Path,
11912
var
csc = CreateCSharpCompiler(null, dir.Path,
12290
var
csc = CreateCSharpCompiler(null, dir.Path, args);
12313
var
csc = new MockCSharpCompiler(null, buildPaths, args: new[] { "/features:UseLegacyStrongNameProvider", "/nostdlib", "a.cs" });
12329
var
csc = new MockCSharpCompiler(null, buildPaths, args: new[] { features, "a.cs" });
12349
var
csc = new MockCSharpCompiler(null, buildPaths, args: new[] { @"/features:InterceptorsNamespaces=NS1.NS2", @"/features:InterceptorsNamespaces=NS3.NS4", "a.cs" });
12370
var
csc = new MockCSharpCompiler(null, buildPaths, args: new[] { @"/features:InterceptorsPreviewNamespaces=NS1.NS2", "a.cs" });
12495
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, new[]
12515
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, new[]
13420
var
cmd = CreateCSharpCompiler(null, dir.Path, arguments,
13665
var
cmd = CreateCSharpCompiler(null, dir.Path, arguments,
13756
var
cmd = CreateCSharpCompiler(null, dir.Path, args, analyzers: new[] { analyzer });
13793
var
cmd = CreateCSharpCompiler(null, dir.Path, args, analyzers: new[] { analyzer });
14719
var
cmd = CreateCSharpCompiler(null, dir.Path, args, generators: new[] { generator });
14779
var
cmd = CreateCSharpCompiler(null, dir.Path,
14799
var
cmd = CreateCSharpCompiler(null, dir.Path,
14824
var
cmd = CreateCSharpCompiler(null, dir.Path,
14844
var
cmd = CreateCSharpCompiler(null, dir.Path,
14922
var
csc = CreateCSharpCompiler(
14950
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15031
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15556
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15608
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15690
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15743
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15821
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15860
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15900
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(