527 references to Path
InteractiveHost.UnitTests (4)
InteractiveHostCoreInitTests.cs (1)
76AssertEx.AssertEqualToleratingWhitespaceDifferences(PrintSearchPaths(srcDir.Path), output);
InteractiveHostDesktopInitTests.cs (1)
49AssertEx.AssertEqualToleratingWhitespaceDifferences(PrintSearchPaths(srcDir.Path), output);
InteractiveHostDesktopTests.cs (2)
705rspFile.WriteAllText($"/lib:{directory1.Path} /r:Assembly2.dll {initFile.Path}"); 719var expectedSearchPaths = PrintSearchPaths(fxDir, directory1.Path);
Microsoft.Build.Tasks.CodeAnalysis.Sdk.UnitTests (1)
src\Compilers\Core\MSBuildTaskTests\TestUtilities\IntegrationTestBase.cs (1)
87currentDirectory.Path,
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (19)
CopyRefAssemblyTests.cs (2)
35SourcePath = Path.Combine(dir.Path, "does_not_exist.dll") 66var dest = Path.Combine(dir.Path, "dest.dll");
DotNetSdkTests.cs (8)
28var root1 = Path.GetFullPath(ProjectDir.Path + Path.DirectorySeparatorChar); 29var root2 = Path.GetFullPath(sourcePackageDir.Path + Path.DirectorySeparatorChar); 38var sourceLinkJsonPath = Path.Combine(ObjDir.Path, ProjectName + ".sourcelink.json"); 432Path.Combine(ProjectDir.Path, ".editorconfig"), 493Path.Combine(ProjectDir.Path, ".editorconfig"), 528Path.Combine(ProjectDir.Path, ".editorconfig"), 573var dir = Directory.GetParent(ProjectDir.Path); 653Path.Combine(ProjectDir.Path, ".editorconfig"),
IntegrationTests.cs (2)
18return new DisposableFile(Path.Combine(directory.Path, resultFileName)); 695var result = RunCommandLineCompiler(_msbuildExecutable, "/p:UseSharedCompilation=false", testDir.Path);
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);
TestUtilities\IntegrationTestBase.cs (1)
87currentDirectory.Path,
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (345)
CommandLineIVTTests.cs (4)
44var outputFilePath = $"{Path.GetFileName(dir.Path)}{Path.DirectorySeparatorChar}{Path.GetFileName(source2.Path)}"; 121var outputFilePath = $"{Path.GetFileName(dir.Path)}{Path.DirectorySeparatorChar}{Path.GetFileName(source2.Path)}"; 200var outputFilePath = $"{Path.GetFileName(dir.Path)}{Path.DirectorySeparatorChar}{Path.GetFileName(source2.Path)}"; 285var outputFilePath = $"{Path.GetFileName(dir.Path)}{Path.DirectorySeparatorChar}{Path.GetFileName(source2.Path)}";
CommandLineTestBase.cs (2)
41File.WriteAllBytes(Path.Combine(dir.Path, "mscorlib.dll"), Net461.ReferenceInfos.mscorlib.ImageBytes); 42return dir.Path;
CommandLineTests.cs (316)
147var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/errorlog:errorlog", $"/doc:{docName}", "/warnaserror", src.Path }); 154string exePath = Path.Combine(dir.Path, "temp.exe"); 167var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/t:library", "/preferreduilang:en", $"/doc:{docName}", src.Path }); 174var xmlPath = Path.Combine(dir.Path, docName); 196var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 289var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 341var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 377var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 390$"error CS8700: Multiple analyzer config files cannot be in the same directory ('{dir.Path}').", 401var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", src.Path }); 410var result = ProcessUtilities.Run(Path.Combine(dir.Path, "sjis.exe"), arguments: "", workingDirectory: dir.Path); 412Assert.Equal("星野 八郎太", File.ReadAllText(Path.Combine(dir.Path, "output.txt"), Encoding.GetEncoding(932))); 421var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/codepage:932", src.Path }); 430var result = ProcessUtilities.Run(Path.Combine(dir.Path, "sjis.exe"), arguments: "", workingDirectory: dir.Path); 432Assert.Equal("星野 八郎太", File.ReadAllText(Path.Combine(dir.Path, "output.txt"), Encoding.GetEncoding(932))); 478string basePath = baseDir.Path; 491{ Path.Combine(dirSubDir.Path, @"b.rsp"), @" 566var parser = CSharpCommandLineParser.Default.Parse(new[] { "file.cs", $"-out:{parentDir.Path}", "/noSdkPath" }, parentDir.Path, null); 584var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/nosdkpath", "/r:System.dll", "a.cs" }); 623args = DefaultParse(new[] { "/main:Test", "a.cs" }, folder.Path); 627args = DefaultParse(new[] { "/main:\"Test\"", "a.cs" }, folder.Path); 631args = DefaultParse(new[] { "/main:\"Test.Class1\"", "a.cs" }, folder.Path); 635args = DefaultParse(new[] { "/m:Test", "a.cs" }, folder.Path); 639args = DefaultParse(new[] { "/m:\"Test\"", "a.cs" }, folder.Path); 643args = DefaultParse(new[] { "/m:\"Test.Class1\"", "a.cs" }, folder.Path); 648args = DefaultParse(new[] { "/m:\"решения.Class1\"", "a.cs" }, folder.Path); 660args = DefaultParse(new[] { "-debug+/debug:portable" }, folder.Path); 692int exitCode = CreateCSharpCompiler(null, folder.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", @"/recurse:.", "/out:abc.dll" }).Run(outWriter); 697exitCode = CreateCSharpCompiler(null, folder.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", @"/recurse:. ", "/out:abc.dll" }).Run(outWriter); 702exitCode = CreateCSharpCompiler(null, folder.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", @"/recurse: . ", "/out:abc.dll" }).Run(outWriter); 707exitCode = CreateCSharpCompiler(null, folder.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", @"/recurse:././.", "/out:abc.dll" }).Run(outWriter); 714args = DefaultParse(new[] { @"/recurse:*.cp*", @"/recurse:a\*.c*", @"/out:a.dll" }, folder.Path); 717AssertEx.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); 719args = DefaultParse(new[] { @"/recurse:.\\\\\\*.cs", @"/out:a.dll" }, folder.Path); 724args = 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"))); 2785var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/a:missing.dll", "a.cs" }); 2808var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + typeof(object).Assembly.Location, "a.cs" }); 2925var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs" }); 2961var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs", "/ruleset:" + ruleSetFile.Path }); 2994var csc = CreateCSharpCompiler(null, dir.Path, 3005csc = CreateCSharpCompiler(null, dir.Path, 3041dir.Path); 3073dir.Path); 3106dir.Path); 3139dir.Path); 3173dir.Path); 3207dir.Path); 3241dir.Path); 3275dir.Path); 3310dir.Path); 3345dir.Path); 3369dir.Path); 3402dir.Path); 3435dir.Path); 3469dir.Path); 3513var csc = CreateCSharpCompiler(null, dir.Path, 3524csc = CreateCSharpCompiler(null, dir.Path, 3582var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "a.cs" }); 3592" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Goo' does not exist in the current context 3593" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Goo' does not exist in the current context 3610csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/fullpaths", "a.cs" }); 3615" + Path.Combine(dir.Path, @"a.cs") + @"(8,13): error CS0103: The name 'Goo' does not exist in the current context 3619" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Goo' does not exist in the current context 3620" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Goo' does not exist in the current context 3627" + Path.Combine(dir.Path, @"a.cs") + @"(32,13): error CS0103: The name 'Goo' does not exist in the current context 4491var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/modulename:hocusPocus ", "/out:" + exeName + " ", file1.Path }); 4499Assert.Equal(1, Directory.EnumerateFiles(dir.Path, exeName).Count()); 4501using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.Path, "aa.exe")))) 4678var parsedArgs = DefaultParse(new[] { @"/lib:lib1", @"/libpath:lib2", @"/libpaths:lib3", "a.cs" }, dir.Path, sdkDirectory: sdkDirectory); 4682lib1.Path, 4683lib2.Path, 4684lib3.Path 5999string tempDir = Temp.CreateDirectory().Path; 6035string tempDir = Temp.CreateDirectory().Path; 6068string tempDir = Temp.CreateDirectory().Path; 6102string tempDir = Temp.CreateDirectory().Path; 6114string tempDir = Temp.CreateDirectory().Path; 6952var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/target:exe", "a.cs" }); 6974var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/target:exe", "a.cs" }); 6998var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/target:library", "a.cs" }); 7021var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/preferreduilang:en", "a.cs" }); 7079var csc = CreateCSharpCompiler(null, dir.Path, commandLineArguments.Concat(new[] { inputName1, inputName2 }).ToArray()); 7087Assert.Equal(1, Directory.EnumerateFiles(dir.Path, "*" + PathUtilities.GetExtension(expectedOutputName)).Count()); 7088Assert.Equal(1, Directory.EnumerateFiles(dir.Path, expectedOutputName).Count()); 7090using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.Path, expectedOutputName)))) 7123var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/r:missing.dll", "a.cs" }); 7199var csc = CreateCSharpCompiler(null, dir.Path, commandLineArguments.Concat(new[] { fileName }).ToArray()); 7222var csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\a.exe" }); 7226Assert.Contains("error CS2012: Cannot open '" + dir.Path + "\\sub\\a.exe' for writing", outWriter.ToString(), StringComparison.Ordinal); 7248var csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\" }); 7276var csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\ " }); 7304var csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:aaa:\\a.exe" }); 7330var csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out: " }); 7364var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keyfile:key.snk", }); 7386var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keycontainer:bbb", }); 7408var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keyFile:key.snk", "/features:UseLegacyStrongNameProvider" }); 7428var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "a.cs", "/features:disable-length-based-switch" }); 7432cmd = CreateCSharpCompiler(null, dir.Path, new[] { "a.cs" }); 7523var output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $"/nologo /t:library \"{file}\"", startFolder: dir.Path); 7526output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $"/nologo /preferreduilang:en /t:library /codepage:20127 \"{file}\"", expectedRetCode: 1, startFolder: dir.Path); // 20127: US-ASCII 7804csc = CreateCSharpCompiler(null, dir.Path, new[] 7814csc = CreateCSharpCompiler(null, dir.Path, new[] 7828IntPtr lib = LoadLibraryEx(Path.Combine(dir.Path, outputFileName), IntPtr.Zero, 0x00000002); 8422csc = CreateCSharpCompiler(null, Temp.CreateDirectory().Path, new[] { source, "/preferreduilang:en" }); 8449csc = CreateCSharpCompiler(null, Temp.CreateDirectory().Path, new[] { source, "/preferreduilang:en", "/fullpaths" }); 8780int exitCode1 = CreateCSharpCompiler(null, dir.Path, new[] { "/debug:full", "/out:Program.exe", source1.Path }).Run(outWriter); 8786int exitCode2 = CreateCSharpCompiler(null, dir.Path, new[] { "/debug:full", "/out:Program.exe", source2.Path }).Run(outWriter); 8797int exitCode3 = CreateCSharpCompiler(null, dir.Path, new[] { "/debug:full", "/out:Program.exe", source3.Path }).Run(outWriter); 8842int exitCode = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/debug:full", libSrc.Path }).Run(outWriter); 8859AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)).Order()); 8916AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)).Order()); 8924Directory.Delete(dir.Path, recursive: false); 8949int exitCode = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/preferreduilang:en", libSrc.Path }).Run(outWriter); 8957AssertEx.Equal(new[] { "Lib.cs", "Lib.dll" }, Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)).Order()); 8968int exitCode = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/preferreduilang:en", libSrc.Path }).Run(outWriter); 8969Assert.Contains($"error CS2012: Cannot open '{libDll.Path}' for writing", outWriter.ToString()); 8990var srcPath = MakeTrivialExe(Temp.CreateDirectory().Path); 9012var srcPath = MakeTrivialExe(Temp.CreateDirectory().Path); 9035var srcPath = MakeTrivialExe(Temp.CreateDirectory().Path); 9059var srcPath = MakeTrivialExe(Temp.CreateDirectory().Path); 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); 9908args = DefaultParse(new[] { "/additionalfile:web*.config", "a.cs" }, baseDir.Path); 9911Assert.Equal(Path.Combine(baseDir.Path, "web1.config"), args.AdditionalFiles[0].Path); 9912Assert.Equal(Path.Combine(baseDir.Path, "web2.config"), args.AdditionalFiles[1].Path); 9913Assert.Equal(Path.Combine(baseDir.Path, "web3.config"), args.AdditionalFiles[2].Path); 10130Directory.Delete(dir.Path, true); 10189Directory.Delete(dir.Path, true); 10255Directory.Delete(dir.Path, true); 10362Directory.Delete(dir.Path, true); 10459Directory.Delete(dir.Path, true); 10496Directory.Delete(dir.Path, true); 10536Directory.Delete(dir.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"); 11751var output = ProcessUtilities.RunAndGetOutput(csc32exe.Path, $@"/nologo /debug:full /deterministic /out:Program.exe /pathmap:""{dir32.Path}""=X:\ ""{sourceFile.Path}""", expectedRetCode: 0, startFolder: dir32.Path); 11754output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $@"/nologo /debug:full /deterministic /out:Program.exe /pathmap:""{dir64.Path}""=X:\ ""{sourceFile.Path}""", expectedRetCode: 0, startFolder: dir64.Path); 11804var csc = CreateCSharpCompiler(null, dir.Path, 11810var exe = Path.Combine(dir.Path, "a.exe"); 11819var doc = Path.Combine(dir.Path, "doc.xml"); 11840var output = ProcessUtilities.RunAndGetOutput(exe, startFolder: dir.Path); 11843var refDll = Path.Combine(refDir.Path, "a.dll"); 11855CleanupAllGeneratedFiles(dir.Path); 11856CleanupAllGeneratedFiles(refDir.Path); 11869var csc = CreateCSharpCompiler(null, dir.Path, 11874var dll = Path.Combine(dir.Path, "a.dll"); 11877var refDll = Path.Combine(dir.Path, Path.Combine("ref", "a.dll")); 11883CleanupAllGeneratedFiles(dir.Path); 11920var csc = CreateCSharpCompiler(null, dir.Path, 11926var refDll = Path.Combine(dir.Path, "a.dll"); 11937var pdb = Path.Combine(dir.Path, "a.pdb"); 11940var doc = Path.Combine(dir.Path, "doc.xml"); 11968CleanupAllGeneratedFiles(dir.Path); 12029var result = ProcessUtilities.Run(cscPath, arguments: "/nologo /t:library unknown.cs", workingDirectory: dir.Path); 12037result = ProcessUtilities.Run(cscPath, arguments: "/nologo /t:library unknown.cs", workingDirectory: dir.Path); 12258var cscCopy = Path.Combine(dir.Path, "csc.exe"); 12266workingDirectory: dir.Path, 12274result = ProcessUtilities.Run(cscCopy, arguments, workingDirectory: dir.Path); 12281workingDirectory: dir.Path, 12298var csc = CreateCSharpCompiler(null, dir.Path, args); 12302var exePath = Path.Combine(dir.Path, "a.exe"); 12320var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.Path, sdkDir: null, tempDir: tempDir.Path); 12335var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.Path, sdkDir: null, tempDir: tempDir.Path); 12355var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.Path, sdkDir: null, tempDir: tempDir.Path); 12376var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.Path, sdkDir: null, tempDir: tempDir.Path); 13427var cmd = CreateCSharpCompiler(null, dir.Path, arguments, 13489string binaryPath = Path.Combine(dir.Path, "temp.dll"); 13492string pdbPath = Path.Combine(dir.Path, pdbName); 13495string xmlDocFilePath = Path.Combine(dir.Path, docName); 13535string binaryPath = Path.Combine(dir.Path, "temp.dll"); 13538string pdbPath = Path.Combine(dir.Path, pdbName); 13541string xmlDocFilePath = Path.Combine(dir.Path, docName); 13585string binaryPath = Path.Combine(dir.Path, "temp.dll"); 13588string pdbPath = Path.Combine(dir.Path, pdbName); 13591string xmlDocFilePath = Path.Combine(dir.Path, docName); 13616string binaryPath = Path.Combine(dir.Path, "temp.dll"); 13672var cmd = CreateCSharpCompiler(null, dir.Path, arguments, 13763var cmd = CreateCSharpCompiler(null, dir.Path, args, analyzers: new[] { analyzer }); 13800var cmd = CreateCSharpCompiler(null, dir.Path, args, analyzers: new[] { analyzer }); 13933var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.Path, generator); 13934ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.Path, generatorPrefix, $"generatedSource.cs"), generatedSource } }, dir, true); 13938Directory.Delete(dir.Path, true); 13974var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.Path, generator); 13975ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.Path, generatorPrefix, "generatedSource.cs"), generatedSource } }, dir, true); 14013var generator1Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.Path, generator); 14014var generator2Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.Path, generator2); 14018{ Path.Combine(dir.Path, generator1Prefix, source1Name), source1}, 14019{ Path.Combine(dir.Path, generator2Prefix, source2Name), source2}, 14024Directory.Delete(dir.Path, true); 14034var genPath1 = Path.Combine(dir.Path, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint1.cs"); 14035var genPath2 = Path.Combine(dir.Path, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint2.cs"); 14054using (Stream peStream = File.OpenRead(Path.Combine(dir.Path, "checksum.exe")), pdbStream = File.OpenRead(Path.Combine(dir.Path, "checksum.pdb"))) 14067Directory.Delete(dir.Path, true); 14097VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null); 14099var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.Path, generator); 14102{ Path.Combine(generatedDir.Path, generatorPrefix, expectedDir), new() { { expectedFileName, generatedSource } } } 14107Directory.Delete(dir.Path, true); 14123VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator1 }, analyzers: null); 14125var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.Path, generator1); 14126ValidateWrittenSources(new() { { Path.Combine(generatedDir.Path, generatorPrefix), new() { { "generatedSource.cs", generatedSource1 } } } }); 14131VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator2 }, analyzers: null); 14133ValidateWrittenSources(new() { { Path.Combine(generatedDir.Path, generatorPrefix), new() { { "generatedSource.cs", generatedSource2 } } } }); 14137Directory.Delete(dir.Path, true); 14158VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator, generator2 }, analyzers: null); 14160var generator1Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.Path, generator); 14161var generator2Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.Path, generator2); 14171Directory.Delete(dir.Path, true); 14199VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null); 14201var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.Path, generator); 14204{ Path.Combine(generatedDir.Path, generatorPrefix, expectedDir), new() { { generatedFileName, generatedSource } } } 14209Directory.Delete(dir.Path, true); 14218var snk = Temp.CreateFile("TestKeyPair_", ".snk", dir.Path).WriteAllBytes(TestResources.General.snKey); 14220var virtualSnProvider = new DesktopStrongNameProvider(ImmutableArray.Create(dir.Path)); 14235var path = Path.Combine(dir.Path, Guid.NewGuid().ToString() + ".dll"); 14250VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/analyzer:" + gen1, "/analyzer:" + gen2 }.ToArray()); 14257{ Path.Combine(generatedDir.Path, "generator", "TestGenerator"), new() { { "generatedSource.cs", "//from version 2.0.0.0" } } } 14275ValidateWrittenSources(new() { { generatedDir.Path, new() } }); 14279Directory.Delete(dir.Path, true); 14291var generatedDirPath = Path.Combine(dir.Path, "noexist"); 14300Directory.Delete(dir.Path, true); 14316VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null); 14318var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.Path, generator); 14319ValidateWrittenSources(new() { { Path.Combine(generatedDir.Path, generatorPrefix), new() { { "generatedSource.cs", generatedSource } } } }); 14323Directory.Delete(dir.Path, true); 14392Directory.Delete(dir.Path, true); 14408VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, $"/touchedfiles:{dir.Path}/touched", "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null); 14410var touchedFiles = Directory.GetFiles(dir.Path, "touched*"); 14413string[] writtenText = File.ReadAllLines(Path.Combine(dir.Path, "touched.write")); 14420Directory.Delete(dir.Path, true); 14488Directory.Delete(dir.Path, true); 14547$"/out:{objDir.Path}/embed.exe", 14557Directory.Delete(dir.Path, true); 14613pathMapArgument = pathMapArgument.Replace("DIRPATH", dir.Path).Replace("SRCDIRPATH", srcDir.Path).Replace("OBJDIRPATH", objDir.Path); 14619"/generatedfilesout:" + objDir.Path, 14630var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(objDir.Path, generator); 14638Directory.Delete(dir.Path, true); 14726var cmd = CreateCSharpCompiler(null, dir.Path, args, generators: new[] { generator }); 14786var cmd = CreateCSharpCompiler(null, dir.Path, 14806var cmd = CreateCSharpCompiler(null, dir.Path, 14831var cmd = CreateCSharpCompiler(null, dir.Path, 14851var cmd = CreateCSharpCompiler(null, dir.Path, 14891Directory.Delete(dir.Path, true); 14957var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15038var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15252CleanupAllGeneratedFiles(srcDirectory.Path); 15408var generatorPath = Path.Combine(directory.Path, "generator.dll"); 15444Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.Path, additionalFilePath1))); 15445Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.Path, additionalFilePath2))); 15451string path2 = additionalFile2?.Path ?? Path.Combine(srcDirectory.Path, additionalFilePath2); 15468CleanupAllGeneratedFiles(srcDirectory.Path); 15563var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15574cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15615var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15626cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15697var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15708cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15750var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15761cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15828var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15867var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15907var cmd = CreateCSharpCompiler(null, dir.Path, new[] {
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");
SarifV2ErrorLoggerTests.cs (8)
447var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 529var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 599var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 669Assert.False(File.Exists(Path.Combine(mappedDir.Path, "otherfile.cs"))); 674#line 123 "{{mappedDir.Path}}\otherfile.cs" 679var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 713Assert.Equal($"file:///{mappedDir.Path.Replace(@"\", "/")}/otherfile.cs", (string)resultFile["uri"]); 739Assert.Equal(expected: $"file:///{mappedDir.Path.Replace(@"\", "/")}/otherfile.cs", (string)physicalLocation["artifactLocation"]["uri"]);
TouchedFileLoggingTests.cs (5)
40var touchedBase = Path.Combine(touchedDir.Path, "touched"); 68var touchedBase = Path.Combine(touchedDir.Path, "touched"); 115var touchedBase = Path.Combine(touchedDir.Path, "touched"); 154var touchedBase = Path.Combine(touchedDir.Path, "touched"); 161"/touchedfiles:" + touchedDir.Path + "\\touched",
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Workspaces\WorkspaceTests_EditorFeatures.cs (2)
1147var analyzerConfigPath = PathUtilities.CombineAbsoluteAndRelativePaths(Temp.CreateDirectory().Path, ".editorconfig"); 1392var analyzerConfigDocFilePath = PathUtilities.CombineAbsoluteAndRelativePaths(Temp.CreateDirectory().Path, ".editorconfig");
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (15)
Emit\CompilationEmitTests.cs (2)
4635var dllPath = Path.Combine(tmpDir.Path, "assemblyname.dll"); 4636var pdbPath = Path.Combine(tmpDir.Path, "assemblyname.pdb");
Emit\DesktopStrongNameProviderTests.cs (13)
23var provider = new DesktopStrongNameProvider(tempPath: tempDir.Path); 24Assert.Equal(tempDir.Path, provider.FileSystem.GetSigningTempPath()); 38var provider1 = new DesktopStrongNameProvider(tempPath: tempDir.Path); 39var provider2 = new DesktopStrongNameProvider(tempPath: tempDir.Path); 48var provider1 = new DesktopStrongNameProvider(keyFileSearchPaths: [tempDir.Path]); 49var provider2 = new DesktopStrongNameProvider(keyFileSearchPaths: [tempDir.Path]); 58var provider1 = new DesktopStrongNameProvider(tempPath: tempDir.Path); 59var provider2 = new DesktopStrongNameProvider(tempPath: tempDir.Path + "2"); 68var provider1 = new DesktopStrongNameProvider(keyFileSearchPaths: [tempDir.Path]); 69var provider2 = new DesktopStrongNameProvider(keyFileSearchPaths: [tempDir.Path + "2"]); 78var provider1 = new DesktopStrongNameProvider(keyFileSearchPaths: [tempDir.Path]); 79var provider2 = new DesktopStrongNameProvider(keyFileSearchPaths: [tempDir.Path.ToUpper()]); 93var provider = new DesktopStrongNameProvider(ImmutableArray<string>.Empty, new VirtualizedStrongNameFileSystem(tempDir.Path));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (8)
Attributes\AttributeTests_Security.cs (4)
1502var resolver = new XmlFileResolver(tempDir.Path); 1585var resolver = new XmlFileResolver(tempDir.Path); 1606string filePath = Path.Combine(tempDir.Path, "pset_01.xml"); 1629TestOptions.ReleaseDll.WithXmlReferenceResolver(new XmlFileResolver(tempDir.Path)));
Attributes\EmitTestStrongNameProvider.cs (1)
25var fileSystem = new TestStrongNameFileSystem(_signingTempDirectory.Path)
Attributes\InternalsVisibleToAndStrongNameTests.cs (3)
65new DesktopStrongNameProvider(ImmutableArray.Create(keyFilePath), strongNameFileSystem: new VirtualizedStrongNameFileSystem(_signingTempDirectory.Path)); 230new VirtualizedStrongNameFileSystem(_signingTempDirectory.Path)) 2857var provider = new TestDesktopStrongNameProvider(fileSystem: new VirtualizedStrongNameFileSystem(_signingTempDirectory.Path))
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (15)
CommandLineRunnerTests.cs (14)
381workingDirectory: dir.Path); 484var scriptPath = PathUtilities.CombinePathsUnchecked(PathUtilities.GetFileName(directory.Path), scriptName); 485var workingDirectory = PathUtilities.GetDirectoryName(directory.Path); 539var runner = CreateRunner([$"/loadpath:{dir1.Path}", $"/loadpaths:{dir2.Path};{dir3.Path}", main.Path]); 576var runner = CreateRunner(["/r:4.dll", $"/lib:{dir1.Path}", $"/libpath:{dir2.Path}", $"/libpaths:{dir3.Path};{dir4.Path}", main.Path]); 597SourcePaths.Add(@""{dir.Path}"") 612> SourcePaths.Add(@""{dir.Path}"") 633ReferencePaths.Add(@""{dir.Path}"") 648> ReferencePaths.Add(@""{dir.Path}"")
InteractiveSessionReferencesTests.cs (1)
143File.Move(libBFile.Path, Path.Combine(dir.Path, "libB.dll"));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
DocumentationComments\DocumentationCommentCompilerTests.cs (2)
4714var resolver = new XmlFileResolver(rootDir.Path); 8655var path = dir.Path;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Emit\CompilationOutputFilesTests.cs (1)
57Directory.Delete(dir.Path, recursive: true);
Microsoft.CodeAnalysis.ExternalAccess.Razor.UnitTests (5)
RazorAnalyzerAssemblyResolverTests.cs (5)
102var dir1 = TempRoot.CreateDirectory().Path; 104var dir2 = TempRoot.CreateDirectory().Path; 136var dir1 = TempRoot.CreateDirectory().Path; 138var dir2 = TempRoot.CreateDirectory().Path; 160var dir = TempRoot.CreateDirectory().Path;
Microsoft.CodeAnalysis.Features.UnitTests (2)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (2)
122AddDocument(CreateDesignTimeOnlyDocument(projectPId, name: "dt1.cs", path: Path.Combine(dir.Path, "dt1.cs"))). 913var designTimeOnlyFilePath = Path.Combine(dir.Path, designTimeOnlyFileName);
Microsoft.CodeAnalysis.LanguageServer.UnitTests (17)
ExportProviderBuilderTests.cs (2)
89await using var testServer = await TestLspServer.CreateAsync(new Roslyn.LanguageServer.Protocol.ClientCapabilities(), LoggerFactory, MefCacheDirectory.Path, includeDevKitComponents: true, [dllPath]); 165var mefCompositions = Directory.EnumerateFiles(MefCacheDirectory.Path, "*.mef-composition", SearchOption.AllDirectories);
FileBasedProgramsWorkspaceTests.cs (1)
47cacheDirectory: _mefCacheDirectory.Path,
LspFileChangeWatcherTests.cs (6)
31await using var testLspServer = await TestLspServer.CreateAsync(new ClientCapabilities(), LoggerFactory, MefCacheDirectory.Path); 39await using var testLspServer = await TestLspServer.CreateAsync(_clientCapabilitiesWithFileWatcherSupport, LoggerFactory, MefCacheDirectory.Path); 49await using var testLspServer = await TestLspServer.CreateAsync(_clientCapabilitiesWithFileWatcherSupport, LoggerFactory, MefCacheDirectory.Path); 60var context = lspFileChangeWatcher.CreateContext([new ProjectSystem.WatchedDirectory(tempDirectory.Path, extensionFilters: [])]); 65Assert.Equal(tempDirectory.Path, watcher.GlobPattern.Second.BaseUri.Second.GetRequiredParsedUri().LocalPath); 79await using var testLspServer = await TestLspServer.CreateAsync(_clientCapabilitiesWithFileWatcherSupport, LoggerFactory, MefCacheDirectory.Path);
TelemetryReporterTests.cs (1)
20MefCacheDirectory.Path,
Utilities\AbstractLanguageServerClientTests.cs (3)
45var projectPath = Path.Combine(projectDirectory.Path, "Project.csproj"); 59var codePath = Path.Combine(projectDirectory.Path, "Code.cs"); 70ExtensionLogsDirectory.Path,
Utilities\AbstractLanguageServerHostTests.cs (1)
32return TestLspServer.CreateAsync(new ClientCapabilities(), LoggerFactory, MefCacheDirectory.Path, includeDevKitComponents);
VirtualProjectXmlProviderTests.cs (2)
47LoggerFactory, includeDevKitComponents: false, MefCacheDirectory.Path, extensionPaths: null); 153var content = await projectProvider.GetVirtualProjectContentAsync(Path.Combine(tempDir.Path, "BAD"), LoggerFactory.CreateLogger<VirtualProjectXmlProviderTests>(), CancellationToken.None);
WorkspaceProjectFactoryServiceTests.cs (1)
22loggerFactory, includeDevKitComponents: false, MefCacheDirectory.Path, []);
Microsoft.CodeAnalysis.Rebuild.UnitTests (1)
CSharpDeterministicKeyBuilderTests.cs (1)
412var fileSystem = new TestStrongNameFileSystem(temp.CreateDirectory().Path);
Microsoft.CodeAnalysis.Scripting.UnitTests (4)
RuntimeMetadataReferenceResolverTests.cs (4)
30new RelativePathResolver(ImmutableArray.Create(directory.Path), directory.Path), 50searchPaths: ImmutableArray.Create(directory.Path), 51baseDirectory: directory.Path);
Microsoft.CodeAnalysis.Test.Utilities (4)
AssemblyLoadTestFixture.cs (1)
23public string TempDirectory => _directory.Path;
TempFiles\DisposableDirectory.cs (3)
21if (Path != null && Directory.Exists(Path)) 25Directory.Delete(Path, recursive: true);
Microsoft.CodeAnalysis.UnitTests (17)
AnalyzerAssemblyLoaderTests.cs (2)
341var analyzerPath = Path.Combine(tempDir.CreateDirectory("a").Path, "analyzer.dll"); 1661AnalyzerTestKind.ShadowLoad => new AnalyzerAssemblyLoader([new ShadowCopyAnalyzerPathResolver(Temp.CreateDirectory().Path)], [AnalyzerAssemblyLoader.DiskAnalyzerAssemblyResolver], alc),
Analyzers\AnalyzerFileReferenceTests.cs (5)
320new BuildPaths(clientDir: directory.Path, workingDir: directory.Path, sdkDir: null, tempDir: null), 349new BuildPaths(clientDir: directory.Path, workingDir: directory.Path, sdkDir: null, tempDir: null), 482var generatorPath = Path.Combine(directory.Path, $"generator_{targetFramework}.dll");
CompilerResolverTests.cs (2)
53var assembly = Loader.CompilerAnalyzerAssemblyResolver.Resolve(Loader, name, ScratchContext, TempRoot.CreateDirectory().Path); 60var assembly = Loader.CompilerAnalyzerAssemblyResolver.Resolve(Loader, AssemblyInCompilerContext.GetName(), ScratchContext, TempRoot.CreateDirectory().Path);
FileSystem\RelativePathResolverTests.cs (2)
171ImmutableArray.Create(dir1.Path, dir2.Path),
InvokeUtil.cs (1)
58pathResolvers = [.. pathResolvers, new ShadowCopyAnalyzerPathResolver(tempRoot.CreateDirectory().Path)];
ShadowCopyAnalyzerPathResolverTests.cs (5)
25PathResolver = new ShadowCopyAnalyzerPathResolver(TempRoot.CreateDirectory().Path); 55var analyzerPath = Path.Combine(TempRoot.CreateDirectory().Path, "analyzer.dll"); 63var analyzerPath = Path.Combine(TempRoot.CreateDirectory().Path, "analyzer.dll"); 77var dir = TempRoot.CreateDirectory().Path; 90var dir = TempRoot.CreateDirectory().Path;
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (6)
NetCoreTests.cs (4)
39["NUGET_PACKAGES"] = _nugetCacheDir.Path 46workingDirectory: SolutionDirectory.Path, 54RunDotNet($@"msbuild ""{solutionOrProjectFileName}"" /t:restore /bl:{Path.Combine(SolutionDirectory.Path, "restore.binlog")}"); 59var arguments = $@"msbuild ""{solutionOrProjectFileName}"" /bl:{Path.Combine(SolutionDirectory.Path, "build.binlog")}";
NewlyCreatedProjectsFromDotNetNew.cs (1)
153var projectDirectory = SolutionDirectory.Path;
WorkspaceTestBase.cs (1)
35return Path.Combine(this.SolutionDirectory.Path, relativeFileName);
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
CommandLineProject\CommandLineProjectWorkspaceTests.cs (1)
28var info = CommandLineProject.CreateProjectInfo("TestProject", LanguageNames.CSharp, commandLine, tempDirectory.Path, ws);
SolutionTests\SolutionWithSourceGeneratorTests.cs (1)
1426var analyzerPath = Path.Combine(tempDirectory.Path, "Microsoft.CodeAnalysis.TestAnalyzerReference.dll");
WorkspaceTests\AdhocWorkspaceTests.cs (1)
283var analyzerConfigDocFilePath = PathUtilities.CombineAbsoluteAndRelativePaths(Temp.CreateDirectory().Path, ".editorconfig");
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (10)
PersistentStorage\AbstractPersistentStorageTests.cs (4)
873solution = solution.AddDocument(id, "file.cs", "class C { void M() }", filePath: Path.Combine(_persistentFolder.Path, "file.cs")); 893solution = solution.AddDocument(id, "file.cs", "class C { void M() }", filePath: Path.Combine(_persistentFolder.Path, "file.cs")); 1009var configuration = new MockPersistentStorageConfiguration(solution.Id, persistentFolder.Path, throwOnFailure); 1027var configuration = new MockPersistentStorageConfiguration(solutionKey.Id, _persistentFolder.Path, throwOnFailure: true);
ProjectSystemShim\TempPECompilerServiceTests.cs (2)
31pszOutputFileName: Path.Combine(directory.Path, "Output.dll"), 37optionValues: [Path.Combine(directory.Path, "MissingReference.dll")]);
ProjectSystemShim\VisualStudioCompilationOutputFilesTests.cs (4)
65Directory.Delete(dir.Path, recursive: true); 72var outputs = new CompilationOutputFilesWithImplicitPdbPath(Path.Combine(dir.Path, "nonexistent.dll")); 87var debugDirPdbPath = Path.Combine(dir.Path, "nonexistent.pdb"); 104Directory.Delete(dir.Path, recursive: true);
VBCSCompiler.UnitTests (46)
AnalyzerConsistencyCheckerTests.cs (12)
87var assemblyLoader = AnalyzerAssemblyLoader.CreateNonLockingLoader(directory.CreateDirectory("shadow").Path); 90var result = AnalyzerConsistencyChecker.Check(directory.Path, analyzerReferences, assemblyLoader, Logger); 98var assemblyLoader = AnalyzerAssemblyLoader.CreateNonLockingLoader(directory.CreateDirectory("shadow").Path); 113var assemblyLoader = AnalyzerAssemblyLoader.CreateNonLockingLoader(directory.CreateDirectory("shadow").Path); 123var result = AnalyzerConsistencyChecker.Check(directory.Path, analyzerReferences, assemblyLoader, Logger); 138var assemblyLoader = AnalyzerAssemblyLoader.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 AnalyzerAssemblyLoader(), Logger);
BuildClientTests.cs (2)
40workingDir: Temp.CreateDirectory().Path, 41tempDir: Temp.CreateDirectory().Path);
BuildServerConnectionTests.cs (4)
40var workingDirectory = TempRoot.CreateDirectory().Path; 69var workingDirectory = TempRoot.CreateDirectory().Path; 99ProtocolUtil.CreateEmptyCSharp(TempRoot.CreateDirectory().Path), 120var workingDirectory = TempRoot.CreateDirectory().Path;
CompilerServerApiTest.cs (1)
115var request = BuildRequest.Create(RequestLanguage.CSharpCompile, workingDirectory: temp.CreateDirectory().Path, tempDirectory: null, compilerHash: BuildProtocolConstants.GetCommitHash(), libDirectory: null, args: Array.Empty<string>());
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;
TouchedFileLoggingTests.cs (4)
49var loader = AnalyzerAssemblyLoader.CreateNonLockingLoader(Temp.CreateDirectory().Path); 60var touchedBase = Path.Combine(touchedDir.Path, "touched"); 100var loader = AnalyzerAssemblyLoader.CreateNonLockingLoader(Temp.CreateDirectory().Path); 111var touchedBase = Path.Combine(touchedDir.Path, "touched");
VBCSCompilerServerTests.cs (2)
305var workingDirectory = TempRoot.CreateDirectory().Path; 346var workingDirectory = TempRoot.CreateDirectory().Path;