476 references to Path
InteractiveHost.UnitTests (4)
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (16)
TestUtilities\DotNetSdkTestBase.cs (6)
196Assert.True(File.Exists(Path.Combine(ObjDir.Path, "project.assets.json")));
197Assert.True(File.Exists(Path.Combine(ObjDir.Path, ProjectFileName + ".nuget.g.props")));
198Assert.True(File.Exists(Path.Combine(ObjDir.Path, ProjectFileName + ".nuget.g.targets")));
221var evaluationResultsFile = Path.Combine(OutDir.Path, "EvaluationResult.txt");
223EmitTestHelperProps(ObjDir.Path, ProjectFileName, customProps, uploadUtil);
224EmitTestHelperTargets(ObjDir.Path, evaluationResultsFile, ProjectFileName, expressions, customTargets, uploadUtil);
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (113)
CommandLineTests.cs (84)
146var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/errorlog:errorlog", $"/doc:{docName}", "/warnaserror", src.Path });
153string exePath = Path.Combine(dir.Path, "temp.exe");
166var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/t:library", "/preferreduilang:en", $"/doc:{docName}", src.Path });
173var xmlPath = Path.Combine(dir.Path, docName);
195var cmd = CreateCSharpCompiler(null, dir.Path, new[] {
288var cmd = CreateCSharpCompiler(null, dir.Path, new[] {
340var cmd = CreateCSharpCompiler(null, dir.Path, new[] {
376var cmd = CreateCSharpCompiler(null, dir.Path, new[] {
389$"error CS8700: Multiple analyzer config files cannot be in the same directory ('{dir.Path}').",
400var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", src.Path });
409var result = ProcessUtilities.Run(Path.Combine(dir.Path, "sjis.exe"), arguments: "", workingDirectory: dir.Path);
411Assert.Equal("星野 八郎太", File.ReadAllText(Path.Combine(dir.Path, "output.txt"), Encoding.GetEncoding(932)));
420var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/codepage:932", src.Path });
429var result = ProcessUtilities.Run(Path.Combine(dir.Path, "sjis.exe"), arguments: "", workingDirectory: dir.Path);
431Assert.Equal("星野 八郎太", File.ReadAllText(Path.Combine(dir.Path, "output.txt"), Encoding.GetEncoding(932)));
477string basePath = baseDir.Path;
490{ Path.Combine(dirSubDir.Path, @"b.rsp"), @"
565var parser = CSharpCommandLineParser.Default.Parse(new[] { "file.cs", $"-out:{parentDir.Path}", "/noSdkPath" }, parentDir.Path, null);
583var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/nosdkpath", "/r:System.dll", "a.cs" });
622args = DefaultParse(new[] { "/main:Test", "a.cs" }, folder.Path);
626args = DefaultParse(new[] { "/main:\"Test\"", "a.cs" }, folder.Path);
630args = DefaultParse(new[] { "/main:\"Test.Class1\"", "a.cs" }, folder.Path);
634args = DefaultParse(new[] { "/m:Test", "a.cs" }, folder.Path);
638args = DefaultParse(new[] { "/m:\"Test\"", "a.cs" }, folder.Path);
642args = DefaultParse(new[] { "/m:\"Test.Class1\"", "a.cs" }, folder.Path);
647args = DefaultParse(new[] { "/m:\"решения.Class1\"", "a.cs" }, folder.Path);
659args = DefaultParse(new[] { "-debug+/debug:portable" }, folder.Path);
691int exitCode = CreateCSharpCompiler(null, folder.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", @"/recurse:.", "/out:abc.dll" }).Run(outWriter);
696exitCode = CreateCSharpCompiler(null, folder.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", @"/recurse:. ", "/out:abc.dll" }).Run(outWriter);
701exitCode = CreateCSharpCompiler(null, folder.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", @"/recurse: . ", "/out:abc.dll" }).Run(outWriter);
706exitCode = CreateCSharpCompiler(null, folder.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", @"/recurse:././.", "/out:abc.dll" }).Run(outWriter);
713args = DefaultParse(new[] { @"/recurse:*.cp*", @"/recurse:a\*.c*", @"/out:a.dll" }, folder.Path);
716AssertEx.Equal(new[] { folder.Path + @"\c.cpp", folder.Path + @"\B\B_c.cpx", folder.Path + @"\a\A_a.cs", folder.Path + @"\a\A_b.cs", }, resolvedSourceFiles);
718args = DefaultParse(new[] { @"/recurse:.\\\\\\*.cs", @"/out:a.dll" }, folder.Path);
723args = DefaultParse(new[] { @"/recurse:.////*.cs", @"/out:a.dll" }, folder.Path);
1876var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/langversion:?" });
2250var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/debug:embedded", "/sourcelink:sl.json", "a.cs" });
2254var peStream = File.OpenRead(Path.Combine(dir.Path, "a.exe"));
2282var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/debug:portable", "/sourcelink:sl.json", "a.cs" });
2286var pdbStream = File.OpenRead(Path.Combine(dir.Path, "a.pdb"));
2311var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/debug:full", "/sourcelink:sl.json", "a.cs" });
2315var pdbStream = File.OpenRead(Path.Combine(dir.Path, "a.pdb"));
2454var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", debugSwitch, embedSwitch, "embed.cs", "embed2.cs" });
2478using (var peReader = new PEReader(File.OpenRead(Path.Combine(dir.Path, "embed.exe"))))
2485MetadataReaderProvider.FromPortablePdbStream(File.OpenRead(Path.Combine(dir.Path, "embed.pdb"))))
2513symReader = SymReaderFactory.CreateReader(File.OpenRead(Path.Combine(dir.Path, "embed.pdb")));
9293TestCS2002(commandLineArgs, tempDir.Path, 0, aWrnString);
9299TestCS2002(commandLineArgs, tempDir.Path, 0, warnings);
9305TestCS2002(commandLineArgs, tempDir.Path, 0, AWrnString);
9311TestCS2002(commandLineArgs, tempDir.Path, 0, String.Empty);
9317TestCS2002(commandLineArgs, tempParentDir.Path, 0, tmpDiraString);
9322TestCS2002(commandLineArgs, tempParentDir.Path, 0, tmpDiraString);
9327TestCS2002(commandLineArgs, tempParentDir.Path, 0, tmpDiraString);
9332TestCS2002(commandLineArgs, tempParentDir.Path, 0, tmpDiraString);
9336TestCS2002(commandLineArgs, tempParentDir.Path, 0, tmpDiraString);
9342var formattedcs1504Str = String.Format(cs1504, PathUtilities.CombineAbsoluteAndRelativePaths(tempParentDir.Path, "tmpDir\a.cs"), "Illegal characters in path.");
9343TestCS2002(commandLineArgs, tempParentDir.Path, 1, formattedcs1504Str);
9351TestCS2002(commandLineArgs, tempParentDir.Path, 1, (string[])null, parseDiags);
9358TestCS2002(commandLineArgs, tempParentDir.Path, 1, (string[])null, parseDiags);
9362var formattedcs1504 = String.Format(cs1504, PathUtilities.CombineAbsoluteAndRelativePaths(tempParentDir.Path, @":a.cs"), @"The given path's format is not supported.");
9363TestCS2002(commandLineArgs, tempParentDir.Path, 1, formattedcs1504);
9366System.IO.Directory.Delete(tempParentDir.Path, true);
10588var csc = CreateCSharpCompiler(null, sourceDir.Path, args, analyzers: analyzers, generators: generators, driverCache: driverCache);
11626var csc = CreateCSharpCompiler(null, dir.Path, args);
11630var exePath = Path.Combine(dir.Path, "a.exe");
11642var pdbPath = Path.Combine(dir.Path, "a.pdb");
11649var pdbPath = Path.Combine(dir.Path, "a.pdb");
11650AssertPdbEmit(dir, pdbPath, @"q:\a.pdb", $@"/pathmap:{dir.Path}=q:\");
11656var pdbPath = Path.Combine(dir.Path, "a.pdb");
11657AssertPdbEmit(dir, pdbPath, @"q:\a.pdb", $@"/pathmap:{dir.Path}=q:\", "/deterministic");
11664var pdbPath = Path.Combine(dir.Path, @"pdb\a.pdb");
11665AssertPdbEmit(dir, pdbPath, @"q:\pdb\a.pdb", $@"/pathmap:{dir.Path}=q:\");
11671var pdbPath = Path.Combine(dir.Path, "a.pdb");
11678var pdbPath = Path.Combine(dir.Path, "a.pdb");
11679AssertPdbEmit(dir, pdbPath, @"/a.pdb", $@"/pathmap:{dir.Path}=/");
11685var pdbPath = Path.Combine(dir.Path, "a.pdb");
11686AssertPdbEmit(dir, pdbPath, "/goo/a.pdb", $"/pathmap:{dir.Path}=/goo,{dir.Path}{PathUtilities.DirectorySeparatorChar}=/bar");
SarifErrorLoggerTests.cs (10)
43var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt");
74var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt");
108var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt");
140var errorLogFile = Path.Combine(outputDir.Path, "ErrorLog.txt");
141var outputFilePath = Path.Combine(outputDir.Path, "test.dll");
177var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt");
212var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt");
247var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt");
282var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt");
315var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt");
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (15)
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (8)
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (15)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Microsoft.CodeAnalysis.Features.UnitTests (2)
Microsoft.CodeAnalysis.LanguageServer.UnitTests (3)
Microsoft.CodeAnalysis.Rebuild.UnitTests (1)
Microsoft.CodeAnalysis.Scripting.UnitTests (4)
Microsoft.CodeAnalysis.Test.Utilities (4)
Microsoft.CodeAnalysis.UnitTests (8)
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (212)
CommandLineTests.vb (199)
77Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, {
114Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, {
172Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, {
209Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, {
222$"vbc : error BC37317: Multiple analyzer config files cannot be in the same directory ('{dir.Path}').",
239Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/errorlog:errorlog", $"/doc:{docName}", "/warnaserror", src.Path})
246Dim exePath = Path.Combine(dir.Path, "temp.exe")
258Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/t:library", "/preferreduilang:en", $"/doc:{docName}", src.Path})
265Dim xmlPath = Path.Combine(dir.Path, docName)
314args = DefaultParse({"-debug+/debug:portable"}, folder.Path)
387Dim cmd = New MockVisualBasicCompiler(dir.Path, {"/nologo", "a.vb", "/keyfile:key.snk"})
406Dim cmd = New MockVisualBasicCompiler(dir.Path, {"/nologo", "a.vb", "/keycontainer:aaa"})
425Dim cmd = New MockVisualBasicCompiler(dir.Path, {"/nologo", "a.vb", "/features:UseLegacyStrongNameProvider"})
648Dim tempDir As String = Temp.CreateDirectory().Path
688Dim tempDir As String = Temp.CreateDirectory().Path
740Dim tempDir As String = Temp.CreateDirectory().Path
2420Dim exitCode As Integer = New MockVisualBasicCompiler(Nothing, folder.Path, {"/nologo", "/preferreduilang:en", "/t:library", "/recurse:.", "b.vb", "/out:abc.dll"}).Run(outWriter, Nothing)
2425exitCode = New MockVisualBasicCompiler(Nothing, folder.Path, {"/nologo", "/preferreduilang:en", "/t:library", "/recurse:. ", "b.vb", "/out:abc.dll"}).Run(outWriter, Nothing)
2430exitCode = New MockVisualBasicCompiler(Nothing, folder.Path, {"/nologo", "/preferreduilang:en", "/t:library", "/recurse: . ", "/out:abc.dll"}).Run(outWriter, Nothing)
2435exitCode = New MockVisualBasicCompiler(Nothing, folder.Path, {"/nologo", "/preferreduilang:en", "/t:library", "/recurse:./.", "/out:abc.dll"}).Run(outWriter, Nothing)
2442args = DefaultParse({"/recurse:*.cp*", "/recurse:b\*.v*", "/out:a.dll"}, folder.Path)
2445AssertEx.Equal({folder.Path + "\c.cpp", folder.Path + "\b\B_e.vb"}, resolvedSourceFiles)
2447args = DefaultParse({"/recurse:.\\\\\\*.vb", "/out:a.dll"}, folder.Path)
2452args = DefaultParse({"/recurse:.////*.vb", "/out:a.dll"}, folder.Path)
2470Dim exitCode = New MockVisualBasicCompiler(Nothing, folder.Path, {"/nologo", "/preferreduilang:en", "/t:exe", "/out:abc.exe"}).Run(outWriter, Nothing)
2603Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/preferreduilang:en", "/t:library", "/a:missing.dll", "a.vb"})
2620Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/preferreduilang:en", "/t:library", "/a:" + GetType(Object).Assembly.Location, "a.vb"})
2638Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.vb"})
2671Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.vb", "/ruleset:" + ruleSetFile.Path})
2701Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path,
2715vbc = New MockVisualBasicCompiler(Nothing, dir.Path,
2751Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path,
2766vbc = New MockVisualBasicCompiler(Nothing, dir.Path,
2805Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.vb", "/ruleset:" + ruleSetFile.Path})
3192Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/debug:embedded", "/sourcelink:sl.json", "a.vb"})
3196Dim peStream = File.OpenRead(Path.Combine(dir.Path, "a.exe"))
3225Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/debug:portable", "/sourcelink:sl.json", "a.vb"})
3229Dim pdbStream = File.OpenRead(Path.Combine(dir.Path, "a.pdb"))
3380Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", debugSwitch, embedSwitch, "embed.vb", "embed2.vb"})
3399Using peReader As New PEReader(File.OpenRead(Path.Combine(dir.Path, "embed.exe")))
3406MetadataReaderProvider.FromPortablePdbStream(File.OpenRead(Path.Combine(dir.Path, "embed.pdb"))))
3430symReader = SymReaderFactory.CreateReader(File.OpenRead(Path.Combine(dir.Path, "embed.pdb")))
3574Dim sdkPath = sdkDir.Path
3576Dim parser = VisualBasicCommandLineParser.Default.Parse({$"-sdkPath:{sdkPath}"}, parentDir.Path, Nothing)
3584Dim parser = VisualBasicCommandLineParser.Default.Parse({"file.vb", "-sdkPath", $"-out:{parentDir.Path}"}, parentDir.Path, Nothing)
3595Dim parser = VisualBasicCommandLineParser.Default.Parse({"file.vb", $"-out:{parentDir.Path}", "-sdkPath:path/to/sdk", "/noSdkPath"}, parentDir.Path, Nothing)
3604Dim parser = VisualBasicCommandLineParser.Default.Parse({"file.vb", $"-out:{parentDir.Path}", "/noSdkPath", $"-sdkPath:{sdkDir.Path}"}, parentDir.Path, Nothing)
3605AssertEx.Equal(ImmutableArray.Create(sdkDir.Path), parser.ReferencePaths)
3621Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/preferreduilang:en", "/nosdkpath", "/t:library", "a.vb"})
3646Dim pdbPath = Path.Combine(dir.Path, "a.pdb")
3652Dim vbc = New MockVisualBasicCompiler(dir.Path, args)
3656Dim exePath = Path.Combine(dir.Path, "a.exe")
3667Dim pePdbPath = Path.Combine(dir.Path, "a.pdb")
3674assertPdbEmit(dir, pePdbPath, {$"/pathmap:{dir.Path}=q:\"})
3680assertPdbEmit(dir, pePdbPath, {$"/pathmap:{dir.Path}=q:\", "/deterministic"})
3687assertPdbEmit(subDir, pePdbPath, {$"/pathmap:{dir.Path}=q:\"})
3692Dim pePdbPath = Path.Combine(dir.Path, "a.pdb")
3698Dim pdbPath = Path.Combine(dir.Path, "a.pdb")
3699assertPdbEmit(dir, "/a.pdb", {$"/pathmap:{dir.Path}=/"})
3704Dim pdbPath = Path.Combine(dir.Path, "a.pdb")
3705assertPdbEmit(dir, "/goo/a.pdb", {$"/pathmap:{dir.Path}=/goo,{dir.Path}{PathUtilities.DirectorySeparatorChar}=/bar"})
5224Dim output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:l:\x /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.Path)
5230output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /r:mscorlib.dll /vbruntime- /sdkpath:c:folder /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.Path)
5236output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:" & dir.Path & " /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.Path)
5240</text>, output.Replace(dir.Path, "{SDKPATH}"))
5246output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:" & dir.Path & " /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.Path)
5250</text>, output.Replace(dir.Path, "{SDKPATH}"))
5255output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:" & dir.Path & " /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.Path)
5259</text>, output.Replace(dir.Path, "{SDKPATH}"))
5266output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /nostdlib /sdkpath:" & dir.Path & " /t:library /vbruntime* /r:" & Path.Combine(RuntimeEnvironment.GetRuntimeDirectory(), "System.dll") & " " & src.ToString(), startFolder:=dir.Path)
5267AssertOutput(<text></text>, output.Replace(dir.Path, "{SDKPATH}")) ' SUCCESSFUL BUILD with 'mscorlib.dll' and embedded VbCore
5272output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /nostdlib /sdkpath:" & dir.Path & " /t:library /vbruntime* /r:" & Path.Combine(RuntimeEnvironment.GetRuntimeDirectory(), "System.dll") & " " & src.ToString(), startFolder:=dir.Path)
5273AssertOutput(<text></text>, output.Replace(dir.Path, "{SDKPATH}"))
5297Dim sdkMultiPath = subFolder1.Path & "," & subFolder2.Path
5304output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, cmdNoStdLibNoRuntime, startFolder:=dir.Path, expectedRetCode:=1)
5305AssertOutput(<text>vbc : error BC2017: could not find library 'mscorlib.dll'</text>, output.Replace(dir.Path, "{SDKPATH}"))
5312output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, cmdNoStdLibNoRuntime, startFolder:=dir.Path)
5313AssertOutput(<text></text>, output.Replace(dir.Path, "{SDKPATH}"))
5315output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, cmd, startFolder:=dir.Path, expectedRetCode:=1)
5320</text>, output.Replace(dir.Path, "{SDKPATH}"))
5337Dim output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /t:library " & src.ToString(), startFolder:=dir.Path, expectedRetCode:=1)
5340output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /nostdlib /define:_MYTYPE=\""Empty\"" /t:library " & src.ToString(), startFolder:=dir.Path)
5343output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:x:\ /vbruntime- /define:_MYTYPE=\""Empty\"" /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.Path)
5768Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, commandLineArguments.Concat({inputName1, inputName2}).ToArray())
5775Assert.Equal(1, Directory.EnumerateFiles(dir.Path, "*" & PathUtilities.GetExtension(expectedOutputName)).Count())
5776Assert.Equal(1, Directory.EnumerateFiles(dir.Path, expectedOutputName).Count())
5908Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, commandLineArguments.Concat({fileName}).ToArray())
5960Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en"})
6013Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en", "-imports:System"})
6050Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en"})
6100Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en"})
6144Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en"})
6192Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en"})
6238Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en"})
6280Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en"})
6315Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/target:exe", "/preferreduilang:en", "/out:sub\a.exe"})
6319Assert.Contains("error BC2012: can't open '" + dir.Path + "\sub\a.exe' for writing", output.ToString(), StringComparison.Ordinal)
6347Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en", "/target:exe", "/out:sub\"})
6381Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en", "/target:exe", "/out:sub\ "})
6415Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en", "/target:exe", "/out:aaa:\a.exe"})
6447Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en", "/target:exe", "/out: "})
6470Dim output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /t:library " & file.ToString(), startFolder:=dir.Path)
6473output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /t:library /codepage:20127 " & file.ToString(), expectedRetCode:=1, startFolder:=dir.Path) ' 20127: US-ASCII
6834vbc = New MockVisualBasicCompiler(Nothing, dir.Path,
6842vbc = New MockVisualBasicCompiler(Nothing, dir.Path,
6852Dim library As IntPtr = LoadLibraryEx(Path.Combine(dir.Path, outputFileName), IntPtr.Zero, 2)
7534Dim output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /t:library /langversion:9 /preferreduilang:en " & src.ToString(), expectedRetCode:=1, startFolder:=dir.Path)
7617Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/preferreduilang:en", "/t:library", "a.vb"})
7635" & Path.GetFullPath(Path.Combine(dir.Path, "..\b.vb")) & "(40) : error BC30451: 'Goo' is not declared. It may be inaccessible due to its protection level.
7638" & Path.GetFullPath(Path.Combine(dir.Path, "..\b.vb")) & "(50) : error BC30451: 'Goo' is not declared. It may be inaccessible due to its protection level.
7804args = DefaultParse({"/additionalfile:web*.config", "a.vb"}, baseDir.Path)
7807Assert.Equal(Path.Combine(baseDir.Path, "web1.config"), args.AdditionalFiles(0).Path)
7808Assert.Equal(Path.Combine(baseDir.Path, "web2.config"), args.AdditionalFiles(1).Path)
7809Assert.Equal(Path.Combine(baseDir.Path, "web3.config"), args.AdditionalFiles(2).Path)
7950Dim vbc = New MockVisualBasicCompiler(Nothing, sourceDir.Path, args, analyzers, generators)
8717Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "A.vb"}, dir.Path)
8737Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "A.vb"}, dir.Path)
8758Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "A.vb"}, dir.Path)
8779Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+:Test001", "A.vb"}, dir.Path)
8800Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "/WarnAsError-", "A.vb"}, dir.Path)
8821Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "/WarnAsError-:Test001", "A.vb"}, dir.Path)
8842Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+:Test002", "/WarnAsError-:Test002", "A.vb"}, dir.Path)
8864Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/NoWarn", "/WarnAsError+", "A.vb"}, dir.Path)
8885Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "/NoWarn", "/WarnAsError-", "A.vb"}, dir.Path)
8908Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/NoWarn", "A.vb"}, dir.Path)
8931Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/NoWarn:Test001", "/WarnAsError+", "/WarnAsError-:Test001", "A.vb"}, dir.Path)
9155Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/target:exe", fileName})
9360Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path,
9366Dim exe = Path.Combine(dir.Path, "a.exe")
9375Dim doc = Path.Combine(dir.Path, "doc.xml")
9398Dim output = ProcessUtilities.RunAndGetOutput(exe, startFolder:=dir.Path)
9401Dim refDll = Path.Combine(refDir.Path, "a.dll")
9413CleanupAllGeneratedFiles(dir.Path)
9414CleanupAllGeneratedFiles(refDir.Path)
9431Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path,
9437Dim vb = Path.Combine(dir.Path, "a.vb")
9439Dim dll = Path.Combine(dir.Path, "a.dll")
9442Dim refDll = Path.Combine(dir.Path, Path.Combine("ref", "a.dll"))
9453CleanupAllGeneratedFiles(dir.Path)
9478Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path,
9484Dim refDll = Path.Combine(dir.Path, "a.dll")
9495Dim pdb = Path.Combine(dir.Path, "a.pdb")
9498Dim doc = Path.Combine(dir.Path, "doc.xml")
9528CleanupAllGeneratedFiles(dir.Path)
9571Assert.Equal(0, New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, targetArg, outArg}).Run(output, Nothing))
9572Assert.True(File.Exists(Path.Combine(dir.Path, expectedFile)), "Expected to find: " & expectedFile)
9573Assert.False(File.Exists(Path.Combine(dir.Path, unexpectedFile)), "Didn't expect to find: " & unexpectedFile)
9580Dim srcPath = MakeTrivialExe(Temp.CreateDirectory().Path)
9599Dim srcPath = MakeTrivialExe(Temp.CreateDirectory().Path)
9619Dim srcPath = MakeTrivialExe(Temp.CreateDirectory().Path)
9640Dim srcPath = MakeTrivialExe(Temp.CreateDirectory().Path)
9685Dim result = ProcessUtilities.Run(vbcPath, arguments:="/nologo /t:library unknown.vb", workingDirectory:=dir.Path)
9693result = ProcessUtilities.Run(vbcPath, arguments:="/nologo /t:library unknown.vb", workingDirectory:=dir.Path)
9705Dim src = MakeTrivialExe(directory:=dir.Path)
9709Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, args)
9713Dim exePath = Path.Combine(dir.Path, "a.exe")
9730Dim vbc = New MockVisualBasicCompiler(Nothing, New BuildPaths("", workingDir.Path, Nothing, tempDir.Path),
10016Dim binaryPath As String = Path.Combine(dir.Path, "temp.dll")
10019Dim pdbPath As String = Path.Combine(dir.Path, "temp.pdb")
10022Dim docPath As String = Path.Combine(dir.Path, docName)
10068Dim binaryPath As String = Path.Combine(dir.Path, "temp.dll")
10071Dim pdbPath As String = Path.Combine(dir.Path, "temp.pdb")
10074Dim docPath As String = Path.Combine(dir.Path, docName)
10125Dim binaryPath As String = Path.Combine(dir.Path, "temp.dll")
10128Dim pdbPath As String = Path.Combine(dir.Path, "temp.pdb")
10131Dim docPath As String = Path.Combine(dir.Path, docName)
10162Dim binaryPath As String = Path.Combine(dir.Path, "temp.dll")
10189Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, args, analyzer)
10226Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, args, analyzer)
10434CleanupAllGeneratedFiles(srcDirectory.Path)
10573Dim generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(baseDirectory:=generatedDir.Path, generator)
10575{{generatedDir.Path, New Dictionary(Of String, String)()}}
10579Directory.Delete(dir.Path, True)
10589Dim generatedDirPath = Path.Combine(dir.Path, "noexist")
10601Directory.Delete(dir.Path, True)
10618VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference:=False, additionalFlags:={"/generatedfilesout:" + generatedDir.Path}, generators:={generator})
10620Dim generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(baseDirectory:=generatedDir.Path, generator)
10622{{Path.Combine(generatedDir.Path, generatorPrefix), New Dictionary(Of String, String)() From
10628Directory.Delete(dir.Path, True)
10644Directory.Delete(dir.Path, True)
10719Directory.Delete(dir.Path, True)
10754Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, {
10797Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, {
10842Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, {
10890Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, {
10923Dim generatorPath = Path.Combine(directory.Path, "generator.dll")
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (1)
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (6)
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (10)
PersistentStorage\AbstractPersistentStorageTests.cs (4)
875solution = solution.AddDocument(id, "file.cs", "class C { void M() }", filePath: Path.Combine(_persistentFolder.Path, "file.cs"));
895solution = solution.AddDocument(id, "file.cs", "class C { void M() }", filePath: Path.Combine(_persistentFolder.Path, "file.cs"));
1011var configuration = new MockPersistentStorageConfiguration(solution.Id, persistentFolder.Path, throwOnFailure);
1029var configuration = new MockPersistentStorageConfiguration(solutionKey.Id, _persistentFolder.Path, throwOnFailure: true);
VBCSCompiler.UnitTests (46)
AnalyzerConsistencyCheckerTests.cs (12)
87var assemblyLoader = DefaultAnalyzerAssemblyLoader.CreateNonLockingLoader(directory.CreateDirectory("shadow").Path);
90var result = AnalyzerConsistencyChecker.Check(directory.Path, analyzerReferences, assemblyLoader, Logger);
98var assemblyLoader = DefaultAnalyzerAssemblyLoader.CreateNonLockingLoader(directory.CreateDirectory("shadow").Path);
113var assemblyLoader = DefaultAnalyzerAssemblyLoader.CreateNonLockingLoader(directory.CreateDirectory("shadow").Path);
123var result = AnalyzerConsistencyChecker.Check(directory.Path, analyzerReferences, assemblyLoader, Logger);
138var assemblyLoader = DefaultAnalyzerAssemblyLoader.CreateNonLockingLoader(directory.CreateDirectory("shadow").Path);
144directory.Path,
154directory.Path,
187var result = AnalyzerConsistencyChecker.Check(directory.Path, analyzerReferences, assemblyLoader, Logger);
210var result = AnalyzerConsistencyChecker.Check(directory.Path, analyzerReferences, assemblyLoader, Logger);
228var result = AnalyzerConsistencyChecker.Check(directory.Path, analyzerReferences, new ThrowingLoader(), Logger);
242var result = AnalyzerConsistencyChecker.Check(directory.Path, analyzerReferences, new DefaultAnalyzerAssemblyLoader(), Logger);
CompilerServerTests.cs (21)
101var filePath = Path.Combine(currentDirectory.Path, "netstandard.dll");
201workingDir: currentDirectory.Path,
231finalFlags = $"{flags} /shared:{serverData.PipeName} /pathmap:{tempDir.Path}=/ /out:{outFile} {srcFile}";
257return new DisposableFile(Path.Combine(directory.Path, resultFileName));
290var newTempDir = _tempDirectory.CreateDirectory(new string('a', 100 - _tempDirectory.Path.Length));
292new[] { new KeyValuePair<string, string>("TMPDIR", newTempDir.Path) },
559Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "hello.exe")));
589Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "hello.exe")));
606Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "missingfile.exe")));
624Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "hello.exe")));
649Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "app.exe")));
667Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "missingfile.exe")));
696Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "hellovb.exe")));
725Assert.False(File.Exists(Path.Combine(_tempDirectory.Path, "app.exe")));
1063$"src1.cs /shared:{serverData.PipeName} /nologo /t:library /out:" + Path.Combine(libDirectory.Path, "lib.dll"),
1081additionalEnvironmentVars: new Dictionary<string, string>() { { "LIB", libDirectory.Path } });
1114$"src1.vb /shared:{serverData.PipeName} /vbruntime* /nologo /t:library /out:" + Path.Combine(libDirectory.Path, "lib.dll"),
1133additionalEnvironmentVars: new Dictionary<string, string>() { { "LIB", libDirectory.Path } });
1397var tmp = Path.Combine(_tempDirectory.Path, "Temp");
1431var tmp = Path.Combine(_tempDirectory.Path, "Temp");
1463var workingDirectory = dir.Path;