639 references to Path
InteractiveHost.UnitTests (4)
InteractiveHostCoreInitTests.cs (1)
75AssertEx.AssertEqualToleratingWhitespaceDifferences(PrintSearchPaths(srcDir.Path), output);
InteractiveHostDesktopInitTests.cs (1)
50AssertEx.AssertEqualToleratingWhitespaceDifferences(PrintSearchPaths(srcDir.Path), output);
InteractiveHostDesktopTests.cs (2)
706rspFile.WriteAllText($"/lib:{directory1.Path} /r:Assembly2.dll {initFile.Path}"); 720var expectedSearchPaths = PrintSearchPaths(fxDir, directory1.Path);
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (16)
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"),
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 (301)
CommandLineTestBase.cs (2)
42File.WriteAllBytes(Path.Combine(dir.Path, "mscorlib.dll"), Net461.References.mscorlib.ImageBytes); 43return dir.Path;
CommandLineTests.cs (282)
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[] { 232var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 284var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 320var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 333$"error CS8700: Multiple analyzer config files cannot be in the same directory ('{dir.Path}').", 344var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", src.Path }); 353var result = ProcessUtilities.Run(Path.Combine(dir.Path, "sjis.exe"), arguments: "", workingDirectory: dir.Path); 355Assert.Equal("星野 八郎太", File.ReadAllText(Path.Combine(dir.Path, "output.txt"), Encoding.GetEncoding(932))); 364var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/codepage:932", src.Path }); 373var result = ProcessUtilities.Run(Path.Combine(dir.Path, "sjis.exe"), arguments: "", workingDirectory: dir.Path); 375Assert.Equal("星野 八郎太", File.ReadAllText(Path.Combine(dir.Path, "output.txt"), Encoding.GetEncoding(932))); 421string basePath = baseDir.Path; 434{ Path.Combine(dirSubDir.Path, @"b.rsp"), @" 509var parser = CSharpCommandLineParser.Default.Parse(new[] { "file.cs", $"-out:{parentDir.Path}", "/noSdkPath" }, parentDir.Path, null); 527var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/nosdkpath", "/r:System.dll", "a.cs" }); 566args = DefaultParse(new[] { "/main:Test", "a.cs" }, folder.Path); 570args = DefaultParse(new[] { "/main:\"Test\"", "a.cs" }, folder.Path); 574args = DefaultParse(new[] { "/main:\"Test.Class1\"", "a.cs" }, folder.Path); 578args = DefaultParse(new[] { "/m:Test", "a.cs" }, folder.Path); 582args = DefaultParse(new[] { "/m:\"Test\"", "a.cs" }, folder.Path); 586args = DefaultParse(new[] { "/m:\"Test.Class1\"", "a.cs" }, folder.Path); 591args = DefaultParse(new[] { "/m:\"решения.Class1\"", "a.cs" }, folder.Path); 603args = DefaultParse(new[] { "-debug+/debug:portable" }, folder.Path); 635int exitCode = CreateCSharpCompiler(null, folder.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", @"/recurse:.", "/out:abc.dll" }).Run(outWriter); 640exitCode = CreateCSharpCompiler(null, folder.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", @"/recurse:. ", "/out:abc.dll" }).Run(outWriter); 645exitCode = CreateCSharpCompiler(null, folder.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", @"/recurse: . ", "/out:abc.dll" }).Run(outWriter); 650exitCode = CreateCSharpCompiler(null, folder.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", @"/recurse:././.", "/out:abc.dll" }).Run(outWriter); 657args = DefaultParse(new[] { @"/recurse:*.cp*", @"/recurse:a\*.c*", @"/out:a.dll" }, folder.Path); 660AssertEx.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); 662args = DefaultParse(new[] { @"/recurse:.\\\\\\*.cs", @"/out:a.dll" }, folder.Path); 667args = DefaultParse(new[] { @"/recurse:.////*.cs", @"/out:a.dll" }, folder.Path); 1812var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/langversion:?" }); 2186var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/debug:embedded", "/sourcelink:sl.json", "a.cs" }); 2190var peStream = File.OpenRead(Path.Combine(dir.Path, "a.exe")); 2218var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/debug:portable", "/sourcelink:sl.json", "a.cs" }); 2222var pdbStream = File.OpenRead(Path.Combine(dir.Path, "a.pdb")); 2247var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/debug:full", "/sourcelink:sl.json", "a.cs" }); 2251var pdbStream = File.OpenRead(Path.Combine(dir.Path, "a.pdb")); 2390var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", debugSwitch, embedSwitch, "embed.cs", "embed2.cs" }); 2414using (var peReader = new PEReader(File.OpenRead(Path.Combine(dir.Path, "embed.exe")))) 2421MetadataReaderProvider.FromPortablePdbStream(File.OpenRead(Path.Combine(dir.Path, "embed.pdb")))) 2449symReader = SymReaderFactory.CreateReader(File.OpenRead(Path.Combine(dir.Path, "embed.pdb"))); 2668var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/a:missing.dll", "a.cs" }); 2691var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + typeof(object).Assembly.Location, "a.cs" }); 2808var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs" }); 2844var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs", "/ruleset:" + ruleSetFile.Path }); 2877var csc = CreateCSharpCompiler(null, dir.Path, 2888csc = CreateCSharpCompiler(null, dir.Path, 2924dir.Path); 2956dir.Path); 2989dir.Path); 3022dir.Path); 3056dir.Path); 3090dir.Path); 3124dir.Path); 3158dir.Path); 3193dir.Path); 3228dir.Path); 3252dir.Path); 3285dir.Path); 3318dir.Path); 3352dir.Path); 3396var csc = CreateCSharpCompiler(null, dir.Path, 3407csc = CreateCSharpCompiler(null, dir.Path, 3465var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "a.cs" }); 3475" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Goo' does not exist in the current context 3476" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Goo' does not exist in the current context 3493csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/fullpaths", "a.cs" }); 3498" + Path.Combine(dir.Path, @"a.cs") + @"(8,13): error CS0103: The name 'Goo' does not exist in the current context 3502" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Goo' does not exist in the current context 3503" + Path.GetFullPath(Path.Combine(dir.Path, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Goo' does not exist in the current context 3510" + Path.Combine(dir.Path, @"a.cs") + @"(32,13): error CS0103: The name 'Goo' does not exist in the current context 4299var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/modulename:hocusPocus ", "/out:" + exeName + " ", file1.Path }); 4307Assert.Equal(1, Directory.EnumerateFiles(dir.Path, exeName).Count()); 4309using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.Path, "aa.exe")))) 4486var parsedArgs = DefaultParse(new[] { @"/lib:lib1", @"/libpath:lib2", @"/libpaths:lib3", "a.cs" }, dir.Path, sdkDirectory: sdkDirectory); 4490lib1.Path, 4491lib2.Path, 4492lib3.Path 5778string tempDir = Temp.CreateDirectory().Path; 5814string tempDir = Temp.CreateDirectory().Path; 5847string tempDir = Temp.CreateDirectory().Path; 5881string tempDir = Temp.CreateDirectory().Path; 5893string tempDir = Temp.CreateDirectory().Path; 6731var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/target:exe", "a.cs" }); 6753var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/target:exe", "a.cs" }); 6777var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/target:library", "a.cs" }); 6800var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/preferreduilang:en", "a.cs" }); 6858var csc = CreateCSharpCompiler(null, dir.Path, commandLineArguments.Concat(new[] { inputName1, inputName2 }).ToArray()); 6866Assert.Equal(1, Directory.EnumerateFiles(dir.Path, "*" + PathUtilities.GetExtension(expectedOutputName)).Count()); 6867Assert.Equal(1, Directory.EnumerateFiles(dir.Path, expectedOutputName).Count()); 6869using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.Path, expectedOutputName)))) 6902var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/r:missing.dll", "a.cs" }); 6978var csc = CreateCSharpCompiler(null, dir.Path, commandLineArguments.Concat(new[] { fileName }).ToArray()); 7001var csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\a.exe" }); 7005Assert.Contains("error CS2012: Cannot open '" + dir.Path + "\\sub\\a.exe' for writing", outWriter.ToString(), StringComparison.Ordinal); 7027var csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\" }); 7055var csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\ " }); 7083var csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:aaa:\\a.exe" }); 7109var csc = CreateCSharpCompiler(null, dir.Path, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out: " }); 7143var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keyfile:key.snk", }); 7165var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keycontainer:bbb", }); 7187var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "a.cs", "/keyFile:key.snk", "/features:UseLegacyStrongNameProvider" }); 7207var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "a.cs", "/features:disable-length-based-switch" }); 7211cmd = CreateCSharpCompiler(null, dir.Path, new[] { "a.cs" }); 7302var output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $"/nologo /t:library \"{file}\"", startFolder: dir.Path); 7305output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $"/nologo /preferreduilang:en /t:library /codepage:20127 \"{file}\"", expectedRetCode: 1, startFolder: dir.Path); // 20127: US-ASCII 7583csc = CreateCSharpCompiler(null, dir.Path, new[] 7593csc = CreateCSharpCompiler(null, dir.Path, new[] 7607IntPtr lib = LoadLibraryEx(Path.Combine(dir.Path, outputFileName), IntPtr.Zero, 0x00000002); 8201csc = CreateCSharpCompiler(null, Temp.CreateDirectory().Path, new[] { source, "/preferreduilang:en" }); 8228csc = CreateCSharpCompiler(null, Temp.CreateDirectory().Path, new[] { source, "/preferreduilang:en", "/fullpaths" }); 8559int exitCode1 = CreateCSharpCompiler(null, dir.Path, new[] { "/debug:full", "/out:Program.exe", source1.Path }).Run(outWriter); 8565int exitCode2 = CreateCSharpCompiler(null, dir.Path, new[] { "/debug:full", "/out:Program.exe", source2.Path }).Run(outWriter); 8576int exitCode3 = CreateCSharpCompiler(null, dir.Path, new[] { "/debug:full", "/out:Program.exe", source3.Path }).Run(outWriter); 8621int exitCode = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/debug:full", libSrc.Path }).Run(outWriter); 8638AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Roslyn.Utilities.EnumerableExtensions.Order(Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)))); 8695AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Roslyn.Utilities.EnumerableExtensions.Order(Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)))); 8703Directory.Delete(dir.Path, recursive: false); 8728int exitCode = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/preferreduilang:en", libSrc.Path }).Run(outWriter); 8736AssertEx.Equal(new[] { "Lib.cs", "Lib.dll" }, Roslyn.Utilities.EnumerableExtensions.Order(Directory.GetFiles(dir.Path).Select(p => Path.GetFileName(p)))); 8747int exitCode = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/preferreduilang:en", libSrc.Path }).Run(outWriter); 8748Assert.Contains($"error CS2012: Cannot open '{libDll.Path}' for writing", outWriter.ToString()); 8769var srcPath = MakeTrivialExe(Temp.CreateDirectory().Path); 8791var srcPath = MakeTrivialExe(Temp.CreateDirectory().Path); 8814var srcPath = MakeTrivialExe(Temp.CreateDirectory().Path); 8838var srcPath = MakeTrivialExe(Temp.CreateDirectory().Path); 9072TestCS2002(commandLineArgs, tempDir.Path, 0, aWrnString); 9078TestCS2002(commandLineArgs, tempDir.Path, 0, warnings); 9084TestCS2002(commandLineArgs, tempDir.Path, 0, AWrnString); 9090TestCS2002(commandLineArgs, tempDir.Path, 0, String.Empty); 9096TestCS2002(commandLineArgs, tempParentDir.Path, 0, tmpDiraString); 9101TestCS2002(commandLineArgs, tempParentDir.Path, 0, tmpDiraString); 9106TestCS2002(commandLineArgs, tempParentDir.Path, 0, tmpDiraString); 9111TestCS2002(commandLineArgs, tempParentDir.Path, 0, tmpDiraString); 9115TestCS2002(commandLineArgs, tempParentDir.Path, 0, tmpDiraString); 9121var formattedcs1504Str = String.Format(cs1504, PathUtilities.CombineAbsoluteAndRelativePaths(tempParentDir.Path, "tmpDir\a.cs"), "Illegal characters in path."); 9122TestCS2002(commandLineArgs, tempParentDir.Path, 1, formattedcs1504Str); 9130TestCS2002(commandLineArgs, tempParentDir.Path, 1, (string[])null, parseDiags); 9137TestCS2002(commandLineArgs, tempParentDir.Path, 1, (string[])null, parseDiags); 9141var formattedcs1504 = String.Format(cs1504, PathUtilities.CombineAbsoluteAndRelativePaths(tempParentDir.Path, @":a.cs"), @"The given path's format is not supported."); 9142TestCS2002(commandLineArgs, tempParentDir.Path, 1, formattedcs1504); 9145System.IO.Directory.Delete(tempParentDir.Path, true); 9686args = DefaultParse(new[] { "/additionalfile:web*.config", "a.cs" }, baseDir.Path); 9689Assert.Equal(Path.Combine(baseDir.Path, "web1.config"), args.AdditionalFiles[0].Path); 9690Assert.Equal(Path.Combine(baseDir.Path, "web2.config"), args.AdditionalFiles[1].Path); 9691Assert.Equal(Path.Combine(baseDir.Path, "web3.config"), args.AdditionalFiles[2].Path); 9907Directory.Delete(dir.Path, true); 9965Directory.Delete(dir.Path, true); 10030Directory.Delete(dir.Path, true); 10135Directory.Delete(dir.Path, true); 10231Directory.Delete(dir.Path, true); 10267Directory.Delete(dir.Path, true); 10321var csc = CreateCSharpCompiler(null, sourceDir.Path, args, analyzers: analyzers, generators: generators, driverCache: driverCache); 11359var csc = CreateCSharpCompiler(null, dir.Path, args); 11363var exePath = Path.Combine(dir.Path, "a.exe"); 11375var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11382var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11383AssertPdbEmit(dir, pdbPath, @"q:\a.pdb", $@"/pathmap:{dir.Path}=q:\"); 11389var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11390AssertPdbEmit(dir, pdbPath, @"q:\a.pdb", $@"/pathmap:{dir.Path}=q:\", "/deterministic"); 11397var pdbPath = Path.Combine(dir.Path, @"pdb\a.pdb"); 11398AssertPdbEmit(dir, pdbPath, @"q:\pdb\a.pdb", $@"/pathmap:{dir.Path}=q:\"); 11404var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11411var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11412AssertPdbEmit(dir, pdbPath, @"/a.pdb", $@"/pathmap:{dir.Path}=/"); 11418var pdbPath = Path.Combine(dir.Path, "a.pdb"); 11419AssertPdbEmit(dir, pdbPath, "/goo/a.pdb", $"/pathmap:{dir.Path}=/goo,{dir.Path}{PathUtilities.DirectorySeparatorChar}=/bar"); 11484var output = ProcessUtilities.RunAndGetOutput(csc32exe.Path, $@"/nologo /debug:full /deterministic /out:Program.exe /pathmap:""{dir32.Path}""=X:\ ""{sourceFile.Path}""", expectedRetCode: 0, startFolder: dir32.Path); 11487output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $@"/nologo /debug:full /deterministic /out:Program.exe /pathmap:""{dir64.Path}""=X:\ ""{sourceFile.Path}""", expectedRetCode: 0, startFolder: dir64.Path); 11537var csc = CreateCSharpCompiler(null, dir.Path, 11543var exe = Path.Combine(dir.Path, "a.exe"); 11552var doc = Path.Combine(dir.Path, "doc.xml"); 11573var output = ProcessUtilities.RunAndGetOutput(exe, startFolder: dir.Path); 11576var refDll = Path.Combine(refDir.Path, "a.dll"); 11588CleanupAllGeneratedFiles(dir.Path); 11589CleanupAllGeneratedFiles(refDir.Path); 11602var csc = CreateCSharpCompiler(null, dir.Path, 11607var dll = Path.Combine(dir.Path, "a.dll"); 11610var refDll = Path.Combine(dir.Path, Path.Combine("ref", "a.dll")); 11616CleanupAllGeneratedFiles(dir.Path); 11653var csc = CreateCSharpCompiler(null, dir.Path, 11659var refDll = Path.Combine(dir.Path, "a.dll"); 11670var pdb = Path.Combine(dir.Path, "a.pdb"); 11673var doc = Path.Combine(dir.Path, "doc.xml"); 11701CleanupAllGeneratedFiles(dir.Path); 11762var result = ProcessUtilities.Run(cscPath, arguments: "/nologo /t:library unknown.cs", workingDirectory: dir.Path); 11770result = ProcessUtilities.Run(cscPath, arguments: "/nologo /t:library unknown.cs", workingDirectory: dir.Path); 11789var result = ProcessUtilities.Run(s_CSharpCompilerExecutable, arguments: $"/nologo /t:library /analyzer:{analyzerFileName} {srcFileName}", workingDirectory: analyzerDir.Path); 11990var cscCopy = Path.Combine(dir.Path, "csc.exe"); 11998workingDirectory: dir.Path, 12006result = ProcessUtilities.Run(cscCopy, arguments, workingDirectory: dir.Path); 12013workingDirectory: dir.Path, 12030var csc = CreateCSharpCompiler(null, dir.Path, args); 12034var exePath = Path.Combine(dir.Path, "a.exe"); 12052var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.Path, sdkDir: null, tempDir: tempDir.Path); 12781var cmd = CreateCSharpCompiler(null, dir.Path, arguments, 12843string binaryPath = Path.Combine(dir.Path, "temp.dll"); 12846string pdbPath = Path.Combine(dir.Path, pdbName); 12849string xmlDocFilePath = Path.Combine(dir.Path, docName); 12889string binaryPath = Path.Combine(dir.Path, "temp.dll"); 12892string pdbPath = Path.Combine(dir.Path, pdbName); 12895string xmlDocFilePath = Path.Combine(dir.Path, docName); 12939string binaryPath = Path.Combine(dir.Path, "temp.dll"); 12942string pdbPath = Path.Combine(dir.Path, pdbName); 12945string xmlDocFilePath = Path.Combine(dir.Path, docName); 12970string binaryPath = Path.Combine(dir.Path, "temp.dll"); 13022var cmd = CreateCSharpCompiler(null, dir.Path, arguments, 13112var cmd = CreateCSharpCompiler(null, dir.Path, args, analyzers: new[] { analyzer }); 13148var cmd = CreateCSharpCompiler(null, dir.Path, args, analyzers: new[] { analyzer }); 13245ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.Path, generatorPrefix, $"generatedSource.cs"), generatedSource } }, dir, true); 13249Directory.Delete(dir.Path, true); 13286ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.Path, generatorPrefix, "generatedSource.cs"), generatedSource } }, dir, true); 13329{ Path.Combine(dir.Path, generator1Prefix, source1Name), source1}, 13330{ Path.Combine(dir.Path, generator2Prefix, source2Name), source2}, 13335Directory.Delete(dir.Path, true); 13345var genPath1 = Path.Combine(dir.Path, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint1.cs"); 13346var genPath2 = Path.Combine(dir.Path, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint2.cs"); 13365using (Stream peStream = File.OpenRead(Path.Combine(dir.Path, "checksum.exe")), pdbStream = File.OpenRead(Path.Combine(dir.Path, "checksum.pdb"))) 13378Directory.Delete(dir.Path, true); 13408VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null); 13413{ Path.Combine(generatedDir.Path, generatorPrefix, expectedDir), new() { { expectedFileName, generatedSource } } } 13418Directory.Delete(dir.Path, true); 13434VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator1 }, analyzers: null); 13437ValidateWrittenSources(new() { { Path.Combine(generatedDir.Path, generatorPrefix), new() { { "generatedSource.cs", generatedSource1 } } } }); 13442VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator2 }, analyzers: null); 13444ValidateWrittenSources(new() { { Path.Combine(generatedDir.Path, generatorPrefix), new() { { "generatedSource.cs", generatedSource2 } } } }); 13448Directory.Delete(dir.Path, true); 13469VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator, generator2 }, analyzers: null); 13476{ Path.Combine(generatedDir.Path, generator1Prefix), new() { { source1Name, source1 } } }, 13477{ Path.Combine(generatedDir.Path, generator2Prefix), new() { { source2Name, source2 } } } 13482Directory.Delete(dir.Path, true); 13510VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null); 13515{ Path.Combine(generatedDir.Path, generatorPrefix, expectedDir), new() { { generatedFileName, generatedSource } } } 13520Directory.Delete(dir.Path, true); 13529var snk = Temp.CreateFile("TestKeyPair_", ".snk", dir.Path).WriteAllBytes(TestResources.General.snKey); 13531var virtualSnProvider = new DesktopStrongNameProvider(ImmutableArray.Create(dir.Path)); 13546var path = Path.Combine(dir.Path, Guid.NewGuid().ToString() + ".dll"); 13561VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/analyzer:" + gen1, "/analyzer:" + gen2 }.ToArray()); 13568{ Path.Combine(generatedDir.Path, "generator", "TestGenerator"), new() { { "generatedSource.cs", "//from version 2.0.0.0" } } } 13586ValidateWrittenSources(new() { { generatedDir.Path, new() } }); 13590Directory.Delete(dir.Path, true); 13602var generatedDirPath = Path.Combine(dir.Path, "noexist"); 13611Directory.Delete(dir.Path, true); 13627VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null); 13630ValidateWrittenSources(new() { { Path.Combine(generatedDir.Path, generatorPrefix), new() { { "generatedSource.cs", generatedSource } } } }); 13634Directory.Delete(dir.Path, true); 13703Directory.Delete(dir.Path, true); 13719VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.Path, $"/touchedfiles:{dir.Path}/touched", "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null); 13721var touchedFiles = Directory.GetFiles(dir.Path, "touched*"); 13724string[] writtenText = File.ReadAllLines(Path.Combine(dir.Path, "touched.write")); 13731Directory.Delete(dir.Path, true); 13819var cmd = CreateCSharpCompiler(null, dir.Path, args, generators: new[] { generator }); 13879var cmd = CreateCSharpCompiler(null, dir.Path, 13899var cmd = CreateCSharpCompiler(null, dir.Path, 13924var cmd = CreateCSharpCompiler(null, dir.Path, 13944var cmd = CreateCSharpCompiler(null, dir.Path, 13984Directory.Delete(dir.Path, true); 14050var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 14131var cmd = CreateCSharpCompiler(null, dir.Path, new[] { 14345CleanupAllGeneratedFiles(srcDirectory.Path); 14501var generatorPath = Path.Combine(directory.Path, "generator.dll"); 14537Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.Path, additionalFilePath1))); 14538Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.Path, additionalFilePath2))); 14544string path2 = additionalFile2?.Path ?? Path.Combine(srcDirectory.Path, additionalFilePath2); 14561CleanupAllGeneratedFiles(srcDirectory.Path);
SarifErrorLoggerTests.cs (9)
42var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 73var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 107var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 139var errorLogFile = Path.Combine(outputDir.Path, "ErrorLog.txt"); 140var outputFilePath = Path.Combine(outputDir.Path, "test.dll"); 176var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 211var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 246var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 281var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt");
SarifV2ErrorLoggerTests.cs (3)
383var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 457var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt"); 519var errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt");
TouchedFileLoggingTests.cs (5)
41var touchedBase = Path.Combine(touchedDir.Path, "touched"); 69var touchedBase = Path.Combine(touchedDir.Path, "touched"); 116var touchedBase = Path.Combine(touchedDir.Path, "touched"); 155var touchedBase = Path.Combine(touchedDir.Path, "touched"); 162"/touchedfiles:" + touchedDir.Path + "\\touched",
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (2)
Workspaces\WorkspaceTests_EditorFeatures.cs (2)
1071var analyzerConfigPath = PathUtilities.CombineAbsoluteAndRelativePaths(Temp.CreateDirectory().Path, ".editorconfig"); 1308var analyzerConfigDocFilePath = PathUtilities.CombineAbsoluteAndRelativePaths(Temp.CreateDirectory().Path, ".editorconfig");
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (5)
Emit\CompilationEmitTests.cs (2)
4629var dllPath = Path.Combine(tmpDir.Path, "assemblyname.dll"); 4630var pdbPath = Path.Combine(tmpDir.Path, "assemblyname.pdb");
Emit\DesktopStrongNameProviderTests.cs (3)
23var provider = new DesktopStrongNameProvider(tempPath: tempDir.Path); 24Assert.Equal(tempDir.Path, provider.FileSystem.GetTempPath()); 43var provider = new DesktopStrongNameProvider(ImmutableArray<string>.Empty, new VirtualizedStrongNameFileSystem(tempDir.Path));
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (4)
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)));
Microsoft.CodeAnalysis.CSharp.ExpressionEvaluator.ExpressionCompiler.UnitTests (1)
ReferencedModulesTests.cs (1)
1403var pdbPath = Temp.CreateDirectory().Path;
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (8)
CsiTests.cs (8)
36var result = ProcessUtilities.Run(CsiPath, "/r:C.dll a.csx", workingDirectory: dir.Path); 37AssertEx.AssertEqualToleratingWhitespaceDifferences(dir.Path + ";C", result.Output); 51Directory.SetCurrentDirectory(@""{dir.Path}"") 94var result = ProcessUtilities.Run(CsiPath, "/r:C.dll a.csx", workingDirectory: cwd.Path, additionalEnvironmentVars: new[] { KeyValuePairUtil.Create("LIB", dir.Path) }); 110var result = ProcessUtilities.Run(CsiPath, "/r:System.Data.dll /u:System.Data;System a.csx", workingDirectory: cwd.Path); 135var result = ProcessUtilities.Run(CsiPath, "a.csx", workingDirectory: cwd.Path); 151var result = ProcessUtilities.Run(CsiPath, "a.csx", workingDirectory: cwd.Path);
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (15)
CommandLineRunnerTests.cs (14)
456workingDirectory: dir.Path); 559var scriptPath = PathUtilities.CombinePathsUnchecked(PathUtilities.GetFileName(directory.Path), scriptName); 560var workingDirectory = PathUtilities.GetDirectoryName(directory.Path); 614var runner = CreateRunner(new[] { $"/loadpath:{dir1.Path}", $"/loadpaths:{dir2.Path};{dir3.Path}", main.Path }); 651var runner = CreateRunner(new[] { "/r:4.dll", $"/lib:{dir1.Path}", $"/libpath:{dir2.Path}", $"/libpaths:{dir3.Path};{dir4.Path}", main.Path }); 672SourcePaths.Add(@""{dir.Path}"") 687> SourcePaths.Add(@""{dir.Path}"") 708ReferencePaths.Add(@""{dir.Path}"") 723> ReferencePaths.Add(@""{dir.Path}"")
InteractiveSessionReferencesTests.cs (1)
144File.Move(libBFile.Path, Path.Combine(dir.Path, "libB.dll"));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
DocumentationComments\DocumentationCommentCompilerTests.cs (2)
2969var resolver = new XmlFileResolver(rootDir.Path); 6910var path = dir.Path;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (4)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (2)
568AddDocument(CreateDesignTimeOnlyDocument(projectPId, name: "dt1.cs", path: Path.Combine(dir.Path, "dt1.cs"))). 798var designTimeOnlyFilePath = Path.Combine(dir.Path, designTimeOnlyFileName);
Emit\CompilationOutputFilesTests.cs (1)
57Directory.Delete(dir.Path, recursive: true);
SolutionCrawler\WorkCoordinatorTests.cs (1)
778var analyzerConfigDocFilePath = PathUtilities.CombineAbsoluteAndRelativePaths(Temp.CreateDirectory().Path, ".editorconfig");
Microsoft.CodeAnalysis.Scripting.UnitTests (4)
RuntimeMetadataReferenceResolverTests.cs (4)
31new RelativePathResolver(ImmutableArray.Create(directory.Path), directory.Path), 51searchPaths: ImmutableArray.Create(directory.Path), 52baseDirectory: 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 (8)
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)
50? new ShadowCopyAnalyzerAssemblyLoader(compilerContext, tempRoot.CreateDirectory().Path)
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (200)
CommandLineTests.vb (192)
76Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, { 113Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, { 171Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, { 208Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, { 221$"vbc : error BC37317: Multiple analyzer config files cannot be in the same directory ('{dir.Path}').", 238Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/errorlog:errorlog", $"/doc:{docName}", "/warnaserror", src.Path}) 245Dim exePath = Path.Combine(dir.Path, "temp.exe") 257Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/t:library", "/preferreduilang:en", $"/doc:{docName}", src.Path}) 264Dim xmlPath = Path.Combine(dir.Path, docName) 313args = DefaultParse({"-debug+/debug:portable"}, folder.Path) 386Dim cmd = New MockVisualBasicCompiler(dir.Path, {"/nologo", "a.vb", "/keyfile:key.snk"}) 405Dim cmd = New MockVisualBasicCompiler(dir.Path, {"/nologo", "a.vb", "/keycontainer:aaa"}) 424Dim cmd = New MockVisualBasicCompiler(dir.Path, {"/nologo", "a.vb", "/features:UseLegacyStrongNameProvider"}) 647Dim tempDir As String = Temp.CreateDirectory().Path 687Dim tempDir As String = Temp.CreateDirectory().Path 739Dim tempDir As String = Temp.CreateDirectory().Path 2413Dim exitCode As Integer = New MockVisualBasicCompiler(Nothing, folder.Path, {"/nologo", "/preferreduilang:en", "/t:library", "/recurse:.", "b.vb", "/out:abc.dll"}).Run(outWriter, Nothing) 2418exitCode = New MockVisualBasicCompiler(Nothing, folder.Path, {"/nologo", "/preferreduilang:en", "/t:library", "/recurse:. ", "b.vb", "/out:abc.dll"}).Run(outWriter, Nothing) 2423exitCode = New MockVisualBasicCompiler(Nothing, folder.Path, {"/nologo", "/preferreduilang:en", "/t:library", "/recurse: . ", "/out:abc.dll"}).Run(outWriter, Nothing) 2428exitCode = New MockVisualBasicCompiler(Nothing, folder.Path, {"/nologo", "/preferreduilang:en", "/t:library", "/recurse:./.", "/out:abc.dll"}).Run(outWriter, Nothing) 2435args = DefaultParse({"/recurse:*.cp*", "/recurse:b\*.v*", "/out:a.dll"}, folder.Path) 2438AssertEx.Equal({folder.Path + "\c.cpp", folder.Path + "\b\B_e.vb"}, resolvedSourceFiles) 2440args = DefaultParse({"/recurse:.\\\\\\*.vb", "/out:a.dll"}, folder.Path) 2445args = DefaultParse({"/recurse:.////*.vb", "/out:a.dll"}, folder.Path) 2463Dim exitCode = New MockVisualBasicCompiler(Nothing, folder.Path, {"/nologo", "/preferreduilang:en", "/t:exe", "/out:abc.exe"}).Run(outWriter, Nothing) 2596Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/preferreduilang:en", "/t:library", "/a:missing.dll", "a.vb"}) 2613Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/preferreduilang:en", "/t:library", "/a:" + GetType(Object).Assembly.Location, "a.vb"}) 2631Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.vb"}) 2664Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.vb", "/ruleset:" + ruleSetFile.Path}) 2694Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, 2708vbc = New MockVisualBasicCompiler(Nothing, dir.Path, 2744Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, 2759vbc = New MockVisualBasicCompiler(Nothing, dir.Path, 2798Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.vb", "/ruleset:" + ruleSetFile.Path}) 3185Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/debug:embedded", "/sourcelink:sl.json", "a.vb"}) 3189Dim peStream = File.OpenRead(Path.Combine(dir.Path, "a.exe")) 3218Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/debug:portable", "/sourcelink:sl.json", "a.vb"}) 3222Dim pdbStream = File.OpenRead(Path.Combine(dir.Path, "a.pdb")) 3373Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", debugSwitch, embedSwitch, "embed.vb", "embed2.vb"}) 3392Using peReader As New PEReader(File.OpenRead(Path.Combine(dir.Path, "embed.exe"))) 3399MetadataReaderProvider.FromPortablePdbStream(File.OpenRead(Path.Combine(dir.Path, "embed.pdb")))) 3423symReader = SymReaderFactory.CreateReader(File.OpenRead(Path.Combine(dir.Path, "embed.pdb"))) 3567Dim sdkPath = sdkDir.Path 3569Dim parser = VisualBasicCommandLineParser.Default.Parse({$"-sdkPath:{sdkPath}"}, parentDir.Path, Nothing) 3577Dim parser = VisualBasicCommandLineParser.Default.Parse({"file.vb", "-sdkPath", $"-out:{parentDir.Path}"}, parentDir.Path, Nothing) 3588Dim parser = VisualBasicCommandLineParser.Default.Parse({"file.vb", $"-out:{parentDir.Path}", "-sdkPath:path/to/sdk", "/noSdkPath"}, parentDir.Path, Nothing) 3597Dim parser = VisualBasicCommandLineParser.Default.Parse({"file.vb", $"-out:{parentDir.Path}", "/noSdkPath", $"-sdkPath:{sdkDir.Path}"}, parentDir.Path, Nothing) 3598AssertEx.Equal(ImmutableArray.Create(sdkDir.Path), parser.ReferencePaths) 3614Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/preferreduilang:en", "/nosdkpath", "/t:library", "a.vb"}) 3639Dim pdbPath = Path.Combine(dir.Path, "a.pdb") 3645Dim vbc = New MockVisualBasicCompiler(dir.Path, args) 3649Dim exePath = Path.Combine(dir.Path, "a.exe") 3660Dim pePdbPath = Path.Combine(dir.Path, "a.pdb") 3667assertPdbEmit(dir, pePdbPath, {$"/pathmap:{dir.Path}=q:\"}) 3673assertPdbEmit(dir, pePdbPath, {$"/pathmap:{dir.Path}=q:\", "/deterministic"}) 3680assertPdbEmit(subDir, pePdbPath, {$"/pathmap:{dir.Path}=q:\"}) 3685Dim pePdbPath = Path.Combine(dir.Path, "a.pdb") 3691Dim pdbPath = Path.Combine(dir.Path, "a.pdb") 3692assertPdbEmit(dir, "/a.pdb", {$"/pathmap:{dir.Path}=/"}) 3697Dim pdbPath = Path.Combine(dir.Path, "a.pdb") 3698assertPdbEmit(dir, "/goo/a.pdb", {$"/pathmap:{dir.Path}=/goo,{dir.Path}{PathUtilities.DirectorySeparatorChar}=/bar"}) 5189Dim output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:l:\x /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.Path) 5195output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /r:mscorlib.dll /vbruntime- /sdkpath:c:folder /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.Path) 5201output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:" & dir.Path & " /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.Path) 5205</text>, output.Replace(dir.Path, "{SDKPATH}")) 5211output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:" & dir.Path & " /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.Path) 5215</text>, output.Replace(dir.Path, "{SDKPATH}")) 5220output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:" & dir.Path & " /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.Path) 5224</text>, output.Replace(dir.Path, "{SDKPATH}")) 5231output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /nostdlib /sdkpath:" & dir.Path & " /t:library /vbruntime* /r:" & Path.Combine(RuntimeEnvironment.GetRuntimeDirectory(), "System.dll") & " " & src.ToString(), startFolder:=dir.Path) 5232AssertOutput(<text></text>, output.Replace(dir.Path, "{SDKPATH}")) ' SUCCESSFUL BUILD with 'mscorlib.dll' and embedded VbCore 5237output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /nostdlib /sdkpath:" & dir.Path & " /t:library /vbruntime* /r:" & Path.Combine(RuntimeEnvironment.GetRuntimeDirectory(), "System.dll") & " " & src.ToString(), startFolder:=dir.Path) 5238AssertOutput(<text></text>, output.Replace(dir.Path, "{SDKPATH}")) 5262Dim sdkMultiPath = subFolder1.Path & "," & subFolder2.Path 5269output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, cmdNoStdLibNoRuntime, startFolder:=dir.Path, expectedRetCode:=1) 5270AssertOutput(<text>vbc : error BC2017: could not find library 'mscorlib.dll'</text>, output.Replace(dir.Path, "{SDKPATH}")) 5277output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, cmdNoStdLibNoRuntime, startFolder:=dir.Path) 5278AssertOutput(<text></text>, output.Replace(dir.Path, "{SDKPATH}")) 5280output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, cmd, startFolder:=dir.Path, expectedRetCode:=1) 5285</text>, output.Replace(dir.Path, "{SDKPATH}")) 5302Dim output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /t:library " & src.ToString(), startFolder:=dir.Path, expectedRetCode:=1) 5305output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /nostdlib /define:_MYTYPE=\""Empty\"" /t:library " & src.ToString(), startFolder:=dir.Path) 5308output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:x:\ /vbruntime- /define:_MYTYPE=\""Empty\"" /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.Path) 5733Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, commandLineArguments.Concat({inputName1, inputName2}).ToArray()) 5740Assert.Equal(1, Directory.EnumerateFiles(dir.Path, "*" & PathUtilities.GetExtension(expectedOutputName)).Count()) 5741Assert.Equal(1, Directory.EnumerateFiles(dir.Path, expectedOutputName).Count()) 5873Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, commandLineArguments.Concat({fileName}).ToArray()) 5925Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en"}) 5978Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en", "-imports:System"}) 6015Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en"}) 6065Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en"}) 6109Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en"}) 6157Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en"}) 6203Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en"}) 6245Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en"}) 6280Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/target:exe", "/preferreduilang:en", "/out:sub\a.exe"}) 6284Assert.Contains("error BC2012: can't open '" + dir.Path + "\sub\a.exe' for writing", output.ToString(), StringComparison.Ordinal) 6312Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en", "/target:exe", "/out:sub\"}) 6346Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en", "/target:exe", "/out:sub\ "}) 6380Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en", "/target:exe", "/out:aaa:\a.exe"}) 6412Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, "/preferreduilang:en", "/target:exe", "/out: "}) 6435Dim output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /t:library " & file.ToString(), startFolder:=dir.Path) 6438output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /t:library /codepage:20127 " & file.ToString(), expectedRetCode:=1, startFolder:=dir.Path) ' 20127: US-ASCII 6799vbc = New MockVisualBasicCompiler(Nothing, dir.Path, 6807vbc = New MockVisualBasicCompiler(Nothing, dir.Path, 6817Dim library As IntPtr = LoadLibraryEx(Path.Combine(dir.Path, outputFileName), IntPtr.Zero, 2) 7499Dim output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /t:library /langversion:9 /preferreduilang:en " & src.ToString(), expectedRetCode:=1, startFolder:=dir.Path) 7582Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/preferreduilang:en", "/t:library", "a.vb"}) 7600" & Path.GetFullPath(Path.Combine(dir.Path, "..\b.vb")) & "(40) : error BC30451: 'Goo' is not declared. It may be inaccessible due to its protection level. 7603" & Path.GetFullPath(Path.Combine(dir.Path, "..\b.vb")) & "(50) : error BC30451: 'Goo' is not declared. It may be inaccessible due to its protection level. 7686args = DefaultParse({"/additionalfile:web*.config", "a.vb"}, baseDir.Path) 7689Assert.Equal(Path.Combine(baseDir.Path, "web1.config"), args.AdditionalFiles(0).Path) 7690Assert.Equal(Path.Combine(baseDir.Path, "web2.config"), args.AdditionalFiles(1).Path) 7691Assert.Equal(Path.Combine(baseDir.Path, "web3.config"), args.AdditionalFiles(2).Path) 7832Dim vbc = New MockVisualBasicCompiler(Nothing, sourceDir.Path, args, analyzers, generators) 8599Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "A.vb"}, dir.Path) 8619Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "A.vb"}, dir.Path) 8640Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "A.vb"}, dir.Path) 8661Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+:Test001", "A.vb"}, dir.Path) 8682Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "/WarnAsError-", "A.vb"}, dir.Path) 8703Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "/WarnAsError-:Test001", "A.vb"}, dir.Path) 8724Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+:Test002", "/WarnAsError-:Test002", "A.vb"}, dir.Path) 8746Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/NoWarn", "/WarnAsError+", "A.vb"}, dir.Path) 8767Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "/NoWarn", "/WarnAsError-", "A.vb"}, dir.Path) 8790Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/NoWarn", "A.vb"}, dir.Path) 8813Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/NoWarn:Test001", "/WarnAsError+", "/WarnAsError-:Test001", "A.vb"}, dir.Path) 9037Dim vbc As New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/target:exe", fileName}) 9242Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, 9248Dim exe = Path.Combine(dir.Path, "a.exe") 9257Dim doc = Path.Combine(dir.Path, "doc.xml") 9280Dim output = ProcessUtilities.RunAndGetOutput(exe, startFolder:=dir.Path) 9283Dim refDll = Path.Combine(refDir.Path, "a.dll") 9295CleanupAllGeneratedFiles(dir.Path) 9296CleanupAllGeneratedFiles(refDir.Path) 9313Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, 9319Dim vb = Path.Combine(dir.Path, "a.vb") 9321Dim dll = Path.Combine(dir.Path, "a.dll") 9324Dim refDll = Path.Combine(dir.Path, Path.Combine("ref", "a.dll")) 9335CleanupAllGeneratedFiles(dir.Path) 9360Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, 9366Dim refDll = Path.Combine(dir.Path, "a.dll") 9377Dim pdb = Path.Combine(dir.Path, "a.pdb") 9380Dim doc = Path.Combine(dir.Path, "doc.xml") 9410CleanupAllGeneratedFiles(dir.Path) 9453Assert.Equal(0, New MockVisualBasicCompiler(Nothing, dir.Path, {fileName, targetArg, outArg}).Run(output, Nothing)) 9454Assert.True(File.Exists(Path.Combine(dir.Path, expectedFile)), "Expected to find: " & expectedFile) 9455Assert.False(File.Exists(Path.Combine(dir.Path, unexpectedFile)), "Didn't expect to find: " & unexpectedFile) 9462Dim srcPath = MakeTrivialExe(Temp.CreateDirectory().Path) 9481Dim srcPath = MakeTrivialExe(Temp.CreateDirectory().Path) 9501Dim srcPath = MakeTrivialExe(Temp.CreateDirectory().Path) 9522Dim srcPath = MakeTrivialExe(Temp.CreateDirectory().Path) 9567Dim result = ProcessUtilities.Run(vbcPath, arguments:="/nologo /t:library unknown.vb", workingDirectory:=dir.Path) 9575result = ProcessUtilities.Run(vbcPath, arguments:="/nologo /t:library unknown.vb", workingDirectory:=dir.Path) 9587Dim src = MakeTrivialExe(directory:=dir.Path) 9591Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, args) 9595Dim exePath = Path.Combine(dir.Path, "a.exe") 9612Dim vbc = New MockVisualBasicCompiler(Nothing, New BuildPaths("", workingDir.Path, Nothing, tempDir.Path), 9898Dim binaryPath As String = Path.Combine(dir.Path, "temp.dll") 9901Dim pdbPath As String = Path.Combine(dir.Path, "temp.pdb") 9904Dim docPath As String = Path.Combine(dir.Path, docName) 9950Dim binaryPath As String = Path.Combine(dir.Path, "temp.dll") 9953Dim pdbPath As String = Path.Combine(dir.Path, "temp.pdb") 9956Dim docPath As String = Path.Combine(dir.Path, docName) 10007Dim binaryPath As String = Path.Combine(dir.Path, "temp.dll") 10010Dim pdbPath As String = Path.Combine(dir.Path, "temp.pdb") 10013Dim docPath As String = Path.Combine(dir.Path, docName) 10044Dim binaryPath As String = Path.Combine(dir.Path, "temp.dll") 10070Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, args, analyzer) 10105Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, args, analyzer) 10280CleanupAllGeneratedFiles(srcDirectory.Path) 10421{{generatedDir.Path, New Dictionary(Of String, String)()}} 10425Directory.Delete(dir.Path, True) 10435Dim generatedDirPath = Path.Combine(dir.Path, "noexist") 10447Directory.Delete(dir.Path, True) 10464VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference:=False, additionalFlags:={"/generatedfilesout:" + generatedDir.Path}, generators:={generator}) 10468{{Path.Combine(generatedDir.Path, generatorPrefix), New Dictionary(Of String, String)() From 10474Directory.Delete(dir.Path, True) 10490Directory.Delete(dir.Path, True) 10560Dim generatorPath = Path.Combine(directory.Path, "generator.dll")
SarifErrorLoggerTests.vb (5)
49Dim errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt") 84Dim errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt") 125Dim errorLogFile = Path.Combine(errorLogDir.Path, "ErrorLog.txt") 163Dim errorLogFile = Path.Combine(outputDir.Path, "ErrorLog.txt") 164Dim 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 (2)
Emit\CompilationEmitTests.vb (2)
3594Dim resolver = New XmlFileResolver(tempDir.Path) 3734Dim filePath = Path.Combine(tempDir.Path, "pset_01.xml")
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (1)
DocumentationComments\DocCommentTests.vb (1)
12374Dim path = dir.Path
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (5)
NetCoreTests.cs (4)
37["NUGET_PACKAGES"] = _nugetCacheDir.Path 45workingDirectory: SolutionDirectory.Path, 53var arguments = $@"msbuild ""{solutionOrProjectFileName}"" /t:restore /bl:{Path.Combine(SolutionDirectory.Path, "restore.binlog")}"; 59var arguments = $@"msbuild ""{solutionOrProjectFileName}"" /bl:{Path.Combine(SolutionDirectory.Path, "build.binlog")}";
WorkspaceTestBase.cs (1)
36return Path.Combine(this.SolutionDirectory.Path, relativeFileName);
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
CommandLineProject\CommandLineProjectWorkspaceTests.cs (1)
29var info = CommandLineProject.CreateProjectInfo("TestProject", LanguageNames.CSharp, commandLine, tempDirectory.Path, ws);
WorkspaceTests\AdhocWorkspaceTests.cs (1)
286var analyzerConfigDocFilePath = PathUtilities.CombineAbsoluteAndRelativePaths(Temp.CreateDirectory().Path, ".editorconfig");
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (10)
PersistentStorage\AbstractPersistentStorageTests.cs (4)
1016var configuration = new MockPersistentStorageConfiguration(solution.Id, persistentFolder.Path, throwOnFailure); 1018_storageService = GetStorageService(solution.Workspace.Services.SolutionServices.ExportProvider, configuration, faultInjector, _persistentFolder.Path); 1035var configuration = new MockPersistentStorageConfiguration(solutionKey.Id, _persistentFolder.Path, throwOnFailure: true); 1037_storageService = GetStorageService(services.SolutionServices.ExportProvider, configuration, faultInjector, _persistentFolder.Path);
ProjectSystemShim\TempPECompilerServiceTests.cs (2)
32pszOutputFileName: Path.Combine(directory.Path, "Output.dll"), 38optionValues: new[] { Path.Combine(directory.Path, "MissingReference.dll") });
ProjectSystemShim\VisualStudioCompilationOutputFilesTests.cs (4)
68Directory.Delete(dir.Path, recursive: true); 75var outputs = new CompilationOutputFilesWithImplicitPdbPath(Path.Combine(dir.Path, "nonexistent.dll")); 90var debugDirPdbPath = Path.Combine(dir.Path, "nonexistent.pdb"); 107Directory.Delete(dir.Path, recursive: true);
Microsoft.VisualStudio.LanguageServices.UnitTests (3)
AnalyzerSupport\AnalyzerDependencyCheckerTests.vb (3)
852Dim tempOut = Path.Combine(directory.Path, libraryName + ".out") 853Dim libraryOut = Path.Combine(directory.Path, libraryName + ".dll") 859references.Add(PortableExecutableReference.CreateFromFile(Path.Combine(directory.Path, referenceName + ".dll")))
VBCSCompiler.UnitTests (38)
AnalyzerConsistencyCheckerTests.cs (6)
87var result = AnalyzerConsistencyChecker.Check(directory.Path, analyzerReferences, new InMemoryAssemblyLoader(), Logger); 122var result = AnalyzerConsistencyChecker.Check(directory.Path, analyzerReferences, assemblyLoader, Logger); 144var result = AnalyzerConsistencyChecker.Check(directory.Path, analyzerReferences, assemblyLoader, Logger); 167var result = AnalyzerConsistencyChecker.Check(directory.Path, analyzerReferences, assemblyLoader, Logger); 181var result = AnalyzerConsistencyChecker.Check(directory.Path, analyzerReferences, TestAnalyzerAssemblyLoader.LoadNotImplemented, Logger); 195var result = AnalyzerConsistencyChecker.Check(directory.Path, analyzerReferences, new DefaultAnalyzerAssemblyLoader(), Logger);
BuildClientTests.cs (2)
40workingDir: Temp.CreateDirectory().Path, 41tempDir: Temp.CreateDirectory().Path);
BuildServerConnectionTests.cs (4)
40var workingDirectory = TempRoot.CreateDirectory().Path; 69var workingDirectory = TempRoot.CreateDirectory().Path; 99ProtocolUtil.CreateEmptyCSharp(TempRoot.CreateDirectory().Path), 120var workingDirectory = TempRoot.CreateDirectory().Path;
CompilerServerApiTest.cs (1)
115var request = BuildRequest.Create(RequestLanguage.CSharpCompile, workingDirectory: temp.CreateDirectory().Path, tempDirectory: null, compilerHash: BuildProtocolConstants.GetCommitHash(), libDirectory: null, args: Array.Empty<string>());
CompilerServerTests.cs (21)
201workingDir: currentDirectory.Path, 203tempDir: BuildServerConnection.GetTempPath(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 (2)
59var touchedBase = Path.Combine(touchedDir.Path, "touched"); 109var touchedBase = Path.Combine(touchedDir.Path, "touched");
VBCSCompilerServerTests.cs (2)
305var workingDirectory = TempRoot.CreateDirectory().Path; 346var workingDirectory = TempRoot.CreateDirectory().Path;