738 references to Path
InteractiveHost.UnitTests (4)
InteractiveHostCoreInitTests.cs (1)
75AssertEx.AssertEqualToleratingWhitespaceDifferences(PrintSearchPaths(srcDir.Path), output);
InteractiveHostDesktopInitTests.cs (1)
48AssertEx.AssertEqualToleratingWhitespaceDifferences(PrintSearchPaths(srcDir.Path), output);
InteractiveHostDesktopTests.cs (2)
704rspFile.WriteAllText($"/lib:{directory1.Path} /r:Assembly2.dll {initFile.Path}"); 718var expectedSearchPaths = PrintSearchPaths(fxDir, directory1.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 (3)
87currentDirectory.Path, 93return new DisposableFile(Path.Combine(directory.Path, resultFileName)); 782var 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);
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (346)
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 (317)
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); 1865var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/langversion:?" }); 2239var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/debug:embedded", "/sourcelink:sl.json", "a.cs" }); 2243var peStream = File.OpenRead(Path.Combine(dir.Path, "a.exe")); 2271var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/debug:portable", "/sourcelink:sl.json", "a.cs" }); 2275var pdbStream = File.OpenRead(Path.Combine(dir.Path, "a.pdb")); 2300var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/debug:full", "/sourcelink:sl.json", "a.cs" }); 2304var pdbStream = File.OpenRead(Path.Combine(dir.Path, "a.pdb")); 2443var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", debugSwitch, embedSwitch, "embed.cs", "embed2.cs" }); 2467using (var peReader = new PEReader(File.OpenRead(Path.Combine(dir.Path, "embed.exe")))) 2474MetadataReaderProvider.FromPortablePdbStream(File.OpenRead(Path.Combine(dir.Path, "embed.pdb")))) 2502symReader = SymReaderFactory.CreateReader(File.OpenRead(Path.Combine(dir.Path, "embed.pdb"))); 2774var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/a:missing.dll", "a.cs" }); 2797var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + typeof(object).Assembly.Location, "a.cs" }); 2914var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs" }); 2950var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs", "/ruleset:" + ruleSetFile.Path }); 2983var csc = CreateCSharpCompiler(null, dir.Path, 2994csc = CreateCSharpCompiler(null, dir.Path, 3030dir.Path); 3062dir.Path); 3095dir.Path); 3128dir.Path); 3162dir.Path); 3196dir.Path); 3230dir.Path); 3264dir.Path); 3299dir.Path); 3334dir.Path); 3358dir.Path); 3391dir.Path); 3424dir.Path); 3458dir.Path); 3502var csc = CreateCSharpCompiler(null, dir.Path, 3513csc = CreateCSharpCompiler(null, dir.Path, 3571var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "a.cs" }); 3581" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Goo' does not exist in the current context 3582" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Goo' does not exist in the current context 3599csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/fullpaths", "a.cs" }); 3604" + Path.Combine(dir.Path, @"a.cs") + @"(8,13): error CS0103: The name 'Goo' does not exist in the current context 3608" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Goo' does not exist in the current context 3609" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Goo' does not exist in the current context 3616" + Path.Combine(dir.Path, @"a.cs") + @"(32,13): error CS0103: The name 'Goo' does not exist in the current context 4480var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/modulename:hocusPocus ", "/out:" + exeName + " ", file1.Path }); 4488Assert.Equal(1, Directory.EnumerateFiles(dir.Path, exeName).Count()); 4490using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.Path, "aa.exe")))) 4667var parsedArgs = DefaultParse(new[] { @"/lib:lib1", @"/libpath:lib2", @"/libpaths:lib3", "a.cs" }, dir.Path, sdkDirectory: sdkDirectory); 4671lib1.Path, 4672lib2.Path, 4673lib3.Path 5988string tempDir = Temp.CreateDirectory().Path; 6024string tempDir = Temp.CreateDirectory().Path; 6057string tempDir = Temp.CreateDirectory().Path; 6091string tempDir = Temp.CreateDirectory().Path; 6103string tempDir = Temp.CreateDirectory().Path; 6941var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/target:exe", "a.cs" }); 6963var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/target:exe", "a.cs" }); 6987var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/target:library", "a.cs" }); 7010var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/preferreduilang:en", "a.cs" }); 7068var csc = CreateCSharpCompiler(null, dir.Path, commandLineArguments.Concat(new[] { inputName1, inputName2 }).ToArray()); 7076Assert.Equal(1, Directory.EnumerateFiles(dir.Path, "*" + PathUtilities.GetExtension(expectedOutputName)).Count()); 7077Assert.Equal(1, Directory.EnumerateFiles(dir.Path, expectedOutputName).Count()); 7079using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.Path, expectedOutputName)))) 7112var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/r:missing.dll", "a.cs" }); 7188var csc = CreateCSharpCompiler(null, dir.Path, commandLineArguments.Concat(new[] { fileName }).ToArray()); 7211var csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\a.exe" }); 7215Assert.Contains("error CS2012: Cannot open '" + dir.Path + "\\sub\\a.exe' for writing", outWriter.ToString(), StringComparison.Ordinal); 7237var csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\" }); 7265var csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\ " }); 7293var csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:aaa:\\a.exe" }); 7319var csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out: " }); 7353var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keyfile:key.snk", }); 7375var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keycontainer:bbb", }); 7397var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keyFile:key.snk", "/features:UseLegacyStrongNameProvider" }); 7417var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "a.cs", "/features:disable-length-based-switch" }); 7421cmd = CreateCSharpCompiler(null, dir.Path, new[] { "a.cs" }); 7512var output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $"/nologo /t:library \"{file}\"", startFolder: dir.Path); 7515output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $"/nologo /preferreduilang:en /t:library /codepage:20127 \"{file}\"", expectedRetCode: 1, startFolder: dir.Path); // 20127: US-ASCII 7793csc = CreateCSharpCompiler(null, dir.Path, new[] 7803csc = CreateCSharpCompiler(null, dir.Path, new[] 7817IntPtr lib = LoadLibraryEx(Path.Combine(dir.Path, outputFileName), IntPtr.Zero, 0x00000002); 8411csc = CreateCSharpCompiler(null, Temp.CreateDirectory().Path, new[] { source, "/preferreduilang:en" }); 8438csc = CreateCSharpCompiler(null, Temp.CreateDirectory().Path, new[] { source, "/preferreduilang:en", "/fullpaths" }); 8769int exitCode1 = CreateCSharpCompiler(null, dir.Path, new[] { "/debug:full", "/out:Program.exe", source1.Path }).Run(outWriter); 8775int exitCode2 = CreateCSharpCompiler(null, dir.Path, new[] { "/debug:full", "/out:Program.exe", source2.Path }).Run(outWriter); 8786int exitCode3 = CreateCSharpCompiler(null, dir.Path, new[] { "/debug:full", "/out:Program.exe", source3.Path }).Run(outWriter); 8831int exitCode = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/debug:full", libSrc.Path }).Run(outWriter); 8848AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)).Order()); 8905AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)).Order()); 8913Directory.Delete(dir.Path, recursive: false); 8938int exitCode = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/preferreduilang:en", libSrc.Path }).Run(outWriter); 8946AssertEx.Equal(new[] { "Lib.cs", "Lib.dll" }, Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)).Order()); 8957int exitCode = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/preferreduilang:en", libSrc.Path }).Run(outWriter); 8958Assert.Contains($"error CS2012: Cannot open '{libDll.Path}' for writing", outWriter.ToString()); 8979var srcPath = MakeTrivialExe(Temp.CreateDirectory().Path); 9001var srcPath = MakeTrivialExe(Temp.CreateDirectory().Path); 9024var srcPath = MakeTrivialExe(Temp.CreateDirectory().Path); 9048var srcPath = MakeTrivialExe(Temp.CreateDirectory().Path); 9282TestCS2002(commandLineArgs, tempDir.Path, 0, aWrnString); 9288TestCS2002(commandLineArgs, tempDir.Path, 0, warnings); 9294TestCS2002(commandLineArgs, tempDir.Path, 0, AWrnString); 9300TestCS2002(commandLineArgs, tempDir.Path, 0, String.Empty); 9306TestCS2002(commandLineArgs, tempParentDir.Path, 0, tmpDiraString); 9311TestCS2002(commandLineArgs, tempParentDir.Path, 0, tmpDiraString); 9316TestCS2002(commandLineArgs, tempParentDir.Path, 0, tmpDiraString); 9321TestCS2002(commandLineArgs, tempParentDir.Path, 0, tmpDiraString); 9325TestCS2002(commandLineArgs, tempParentDir.Path, 0, tmpDiraString); 9331var formattedcs1504Str = String.Format(cs1504, PathUtilities.CombineAbsoluteAndRelativePaths(tempParentDir.Path, "tmpDir\a.cs"), "Illegal characters in path."); 9332TestCS2002(commandLineArgs, tempParentDir.Path, 1, formattedcs1504Str); 9340TestCS2002(commandLineArgs, tempParentDir.Path, 1, (string[])null, parseDiags); 9347TestCS2002(commandLineArgs, tempParentDir.Path, 1, (string[])null, parseDiags); 9351var formattedcs1504 = String.Format(cs1504, PathUtilities.CombineAbsoluteAndRelativePaths(tempParentDir.Path, @":a.cs"), @"The given path's format is not supported."); 9352TestCS2002(commandLineArgs, tempParentDir.Path, 1, formattedcs1504); 9355System.IO.Directory.Delete(tempParentDir.Path, true); 9897args = DefaultParse(new[] { "/additionalfile:web*.config", "a.cs" }, baseDir.Path); 9900Assert.Equal(Path.Combine(baseDir.Path, "web1.config"), args.AdditionalFiles[0].Path); 9901Assert.Equal(Path.Combine(baseDir.Path, "web2.config"), args.AdditionalFiles[1].Path); 9902Assert.Equal(Path.Combine(baseDir.Path, "web3.config"), args.AdditionalFiles[2].Path); 10119Directory.Delete(dir.Path, true); 10178Directory.Delete(dir.Path, true); 10244Directory.Delete(dir.Path, true); 10351Directory.Delete(dir.Path, true); 10448Directory.Delete(dir.Path, true); 10485Directory.Delete(dir.Path, true); 10525Directory.Delete(dir.Path, true); 10577var csc = CreateCSharpCompiler(null, sourceDir.Path, args, analyzers: analyzers, generators: generators, driverCache: driverCache); 11615var csc = CreateCSharpCompiler(null, dir.Path, args); 11619var exePath = Path.Combine(dir.Path, "a.exe"); 11631var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11638var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11639AssertPdbEmit(dir, pdbPath, @"q:\a.pdb", $@"/pathmap:{dir.Path}=q:\"); 11645var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11646AssertPdbEmit(dir, pdbPath, @"q:\a.pdb", $@"/pathmap:{dir.Path}=q:\", "/deterministic"); 11653var pdbPath = Path.Combine(dir.Path, @"pdb\a.pdb"); 11654AssertPdbEmit(dir, pdbPath, @"q:\pdb\a.pdb", $@"/pathmap:{dir.Path}=q:\"); 11660var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11667var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11668AssertPdbEmit(dir, pdbPath, @"/a.pdb", $@"/pathmap:{dir.Path}=/"); 11674var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11675AssertPdbEmit(dir, pdbPath, "/goo/a.pdb", $"/pathmap:{dir.Path}=/goo,{dir.Path}{PathUtilities.DirectorySeparatorChar}=/bar"); 11740var output = ProcessUtilities.RunAndGetOutput(csc32exe.Path, $@"/nologo /debug:full /deterministic /out:Program.exe /pathmap:""{dir32.Path}""=X:\ ""{sourceFile.Path}""", expectedRetCode: 0, startFolder: dir32.Path); 11743output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $@"/nologo /debug:full /deterministic /out:Program.exe /pathmap:""{dir64.Path}""=X:\ ""{sourceFile.Path}""", expectedRetCode: 0, startFolder: dir64.Path); 11793var csc = CreateCSharpCompiler(null, dir.Path, 11799var exe = Path.Combine(dir.Path, "a.exe"); 11808var doc = Path.Combine(dir.Path, "doc.xml"); 11829var output = ProcessUtilities.RunAndGetOutput(exe, startFolder: dir.Path); 11832var refDll = Path.Combine(refDir.Path, "a.dll"); 11844CleanupAllGeneratedFiles(dir.Path); 11845CleanupAllGeneratedFiles(refDir.Path); 11858var csc = CreateCSharpCompiler(null, dir.Path, 11863var dll = Path.Combine(dir.Path, "a.dll"); 11866var refDll = Path.Combine(dir.Path, Path.Combine("ref", "a.dll")); 11872CleanupAllGeneratedFiles(dir.Path); 11909var csc = CreateCSharpCompiler(null, dir.Path, 11915var refDll = Path.Combine(dir.Path, "a.dll"); 11926var pdb = Path.Combine(dir.Path, "a.pdb"); 11929var doc = Path.Combine(dir.Path, "doc.xml"); 11957CleanupAllGeneratedFiles(dir.Path); 12018var result = ProcessUtilities.Run(cscPath, arguments: "/nologo /t:library unknown.cs", workingDirectory: dir.Path); 12026result = ProcessUtilities.Run(cscPath, arguments: "/nologo /t:library unknown.cs", workingDirectory: dir.Path); 12045var result = ProcessUtilities.Run(s_CSharpCompilerExecutable, arguments: $"/nologo /t:library /analyzer:{analyzerFileName} {srcFileName}", workingDirectory: analyzerDir.Path); 12247var cscCopy = Path.Combine(dir.Path, "csc.exe"); 12255workingDirectory: dir.Path, 12263result = ProcessUtilities.Run(cscCopy, arguments, workingDirectory: dir.Path); 12270workingDirectory: dir.Path, 12287var csc = CreateCSharpCompiler(null, dir.Path, args); 12291var exePath = Path.Combine(dir.Path, "a.exe"); 12309var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.Path, sdkDir: null, tempDir: tempDir.Path); 12324var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.Path, sdkDir: null, tempDir: tempDir.Path); 12344var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.Path, sdkDir: null, tempDir: tempDir.Path); 12365var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.Path, sdkDir: null, tempDir: tempDir.Path); 13416var cmd = CreateCSharpCompiler(null, dir.Path, arguments, 13478string binaryPath = Path.Combine(dir.Path, "temp.dll"); 13481string pdbPath = Path.Combine(dir.Path, pdbName); 13484string xmlDocFilePath = Path.Combine(dir.Path, docName); 13524string binaryPath = Path.Combine(dir.Path, "temp.dll"); 13527string pdbPath = Path.Combine(dir.Path, pdbName); 13530string xmlDocFilePath = Path.Combine(dir.Path, docName); 13574string binaryPath = Path.Combine(dir.Path, "temp.dll"); 13577string pdbPath = Path.Combine(dir.Path, pdbName); 13580string xmlDocFilePath = Path.Combine(dir.Path, docName); 13605string binaryPath = Path.Combine(dir.Path, "temp.dll"); 13661var cmd = CreateCSharpCompiler(null, dir.Path, arguments, 13752var cmd = CreateCSharpCompiler(null, dir.Path, args, analyzers: new[] { analyzer }); 13789var cmd = CreateCSharpCompiler(null, dir.Path, args, analyzers: new[] { analyzer }); 13922var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.Path, generator); 13923ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.Path, generatorPrefix, $"generatedSource.cs"), generatedSource } }, dir, true); 13927Directory.Delete(dir.Path, true); 13963var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.Path, generator); 13964ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.Path, generatorPrefix, "generatedSource.cs"), generatedSource } }, dir, true); 14002var generator1Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.Path, generator); 14003var generator2Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.Path, generator2); 14007{ Path.Combine(dir.Path, generator1Prefix, source1Name), source1}, 14008{ Path.Combine(dir.Path, generator2Prefix, source2Name), source2}, 14013Directory.Delete(dir.Path, true); 14023var genPath1 = Path.Combine(dir.Path, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint1.cs"); 14024var genPath2 = Path.Combine(dir.Path, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint2.cs"); 14043using (Stream peStream = File.OpenRead(Path.Combine(dir.Path, "checksum.exe")), pdbStream = File.OpenRead(Path.Combine(dir.Path, "checksum.pdb"))) 14056Directory.Delete(dir.Path, true); 14086VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null); 14088var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.Path, generator); 14091{ Path.Combine(generatedDir.Path, generatorPrefix, expectedDir), new() { { expectedFileName, generatedSource } } } 14096Directory.Delete(dir.Path, true); 14112VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator1 }, analyzers: null); 14114var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.Path, generator1); 14115ValidateWrittenSources(new() { { Path.Combine(generatedDir.Path, generatorPrefix), new() { { "generatedSource.cs", generatedSource1 } } } }); 14120VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator2 }, analyzers: null); 14122ValidateWrittenSources(new() { { Path.Combine(generatedDir.Path, generatorPrefix), new() { { "generatedSource.cs", generatedSource2 } } } }); 14126Directory.Delete(dir.Path, true); 14147VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator, generator2 }, analyzers: null); 14149var generator1Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.Path, generator); 14150var generator2Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.Path, generator2); 14160Directory.Delete(dir.Path, true); 14188VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null); 14190var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.Path, generator); 14193{ Path.Combine(generatedDir.Path, generatorPrefix, expectedDir), new() { { generatedFileName, generatedSource } } } 14198Directory.Delete(dir.Path, true); 14207var snk = Temp.CreateFile("TestKeyPair_", ".snk", dir.Path).WriteAllBytes(TestResources.General.snKey); 14209var virtualSnProvider = new DesktopStrongNameProvider(ImmutableArray.Create(dir.Path)); 14224var path = Path.Combine(dir.Path, Guid.NewGuid().ToString() + ".dll"); 14239VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/analyzer:" + gen1, "/analyzer:" + gen2 }.ToArray()); 14246{ Path.Combine(generatedDir.Path, "generator", "TestGenerator"), new() { { "generatedSource.cs", "//from version 2.0.0.0" } } } 14264ValidateWrittenSources(new() { { generatedDir.Path, new() } }); 14268Directory.Delete(dir.Path, true); 14280var generatedDirPath = Path.Combine(dir.Path, "noexist"); 14289Directory.Delete(dir.Path, true); 14305VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null); 14307var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.Path, generator); 14308ValidateWrittenSources(new() { { Path.Combine(generatedDir.Path, generatorPrefix), new() { { "generatedSource.cs", generatedSource } } } }); 14312Directory.Delete(dir.Path, true); 14381Directory.Delete(dir.Path, true); 14397VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, $"/touchedfiles:{dir.Path}/touched", "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null); 14399var touchedFiles = Directory.GetFiles(dir.Path, "touched*"); 14402string[] writtenText = File.ReadAllLines(Path.Combine(dir.Path, "touched.write")); 14409Directory.Delete(dir.Path, true); 14477Directory.Delete(dir.Path, true); 14536$"/out:{objDir.Path}/embed.exe", 14546Directory.Delete(dir.Path, true); 14602pathMapArgument = pathMapArgument.Replace("DIRPATH", dir.Path).Replace("SRCDIRPATH", srcDir.Path).Replace("OBJDIRPATH", objDir.Path); 14608"/generatedfilesout:" + objDir.Path, 14619var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(objDir.Path, generator); 14627Directory.Delete(dir.Path, true); 14715var cmd = CreateCSharpCompiler(null, dir.Path, args, generators: new[] { generator }); 14775var cmd = CreateCSharpCompiler(null, dir.Path, 14795var cmd = CreateCSharpCompiler(null, dir.Path, 14820var cmd = CreateCSharpCompiler(null, dir.Path, 14840var cmd = CreateCSharpCompiler(null, dir.Path, 14880Directory.Delete(dir.Path, true); 14946var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15027var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15241CleanupAllGeneratedFiles(srcDirectory.Path); 15397var generatorPath = Path.Combine(directory.Path, "generator.dll"); 15433Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.Path, additionalFilePath1))); 15434Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.Path, additionalFilePath2))); 15440string path2 = additionalFile2?.Path ?? Path.Combine(srcDirectory.Path, additionalFilePath2); 15457CleanupAllGeneratedFiles(srcDirectory.Path); 15552var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15563cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15604var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15615cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15686var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15697cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15739var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15750cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15817var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15856var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 15896var 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)
1145var analyzerConfigPath = PathUtilities.CombineAbsoluteAndRelativePaths(Temp.CreateDirectory().Path, ".editorconfig"); 1390var 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)
99var dir1 = TempRoot.CreateDirectory().Path; 101var dir2 = TempRoot.CreateDirectory().Path; 133var dir1 = TempRoot.CreateDirectory().Path; 135var dir2 = TempRoot.CreateDirectory().Path; 157var dir = TempRoot.CreateDirectory().Path;
Microsoft.CodeAnalysis.Features.UnitTests (2)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (2)
124AddDocument(CreateDesignTimeOnlyDocument(projectPId, name: "dt1.cs", path: Path.Combine(dir.Path, "dt1.cs"))). 397var designTimeOnlyFilePath = Path.Combine(dir.Path, designTimeOnlyFileName);
Microsoft.CodeAnalysis.LanguageServer.UnitTests (16)
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);
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 (18)
AnalyzerAssemblyLoaderTests.cs (1)
343var analyzerPath = Path.Combine(tempDir.CreateDirectory("a").Path, "analyzer.dll");
Analyzers\AnalyzerFileReferenceAppDomainTests.cs (4)
49var loadDomain = AppDomainUtils.Create("AnalyzerTestDomain", basePath: dir.Path); 54var exception = remoteTest.LoadAnalyzer(dir.CreateDirectory("shadow").Path, analyzerFile.Path); 107var loadDomain = AppDomainUtils.Create("AnalyzerTestDomain", basePath: dir.Path); 112var exception = remoteTest.LoadAnalyzer(dir.CreateDirectory("shadow").Path, analyzerFile.Path);
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");
FileSystem\RelativePathResolverTests.cs (2)
171ImmutableArray.Create(dir1.Path, dir2.Path),
InvokeUtil.cs (1)
145AnalyzerTestKind.ShadowLoad => [.. 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.VisualBasic.CommandLine.UnitTests (212)
CommandLineIVTTests.vb (5)
34dir.Path, 135dir.Path, 236dir.Path, 347dir.Path, 465dir.Path,
CommandLineTests.vb (199)
78Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, { 115Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, { 173Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, { 210Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, { 223$"vbc : error BC37317: Multiple analyzer config files cannot be in the same directory ('{dir.Path}').", 240Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/errorlog:errorlog", $"/doc:{docName}", "/warnaserror", src.Path}) 247Dim exePath = Path.Combine(dir.Path, "temp.exe") 259Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/t:library", "/preferreduilang:en", $"/doc:{docName}", src.Path}) 266Dim xmlPath = Path.Combine(dir.Path, docName) 315args = DefaultParse({"-debug+/debug:portable"}, folder.Path) 388Dim cmd = New MockVisualBasicCompiler(dir.Path, {"/nologo", "a.vb", "/keyfile:key.snk"}) 407Dim cmd = New MockVisualBasicCompiler(dir.Path, {"/nologo", "a.vb", "/keycontainer:aaa"}) 426Dim cmd = New MockVisualBasicCompiler(dir.Path, {"/nologo", "a.vb", "/features:UseLegacyStrongNameProvider"}) 649Dim tempDir As String = Temp.CreateDirectory().Path 689Dim tempDir As String = Temp.CreateDirectory().Path 741Dim tempDir As String = Temp.CreateDirectory().Path 2406Dim exitCode As Integer = New MockVisualBasicCompiler(Nothing, folder.Path, {"/nologo", "/preferreduilang:en", "/t:library", "/recurse:.", "b.vb", "/out:abc.dll"}).Run(outWriter, Nothing) 2411exitCode = New MockVisualBasicCompiler(Nothing, folder.Path, {"/nologo", "/preferreduilang:en", "/t:library", "/recurse:. ", "b.vb", "/out:abc.dll"}).Run(outWriter, Nothing) 2416exitCode = New MockVisualBasicCompiler(Nothing, folder.Path, {"/nologo", "/preferreduilang:en", "/t:library", "/recurse: . ", "/out:abc.dll"}).Run(outWriter, Nothing) 2421exitCode = New MockVisualBasicCompiler(Nothing, folder.Path, {"/nologo", "/preferreduilang:en", "/t:library", "/recurse:./.", "/out:abc.dll"}).Run(outWriter, Nothing) 2428args = DefaultParse({"/recurse:*.cp*", "/recurse:b\*.v*", "/out:a.dll"}, folder.Path) 2431AssertEx.Equal({folder.Path + "\c.cpp", folder.Path + "\b\B_e.vb"}, resolvedSourceFiles) 2433args = DefaultParse({"/recurse:.\\\\\\*.vb", "/out:a.dll"}, folder.Path) 2438args = DefaultParse({"/recurse:.////*.vb", "/out:a.dll"}, folder.Path) 2456Dim exitCode = New MockVisualBasicCompiler(Nothing, folder.Path, {"/nologo", "/preferreduilang:en", "/t:exe", "/out:abc.exe"}).Run(outWriter, Nothing) 2589Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/preferreduilang:en", "/t:library", "/a:missing.dll", "a.vb"}) 2606Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/preferreduilang:en", "/t:library", "/a:" + GetType(Object).Assembly.Location, "a.vb"}) 2624Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.vb"}) 2657Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.vb", "/ruleset:" + ruleSetFile.Path}) 2687Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, 2701vbc = New MockVisualBasicCompiler(Nothing, dir.Path, 2737Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, 2752vbc = New MockVisualBasicCompiler(Nothing, dir.Path, 2791Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.vb", "/ruleset:" + ruleSetFile.Path}) 3178Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/debug:embedded", "/sourcelink:sl.json", "a.vb"}) 3182Dim peStream = File.OpenRead(Path.Combine(dir.Path, "a.exe")) 3211Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/debug:portable", "/sourcelink:sl.json", "a.vb"}) 3215Dim pdbStream = File.OpenRead(Path.Combine(dir.Path, "a.pdb")) 3366Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", debugSwitch, embedSwitch, "embed.vb", "embed2.vb"}) 3385Using peReader As New PEReader(File.OpenRead(Path.Combine(dir.Path, "embed.exe"))) 3392MetadataReaderProvider.FromPortablePdbStream(File.OpenRead(Path.Combine(dir.Path, "embed.pdb")))) 3416symReader = SymReaderFactory.CreateReader(File.OpenRead(Path.Combine(dir.Path, "embed.pdb"))) 3560Dim sdkPath = sdkDir.Path 3562Dim parser = VisualBasicCommandLineParser.Default.Parse({$"-sdkPath:{sdkPath}"}, parentDir.Path, Nothing) 3570Dim parser = VisualBasicCommandLineParser.Default.Parse({"file.vb", "-sdkPath", $"-out:{parentDir.Path}"}, parentDir.Path, Nothing) 3581Dim parser = VisualBasicCommandLineParser.Default.Parse({"file.vb", $"-out:{parentDir.Path}", "-sdkPath:path/to/sdk", "/noSdkPath"}, parentDir.Path, Nothing) 3590Dim parser = VisualBasicCommandLineParser.Default.Parse({"file.vb", $"-out:{parentDir.Path}", "/noSdkPath", $"-sdkPath:{sdkDir.Path}"}, parentDir.Path, Nothing) 3591AssertEx.Equal(ImmutableArray.Create(sdkDir.Path), parser.ReferencePaths) 3607Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/preferreduilang:en", "/nosdkpath", "/t:library", "a.vb"}) 3632Dim pdbPath = Path.Combine(dir.Path, "a.pdb") 3638Dim vbc = New MockVisualBasicCompiler(dir.Path, args) 3642Dim exePath = Path.Combine(dir.Path, "a.exe") 3653Dim pePdbPath = Path.Combine(dir.Path, "a.pdb") 3660assertPdbEmit(dir, pePdbPath, {$"/pathmap:{dir.Path}=q:\"}) 3666assertPdbEmit(dir, pePdbPath, {$"/pathmap:{dir.Path}=q:\", "/deterministic"}) 3673assertPdbEmit(subDir, pePdbPath, {$"/pathmap:{dir.Path}=q:\"}) 3678Dim pePdbPath = Path.Combine(dir.Path, "a.pdb") 3684Dim pdbPath = Path.Combine(dir.Path, "a.pdb") 3685assertPdbEmit(dir, "/a.pdb", {$"/pathmap:{dir.Path}=/"}) 3690Dim pdbPath = Path.Combine(dir.Path, "a.pdb") 3691assertPdbEmit(dir, "/goo/a.pdb", {$"/pathmap:{dir.Path}=/goo,{dir.Path}{PathUtilities.DirectorySeparatorChar}=/bar"}) 5210Dim output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:l:\x /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.Path) 5216output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /r:mscorlib.dll /vbruntime- /sdkpath:c:folder /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.Path) 5222output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:" & dir.Path & " /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.Path) 5226</text>, output.Replace(dir.Path, "{SDKPATH}")) 5232output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:" & dir.Path & " /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.Path) 5236</text>, output.Replace(dir.Path, "{SDKPATH}")) 5241output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:" & dir.Path & " /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.Path) 5245</text>, output.Replace(dir.Path, "{SDKPATH}")) 5252output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /nostdlib /sdkpath:" & dir.Path & " /t:library /vbruntime* /r:" & Path.Combine(RuntimeEnvironment.GetRuntimeDirectory(), "System.dll") & " " & src.ToString(), startFolder:=dir.Path) 5253AssertOutput(<text></text>, output.Replace(dir.Path, "{SDKPATH}")) ' SUCCESSFUL BUILD with 'mscorlib.dll' and embedded VbCore 5258output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /nostdlib /sdkpath:" & dir.Path & " /t:library /vbruntime* /r:" & Path.Combine(RuntimeEnvironment.GetRuntimeDirectory(), "System.dll") & " " & src.ToString(), startFolder:=dir.Path) 5259AssertOutput(<text></text>, output.Replace(dir.Path, "{SDKPATH}")) 5283Dim sdkMultiPath = subFolder1.Path & "," & subFolder2.Path 5290output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, cmdNoStdLibNoRuntime, startFolder:=dir.Path, expectedRetCode:=1) 5291AssertOutput(<text>vbc : error BC2017: could not find library 'mscorlib.dll'</text>, output.Replace(dir.Path, "{SDKPATH}")) 5298output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, cmdNoStdLibNoRuntime, startFolder:=dir.Path) 5299AssertOutput(<text></text>, output.Replace(dir.Path, "{SDKPATH}")) 5301output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, cmd, startFolder:=dir.Path, expectedRetCode:=1) 5306</text>, output.Replace(dir.Path, "{SDKPATH}")) 5323Dim output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /t:library " & src.ToString(), startFolder:=dir.Path, expectedRetCode:=1) 5326output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /nostdlib /define:_MYTYPE=\""Empty\"" /t:library " & src.ToString(), startFolder:=dir.Path) 5329output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:x:\ /vbruntime- /define:_MYTYPE=\""Empty\"" /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.Path) 5754Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, commandLineArguments.Concat({inputName1, inputName2}).ToArray()) 5761Assert.Equal(1, Directory.EnumerateFiles(dir.Path, "*" & PathUtilities.GetExtension(expectedOutputName)).Count()) 5762Assert.Equal(1, Directory.EnumerateFiles(dir.Path, expectedOutputName).Count()) 5894Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, commandLineArguments.Concat({fileName}).ToArray()) 5946Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en"}) 5999Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en", "-imports:System"}) 6036Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en"}) 6086Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en"}) 6130Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en"}) 6178Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en"}) 6224Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en"}) 6266Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en"}) 6301Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/target:exe", "/preferreduilang:en", "/out:sub\a.exe"}) 6305Assert.Contains("error BC2012: can't open '" + dir.Path + "\sub\a.exe' for writing", output.ToString(), StringComparison.Ordinal) 6333Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en", "/target:exe", "/out:sub\"}) 6367Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en", "/target:exe", "/out:sub\ "}) 6401Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en", "/target:exe", "/out:aaa:\a.exe"}) 6433Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en", "/target:exe", "/out: "}) 6456Dim output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /t:library " & file.ToString(), startFolder:=dir.Path) 6459output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /t:library /codepage:20127 " & file.ToString(), expectedRetCode:=1, startFolder:=dir.Path) ' 20127: US-ASCII 6820vbc = New MockVisualBasicCompiler(Nothing, dir.Path, 6828vbc = New MockVisualBasicCompiler(Nothing, dir.Path, 6838Dim library As IntPtr = LoadLibraryEx(Path.Combine(dir.Path, outputFileName), IntPtr.Zero, 2) 7520Dim output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /t:library /langversion:9 /preferreduilang:en " & src.ToString(), expectedRetCode:=1, startFolder:=dir.Path) 7603Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/preferreduilang:en", "/t:library", "a.vb"}) 7621" & Path.GetFullPath(Path.Combine(dir.Path, "..\b.vb")) & "(40) : error BC30451: 'Goo' is not declared. It may be inaccessible due to its protection level. 7624" & Path.GetFullPath(Path.Combine(dir.Path, "..\b.vb")) & "(50) : error BC30451: 'Goo' is not declared. It may be inaccessible due to its protection level. 7790args = DefaultParse({"/additionalfile:web*.config", "a.vb"}, baseDir.Path) 7793Assert.Equal(Path.Combine(baseDir.Path, "web1.config"), args.AdditionalFiles(0).Path) 7794Assert.Equal(Path.Combine(baseDir.Path, "web2.config"), args.AdditionalFiles(1).Path) 7795Assert.Equal(Path.Combine(baseDir.Path, "web3.config"), args.AdditionalFiles(2).Path) 7936Dim vbc = New MockVisualBasicCompiler(Nothing, sourceDir.Path, args, analyzers, generators) 8703Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "A.vb"}, dir.Path) 8723Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "A.vb"}, dir.Path) 8744Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "A.vb"}, dir.Path) 8765Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+:Test001", "A.vb"}, dir.Path) 8786Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "/WarnAsError-", "A.vb"}, dir.Path) 8807Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "/WarnAsError-:Test001", "A.vb"}, dir.Path) 8828Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+:Test002", "/WarnAsError-:Test002", "A.vb"}, dir.Path) 8850Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/NoWarn", "/WarnAsError+", "A.vb"}, dir.Path) 8871Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "/NoWarn", "/WarnAsError-", "A.vb"}, dir.Path) 8894Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/NoWarn", "A.vb"}, dir.Path) 8917Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/NoWarn:Test001", "/WarnAsError+", "/WarnAsError-:Test001", "A.vb"}, dir.Path) 9141Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/target:exe", fileName}) 9346Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, 9352Dim exe = Path.Combine(dir.Path, "a.exe") 9361Dim doc = Path.Combine(dir.Path, "doc.xml") 9384Dim output = ProcessUtilities.RunAndGetOutput(exe, startFolder:=dir.Path) 9387Dim refDll = Path.Combine(refDir.Path, "a.dll") 9399CleanupAllGeneratedFiles(dir.Path) 9400CleanupAllGeneratedFiles(refDir.Path) 9417Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, 9423Dim vb = Path.Combine(dir.Path, "a.vb") 9425Dim dll = Path.Combine(dir.Path, "a.dll") 9428Dim refDll = Path.Combine(dir.Path, Path.Combine("ref", "a.dll")) 9439CleanupAllGeneratedFiles(dir.Path) 9464Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, 9470Dim refDll = Path.Combine(dir.Path, "a.dll") 9481Dim pdb = Path.Combine(dir.Path, "a.pdb") 9484Dim doc = Path.Combine(dir.Path, "doc.xml") 9514CleanupAllGeneratedFiles(dir.Path) 9557Assert.Equal(0, New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, targetArg, outArg}).Run(output, Nothing)) 9558Assert.True(File.Exists(Path.Combine(dir.Path, expectedFile)), "Expected to find: " & expectedFile) 9559Assert.False(File.Exists(Path.Combine(dir.Path, unexpectedFile)), "Didn't expect to find: " & unexpectedFile) 9566Dim srcPath = MakeTrivialExe(Temp.CreateDirectory().Path) 9585Dim srcPath = MakeTrivialExe(Temp.CreateDirectory().Path) 9605Dim srcPath = MakeTrivialExe(Temp.CreateDirectory().Path) 9626Dim srcPath = MakeTrivialExe(Temp.CreateDirectory().Path) 9671Dim result = ProcessUtilities.Run(vbcPath, arguments:="/nologo /t:library unknown.vb", workingDirectory:=dir.Path) 9679result = ProcessUtilities.Run(vbcPath, arguments:="/nologo /t:library unknown.vb", workingDirectory:=dir.Path) 9691Dim src = MakeTrivialExe(directory:=dir.Path) 9695Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, args) 9699Dim exePath = Path.Combine(dir.Path, "a.exe") 9716Dim vbc = New MockVisualBasicCompiler(Nothing, New BuildPaths("", workingDir.Path, Nothing, tempDir.Path), 10002Dim binaryPath As String = Path.Combine(dir.Path, "temp.dll") 10005Dim pdbPath As String = Path.Combine(dir.Path, "temp.pdb") 10008Dim docPath As String = Path.Combine(dir.Path, docName) 10054Dim binaryPath As String = Path.Combine(dir.Path, "temp.dll") 10057Dim pdbPath As String = Path.Combine(dir.Path, "temp.pdb") 10060Dim docPath As String = Path.Combine(dir.Path, docName) 10111Dim binaryPath As String = Path.Combine(dir.Path, "temp.dll") 10114Dim pdbPath As String = Path.Combine(dir.Path, "temp.pdb") 10117Dim docPath As String = Path.Combine(dir.Path, docName) 10148Dim binaryPath As String = Path.Combine(dir.Path, "temp.dll") 10175Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, args, analyzer) 10212Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, args, analyzer) 10420CleanupAllGeneratedFiles(srcDirectory.Path) 10559Dim generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(baseDirectory:=generatedDir.Path, generator) 10561{{generatedDir.Path, New Dictionary(Of String, String)()}} 10565Directory.Delete(dir.Path, True) 10575Dim generatedDirPath = Path.Combine(dir.Path, "noexist") 10587Directory.Delete(dir.Path, True) 10604VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference:=False, additionalFlags:={"/generatedfilesout:" + generatedDir.Path}, generators:={generator}) 10606Dim generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(baseDirectory:=generatedDir.Path, generator) 10608{{Path.Combine(generatedDir.Path, generatorPrefix), New Dictionary(Of String, String)() From 10614Directory.Delete(dir.Path, True) 10630Directory.Delete(dir.Path, True) 10705Directory.Delete(dir.Path, True) 10740Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, { 10783Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, { 10828Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, { 10876Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, { 10909Dim generatorPath = Path.Combine(directory.Path, "generator.dll")
SarifErrorLoggerTests.vb (5)
50Dim errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt") 85Dim errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt") 126Dim errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt") 164Dim errorLogFile = Path.Combine(outputDir.Path, "ErrorLog.txt") 165Dim outputFilePath = Path.Combine(outputDir.Path, "test.dll")
TouchedFileLoggingTests.vb (3)
36Dim touchedBase = Path.Combine(touchedDir.Path, "touched") 67Dim touchedBase = Path.Combine(touchedDir.Path, "touched") 109Dim touchedBase = Path.Combine(touchedDir.Path, "touched")
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (1)
Attributes\EmitTestStrongNameProvider.vb (1)
19Dim testFileSystem = New TestStrongNameFileSystem(Temp.CreateDirectory().Path) With {
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (6)
NetCoreTests.cs (4)
39["NUGET_PACKAGES"] = _nugetCacheDir.Path 46workingDirectory: SolutionDirectory.Path, 54var arguments = $@"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)
146var projectDirectory = SolutionDirectory.Path;
WorkspaceTestBase.cs (1)
35return Path.Combine(this.SolutionDirectory.Path, relativeFileName);
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
CommandLineProject\CommandLineProjectWorkspaceTests.cs (1)
28var info = CommandLineProject.CreateProjectInfo("TestProject", LanguageNames.CSharp, commandLine, tempDirectory.Path, ws);
WorkspaceTests\AdhocWorkspaceTests.cs (1)
283var analyzerConfigDocFilePath = PathUtilities.CombineAbsoluteAndRelativePaths(Temp.CreateDirectory().Path, ".editorconfig");
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (10)
PersistentStorage\AbstractPersistentStorageTests.cs (4)
876solution = solution.AddDocument(id, "file.cs", "class C { void M() }", filePath: Path.Combine(_persistentFolder.Path, "file.cs")); 896solution = solution.AddDocument(id, "file.cs", "class C { void M() }", filePath: Path.Combine(_persistentFolder.Path, "file.cs")); 1012var configuration = new MockPersistentStorageConfiguration(solution.Id, persistentFolder.Path, throwOnFailure); 1030var 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)
67Directory.Delete(dir.Path, recursive: true); 74var outputs = new CompilationOutputFilesWithImplicitPdbPath(Path.Combine(dir.Path, "nonexistent.dll")); 89var debugDirPdbPath = Path.Combine(dir.Path, "nonexistent.pdb"); 106Directory.Delete(dir.Path, recursive: true);
VBCSCompiler.UnitTests (45)
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 (20)
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;