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)
8468
MockCSharpCompiler csc = new
MockCSharpCompiler
(
12388
var csc = new
MockCSharpCompiler
(null, buildPaths, args: new[] { "/features:UseLegacyStrongNameProvider", "/nostdlib", "a.cs" });
12404
var csc = new
MockCSharpCompiler
(null, buildPaths, args: new[] { features, "a.cs" });
12424
var csc = new
MockCSharpCompiler
(null, buildPaths, args: new[] { @"/features:InterceptorsNamespaces=NS1.NS2", @"/features:InterceptorsNamespaces=NS3.NS4", "a.cs" });
12445
var csc = new
MockCSharpCompiler
(null, buildPaths, args: new[] { @"/features:InterceptorsPreviewNamespaces=NS1.NS2", "a.cs" });
Microsoft.CodeAnalysis.Rebuild.UnitTests (1)
CSharpDeterministicKeyBuilderTests.cs (1)
385
var compiler = new
MockCSharpCompiler
(
157 references to MockCSharpCompiler
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (156)
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 (111)
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" });
1879
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/langversion:?" });
2253
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/debug:embedded", "/sourcelink:sl.json", "a.cs" });
2285
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/debug:portable", "/sourcelink:sl.json", "a.cs" });
2314
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/debug:full", "/sourcelink:sl.json", "a.cs" });
2457
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", debugSwitch, embedSwitch, "embed.cs", "embed2.cs" });
2788
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/a:missing.dll", "a.cs" });
2811
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + typeof(object).Assembly.Location, "a.cs" });
2928
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs" });
2964
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs", "/ruleset:" + ruleSetFile.Path });
2997
var
csc = CreateCSharpCompiler(null, dir.Path,
3516
var
csc = CreateCSharpCompiler(null, dir.Path,
3585
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "a.cs" });
4494
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/modulename:hocusPocus ", "/out:" + exeName + " ", file1.Path });
6359
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", binaryPath });
6452
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
6551
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
6593
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
6634
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
6969
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/target:exe", "a.cs" });
6991
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/target:exe", "a.cs" });
7015
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/target:library", "a.cs" });
7038
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/preferreduilang:en", "a.cs" });
7083
var
csc = CreateCSharpCompiler(null, dir.Path, commandLineArguments.Concat(new[] { inputName1, inputName2 }).ToArray());
7127
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/r:missing.dll", "a.cs" });
7203
var
csc = CreateCSharpCompiler(null, dir.Path, commandLineArguments.Concat(new[] { fileName }).ToArray());
7226
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\a.exe" });
7252
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\" });
7280
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\ " });
7308
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:aaa:\\a.exe" });
7334
var
csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out: " });
7368
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keyfile:key.snk", });
7390
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keycontainer:bbb", });
7413
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keyFile:key.snk", "/features:UseLegacyStrongNameProvider" });
7433
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] { "a.cs", "/features:disable-length-based-switch" });
7806
MockCSharpCompiler
csc;
7873
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
7920
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
7954
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
7988
var
csc = CreateCSharpCompiler(rsp, WorkingDirectory, new[] { source, "/preferreduilang:en" });
8409
var
csc = CreateCSharpCompiler(null, baseDir, new[] { source, "/preferreduilang:en" });
8468
MockCSharpCompiler
csc = new MockCSharpCompiler(
8519
MockCSharpCompiler
csc = CreateCSharpCompiler(GetDefaultResponseFilePath(), WorkingDirectory, new[] { "/noconfig" });
8997
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", $"/out:{exePath}", srcPath });
9020
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", "/debug", $"/out:{exePath}", srcPath });
9042
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", $"/doc:{xmlPath}", srcPath });
9066
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", "/debug:" + format, $"/sourcelink:{sourceLinkPath}", srcPath });
9094
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", $"/out:{exePath}", sourcePath });
9120
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/debug-", $"/out:{exePath}", sourcePath });
9145
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/preferreduilang:en", "/doc:" + xmlPath, sourcePath });
9248
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/target:library", "/out:Test.dll", "/doc:" + xmlPath, sourcePath });
9419
var
comp = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/errorendlocation" });
9446
var
csc = CreateCSharpCompiler(
9478
var
csc = CreateCSharpCompiler(
9505
var
csc = CreateCSharpCompiler(
9565
var
csc = CreateCSharpCompiler(
9601
var
csc = CreateCSharpCompiler(
9633
var
csc = CreateCSharpCompiler(
9658
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", srcFile.Path },
9683
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", $"/warnaserror:{AnalyzerExecutor.AnalyzerExceptionDiagnosticId}", srcFile.Path },
9705
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", srcFile.Path },
9727
var
comp = CreateCSharpCompiler(null, WorkingDirectory, new string[] { });
9810
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/nologo", "/target:library", filePath });
9903
var
cmd = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/r:com2.dll", "/target:library", "/preferreduilang:en", filePath });
10104
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, args);
10146
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, args);
10654
var
csc = CreateCSharpCompiler(null, sourceDir.Path, args, analyzers: analyzers, generators: generators, driverCache: driverCache);
11274
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
11286
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:\"\"", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
11298
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:", "/publicsign", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
11310
var
csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/keyfile:\"\"", "/publicsign", "/target:library", "/nologo", "/preferreduilang:en", "a.cs" });
11692
var
csc = CreateCSharpCompiler(null, dir.Path, args);
11871
var
csc = CreateCSharpCompiler(null, dir.Path,
11936
var
csc = CreateCSharpCompiler(null, dir.Path,
11987
var
csc = CreateCSharpCompiler(null, dir.Path,
12365
var
csc = CreateCSharpCompiler(null, dir.Path, args);
12388
var
csc = new MockCSharpCompiler(null, buildPaths, args: new[] { "/features:UseLegacyStrongNameProvider", "/nostdlib", "a.cs" });
12404
var
csc = new MockCSharpCompiler(null, buildPaths, args: new[] { features, "a.cs" });
12424
var
csc = new MockCSharpCompiler(null, buildPaths, args: new[] { @"/features:InterceptorsNamespaces=NS1.NS2", @"/features:InterceptorsNamespaces=NS3.NS4", "a.cs" });
12445
var
csc = new MockCSharpCompiler(null, buildPaths, args: new[] { @"/features:InterceptorsPreviewNamespaces=NS1.NS2", "a.cs" });
12570
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, new[]
12590
var
compiler = CreateCSharpCompiler(null, WorkingDirectory, new[]
13495
var
cmd = CreateCSharpCompiler(null, dir.Path, arguments,
13740
var
cmd = CreateCSharpCompiler(null, dir.Path, arguments,
13831
var
cmd = CreateCSharpCompiler(null, dir.Path, args, analyzers: new[] { analyzer });
13868
var
cmd = CreateCSharpCompiler(null, dir.Path, args, analyzers: new[] { analyzer });
14837
var
cmd = CreateCSharpCompiler(null, dir.Path, args, generators: new[] { generator });
14897
var
cmd = CreateCSharpCompiler(null, dir.Path,
14917
var
cmd = CreateCSharpCompiler(null, dir.Path,
14942
var
cmd = CreateCSharpCompiler(null, dir.Path,
14962
var
cmd = CreateCSharpCompiler(null, dir.Path,
15040
var
csc = CreateCSharpCompiler(
15068
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15149
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15674
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15726
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15808
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15861
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15939
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
15978
var
cmd = CreateCSharpCompiler(null, dir.Path, new[] {
16018
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)
385
var
compiler = new MockCSharpCompiler(