534 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 (24)
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);
RuntimeHostInfoTests.cs (5)
30Environment.SetEnvironmentVariable("PATH", globalDotNetDir.Path); 32Assert.Equal(globalDotNetDir.Path, RuntimeHostInfo.GetToolDotNetRoot(_output.WriteLine)); 67var symlinkPath = Path.Combine(binDir.Path, $"dotnet{PlatformInformation.ExeExtension}"); 72Environment.SetEnvironmentVariable("PATH", binDir.Path); 74Assert.Equal(globalDotNetDir.Path, RuntimeHostInfo.GetToolDotNetRoot(_output.WriteLine));
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" }); 7066var csc = CreateCSharpCompiler(null, dir.Path, commandLineArguments.Concat(new[] { inputName1, inputName2 }).ToArray()); 7074Assert.Equal(1, Directory.EnumerateFiles(dir.Path, "*" + PathUtilities.GetExtension(expectedOutputName)).Count()); 7075Assert.Equal(1, Directory.EnumerateFiles(dir.Path, expectedOutputName).Count()); 7077using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.Path, expectedOutputName)))) 7110var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/r:missing.dll", "a.cs" }); 7186var csc = CreateCSharpCompiler(null, dir.Path, commandLineArguments.Concat(new[] { fileName }).ToArray()); 7209var csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\a.exe" }); 7213Assert.Contains("error CS2012: Cannot open '" + dir.Path + "\\sub\\a.exe' for writing", outWriter.ToString(), StringComparison.Ordinal); 7235var csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\" }); 7263var csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\ " }); 7291var csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:aaa:\\a.exe" }); 7317var csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out: " }); 7351var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keyfile:key.snk", }); 7373var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keycontainer:bbb", }); 7395var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keyFile:key.snk", "/features:UseLegacyStrongNameProvider" }); 7415var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "a.cs", "/features:disable-length-based-switch" }); 7419cmd = CreateCSharpCompiler(null, dir.Path, new[] { "a.cs" }); 7510var output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $"/nologo /t:library \"{file}\"", startFolder: dir.Path); 7513output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $"/nologo /preferreduilang:en /t:library /codepage:20127 \"{file}\"", expectedRetCode: 1, startFolder: dir.Path); // 20127: US-ASCII 7791csc = CreateCSharpCompiler(null, dir.Path, new[] 7801csc = CreateCSharpCompiler(null, dir.Path, new[] 7815IntPtr lib = LoadLibraryEx(Path.Combine(dir.Path, outputFileName), IntPtr.Zero, 0x00000002); 8409csc = CreateCSharpCompiler(null, Temp.CreateDirectory().Path, new[] { source, "/preferreduilang:en" }); 8436csc = CreateCSharpCompiler(null, Temp.CreateDirectory().Path, new[] { source, "/preferreduilang:en", "/fullpaths" }); 8765int exitCode1 = CreateCSharpCompiler(null, dir.Path, new[] { "/debug:full", "/out:Program.exe", source1.Path }).Run(outWriter); 8771int exitCode2 = CreateCSharpCompiler(null, dir.Path, new[] { "/debug:full", "/out:Program.exe", source2.Path }).Run(outWriter); 8782int exitCode3 = CreateCSharpCompiler(null, dir.Path, new[] { "/debug:full", "/out:Program.exe", source3.Path }).Run(outWriter); 8827int exitCode = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/debug:full", libSrc.Path }).Run(outWriter); 8844AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)).Order()); 8901AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)).Order()); 8909Directory.Delete(dir.Path, recursive: false); 8934int exitCode = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/preferreduilang:en", libSrc.Path }).Run(outWriter); 8942AssertEx.Equal(new[] { "Lib.cs", "Lib.dll" }, Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)).Order()); 8953int exitCode = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/preferreduilang:en", libSrc.Path }).Run(outWriter); 8954Assert.Contains($"error CS2012: Cannot open '{libDll.Path}' for writing", outWriter.ToString()); 8975var srcPath = MakeTrivialExe(Temp.CreateDirectory().Path); 8997var srcPath = MakeTrivialExe(Temp.CreateDirectory().Path); 9020var srcPath = MakeTrivialExe(Temp.CreateDirectory().Path); 9044var srcPath = MakeTrivialExe(Temp.CreateDirectory().Path); 9278TestCS2002(commandLineArgs, tempDir.Path, 0, aWrnString); 9284TestCS2002(commandLineArgs, tempDir.Path, 0, warnings); 9290TestCS2002(commandLineArgs, tempDir.Path, 0, AWrnString); 9296TestCS2002(commandLineArgs, tempDir.Path, 0, String.Empty); 9302TestCS2002(commandLineArgs, tempParentDir.Path, 0, tmpDiraString); 9307TestCS2002(commandLineArgs, tempParentDir.Path, 0, tmpDiraString); 9312TestCS2002(commandLineArgs, tempParentDir.Path, 0, tmpDiraString); 9317TestCS2002(commandLineArgs, tempParentDir.Path, 0, tmpDiraString); 9321TestCS2002(commandLineArgs, tempParentDir.Path, 0, tmpDiraString); 9327var formattedcs1504Str = String.Format(cs1504, PathUtilities.CombineAbsoluteAndRelativePaths(tempParentDir.Path, "tmpDir\a.cs"), "Illegal characters in path."); 9328TestCS2002(commandLineArgs, tempParentDir.Path, 1, formattedcs1504Str); 9336TestCS2002(commandLineArgs, tempParentDir.Path, 1, (string[])null, parseDiags); 9343TestCS2002(commandLineArgs, tempParentDir.Path, 1, (string[])null, parseDiags); 9347var formattedcs1504 = String.Format(cs1504, PathUtilities.CombineAbsoluteAndRelativePaths(tempParentDir.Path, @":a.cs"), @"The given path's format is not supported."); 9348TestCS2002(commandLineArgs, tempParentDir.Path, 1, formattedcs1504); 9351System.IO.Directory.Delete(tempParentDir.Path, true); 9893args = DefaultParse(new[] { "/additionalfile:web*.config", "a.cs" }, baseDir.Path); 9896Assert.Equal(Path.Combine(baseDir.Path, "web1.config"), args.AdditionalFiles[0].Path); 9897Assert.Equal(Path.Combine(baseDir.Path, "web2.config"), args.AdditionalFiles[1].Path); 9898Assert.Equal(Path.Combine(baseDir.Path, "web3.config"), args.AdditionalFiles[2].Path); 10115Directory.Delete(dir.Path, true); 10174Directory.Delete(dir.Path, true); 10240Directory.Delete(dir.Path, true); 10347Directory.Delete(dir.Path, true); 10444Directory.Delete(dir.Path, true); 10481Directory.Delete(dir.Path, true); 10521Directory.Delete(dir.Path, true); 10573var csc = CreateCSharpCompiler(null, sourceDir.Path, args, analyzers: analyzers, generators: generators, driverCache: driverCache); 11611var csc = CreateCSharpCompiler(null, dir.Path, args); 11615var exePath = Path.Combine(dir.Path, "a.exe"); 11627var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11634var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11635AssertPdbEmit(dir, pdbPath, @"q:\a.pdb", $@"/pathmap:{dir.Path}=q:\"); 11641var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11642AssertPdbEmit(dir, pdbPath, @"q:\a.pdb", $@"/pathmap:{dir.Path}=q:\", "/deterministic"); 11649var pdbPath = Path.Combine(dir.Path, @"pdb\a.pdb"); 11650AssertPdbEmit(dir, pdbPath, @"q:\pdb\a.pdb", $@"/pathmap:{dir.Path}=q:\"); 11656var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11663var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11664AssertPdbEmit(dir, pdbPath, @"/a.pdb", $@"/pathmap:{dir.Path}=/"); 11670var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11671AssertPdbEmit(dir, pdbPath, "/goo/a.pdb", $"/pathmap:{dir.Path}=/goo,{dir.Path}{PathUtilities.DirectorySeparatorChar}=/bar"); 11736var output = ProcessUtilities.RunAndGetOutput(csc32exe.Path, $@"/nologo /debug:full /deterministic /out:Program.exe /pathmap:""{dir32.Path}""=X:\ ""{sourceFile.Path}""", expectedRetCode: 0, startFolder: dir32.Path); 11739output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $@"/nologo /debug:full /deterministic /out:Program.exe /pathmap:""{dir64.Path}""=X:\ ""{sourceFile.Path}""", expectedRetCode: 0, startFolder: dir64.Path); 11789var csc = CreateCSharpCompiler(null, dir.Path, 11795var exe = Path.Combine(dir.Path, "a.exe"); 11804var doc = Path.Combine(dir.Path, "doc.xml"); 11825var output = ProcessUtilities.RunAndGetOutput(exe, startFolder: dir.Path); 11828var refDll = Path.Combine(refDir.Path, "a.dll"); 11840CleanupAllGeneratedFiles(dir.Path); 11841CleanupAllGeneratedFiles(refDir.Path); 11854var csc = CreateCSharpCompiler(null, dir.Path, 11859var dll = Path.Combine(dir.Path, "a.dll"); 11862var refDll = Path.Combine(dir.Path, Path.Combine("ref", "a.dll")); 11868CleanupAllGeneratedFiles(dir.Path); 11905var csc = CreateCSharpCompiler(null, dir.Path, 11911var refDll = Path.Combine(dir.Path, "a.dll"); 11922var pdb = Path.Combine(dir.Path, "a.pdb"); 11925var doc = Path.Combine(dir.Path, "doc.xml"); 11953CleanupAllGeneratedFiles(dir.Path); 12014var result = ProcessUtilities.Run(cscPath, arguments: "/nologo /t:library unknown.cs", workingDirectory: dir.Path); 12022result = ProcessUtilities.Run(cscPath, arguments: "/nologo /t:library unknown.cs", workingDirectory: dir.Path); 12243var cscCopy = Path.Combine(dir.Path, "csc.exe"); 12251workingDirectory: dir.Path, 12259result = ProcessUtilities.Run(cscCopy, arguments, workingDirectory: dir.Path); 12266workingDirectory: dir.Path, 12283var csc = CreateCSharpCompiler(null, dir.Path, args); 12287var exePath = Path.Combine(dir.Path, "a.exe"); 12305var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.Path, sdkDir: null, tempDir: tempDir.Path); 12320var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.Path, sdkDir: null, tempDir: tempDir.Path); 12340var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.Path, sdkDir: null, tempDir: tempDir.Path); 12361var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.Path, sdkDir: null, tempDir: tempDir.Path); 13412var cmd = CreateCSharpCompiler(null, dir.Path, arguments, 13474string binaryPath = Path.Combine(dir.Path, "temp.dll"); 13477string pdbPath = Path.Combine(dir.Path, pdbName); 13480string xmlDocFilePath = Path.Combine(dir.Path, docName); 13520string binaryPath = Path.Combine(dir.Path, "temp.dll"); 13523string pdbPath = Path.Combine(dir.Path, pdbName); 13526string xmlDocFilePath = Path.Combine(dir.Path, docName); 13570string binaryPath = Path.Combine(dir.Path, "temp.dll"); 13573string pdbPath = Path.Combine(dir.Path, pdbName); 13576string xmlDocFilePath = Path.Combine(dir.Path, docName); 13601string binaryPath = Path.Combine(dir.Path, "temp.dll"); 13657var cmd = CreateCSharpCompiler(null, dir.Path, arguments, 13748var cmd = CreateCSharpCompiler(null, dir.Path, args, analyzers: new[] { analyzer }); 13785var cmd = CreateCSharpCompiler(null, dir.Path, args, analyzers: new[] { analyzer }); 13918var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.Path, generator); 13919ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.Path, generatorPrefix, $"generatedSource.cs"), generatedSource } }, dir, true); 13923Directory.Delete(dir.Path, true); 13959var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.Path, generator); 13960ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.Path, generatorPrefix, "generatedSource.cs"), generatedSource } }, dir, true); 13998var generator1Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.Path, generator); 13999var generator2Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.Path, generator2); 14003{ Path.Combine(dir.Path, generator1Prefix, source1Name), source1}, 14004{ Path.Combine(dir.Path, generator2Prefix, source2Name), source2}, 14009Directory.Delete(dir.Path, true); 14019var genPath1 = Path.Combine(dir.Path, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint1.cs"); 14020var genPath2 = Path.Combine(dir.Path, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint2.cs"); 14039using (Stream peStream = File.OpenRead(Path.Combine(dir.Path, "checksum.exe")), pdbStream = File.OpenRead(Path.Combine(dir.Path, "checksum.pdb"))) 14052Directory.Delete(dir.Path, true); 14082VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null); 14084var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.Path, generator); 14087{ Path.Combine(generatedDir.Path, generatorPrefix, expectedDir), new() { { expectedFileName, generatedSource } } } 14092Directory.Delete(dir.Path, true); 14108VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator1 }, analyzers: null); 14110var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.Path, generator1); 14111ValidateWrittenSources(new() { { Path.Combine(generatedDir.Path, generatorPrefix), new() { { "generatedSource.cs", generatedSource1 } } } }); 14116VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator2 }, analyzers: null); 14118ValidateWrittenSources(new() { { Path.Combine(generatedDir.Path, generatorPrefix), new() { { "generatedSource.cs", generatedSource2 } } } }); 14122Directory.Delete(dir.Path, true); 14143VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator, generator2 }, analyzers: null); 14145var generator1Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.Path, generator); 14146var generator2Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.Path, generator2); 14156Directory.Delete(dir.Path, true); 14184VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null); 14186var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.Path, generator); 14189{ Path.Combine(generatedDir.Path, generatorPrefix, expectedDir), new() { { generatedFileName, generatedSource } } } 14194Directory.Delete(dir.Path, true); 14203var snk = Temp.CreateFile("TestKeyPair_", ".snk", dir.Path).WriteAllBytes(TestResources.General.snKey); 14205var virtualSnProvider = new DesktopStrongNameProvider(ImmutableArray.Create(dir.Path)); 14220var path = Path.Combine(dir.Path, Guid.NewGuid().ToString() + ".dll"); 14235VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/analyzer:" + gen1, "/analyzer:" + gen2 }.ToArray()); 14242{ Path.Combine(generatedDir.Path, "generator", "TestGenerator"), new() { { "generatedSource.cs", "//from version 2.0.0.0" } } } 14260ValidateWrittenSources(new() { { generatedDir.Path, new() } }); 14264Directory.Delete(dir.Path, true); 14276var generatedDirPath = Path.Combine(dir.Path, "noexist"); 14285Directory.Delete(dir.Path, true); 14301VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null); 14303var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.Path, generator); 14304ValidateWrittenSources(new() { { Path.Combine(generatedDir.Path, generatorPrefix), new() { { "generatedSource.cs", generatedSource } } } }); 14308Directory.Delete(dir.Path, true); 14377Directory.Delete(dir.Path, true); 14393VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, $"/touchedfiles:{dir.Path}/touched", "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null); 14395var touchedFiles = Directory.GetFiles(dir.Path, "touched*"); 14398string[] writtenText = File.ReadAllLines(Path.Combine(dir.Path, "touched.write")); 14405Directory.Delete(dir.Path, true); 14473Directory.Delete(dir.Path, true); 14532$"/out:{objDir.Path}/embed.exe", 14542Directory.Delete(dir.Path, true); 14598pathMapArgument = pathMapArgument.Replace("DIRPATH", dir.Path).Replace("SRCDIRPATH", srcDir.Path).Replace("OBJDIRPATH", objDir.Path); 14604"/generatedfilesout:" + objDir.Path, 14615var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(objDir.Path, generator); 14623Directory.Delete(dir.Path, true); 14711var cmd = CreateCSharpCompiler(null, dir.Path, args, generators: new[] { generator }); 14771var cmd = CreateCSharpCompiler(null, dir.Path, 14791var cmd = CreateCSharpCompiler(null, dir.Path, 14816var cmd = CreateCSharpCompiler(null, dir.Path, 14836var cmd = CreateCSharpCompiler(null, dir.Path, 14876Directory.Delete(dir.Path, true); 14942var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15023var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15237CleanupAllGeneratedFiles(srcDirectory.Path); 15393var generatorPath = Path.Combine(directory.Path, "generator.dll"); 15429Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.Path, additionalFilePath1))); 15430Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.Path, additionalFilePath2))); 15436string path2 = additionalFile2?.Path ?? Path.Combine(srcDirectory.Path, additionalFilePath2); 15453CleanupAllGeneratedFiles(srcDirectory.Path); 15548var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15559cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15600var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15611cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15682var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15693cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15735var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15746cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15813var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15852var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15892var 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 (4)
Completion\CompletionProviders\AppDirectiveCompletionProviderTests.cs (2)
58var scriptFilePath = Path.Combine(tempDirectory.Path, "App.cs"); 89var scriptFilePath = Path.Combine(tempDirectory.Path, "App.cs");
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)
378workingDirectory: dir.Path); 481var scriptPath = PathUtilities.CombinePathsUnchecked(PathUtilities.GetFileName(directory.Path), scriptName); 482var workingDirectory = PathUtilities.GetDirectoryName(directory.Path); 536var runner = CreateRunner([$"/loadpath:{dir1.Path}", $"/loadpaths:{dir2.Path};{dir3.Path}", main.Path]); 573var runner = CreateRunner(["/r:4.dll", $"/lib:{dir1.Path}", $"/libpath:{dir2.Path}", $"/libpaths:{dir3.Path};{dir4.Path}", main.Path]); 594SourcePaths.Add(@""{dir.Path}"") 609> SourcePaths.Add(@""{dir.Path}"") 630ReferencePaths.Add(@""{dir.Path}"") 645> 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"))). 907var 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)
40["NUGET_PACKAGES"] = _nugetCacheDir.Path 47workingDirectory: SolutionDirectory.Path, 55RunDotNet($@"msbuild ""{solutionOrProjectFileName}"" /t:restore /bl:{Path.Combine(SolutionDirectory.Path, "restore.binlog")}"); 60var 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)
1465var 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)
41var workingDirectory = TempRoot.CreateDirectory().Path; 70var workingDirectory = TempRoot.CreateDirectory().Path; 100ProtocolUtil.CreateEmptyCSharp(TempRoot.CreateDirectory().Path), 121var 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;