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