1162 references to Path
InteractiveHost.UnitTests (35)
AbstractInteractiveHostTests.cs (1)
206return (file.Path, image);
InteractiveHostCoreInitTests.cs (2)
57var dllDir = Path.GetDirectoryName(dll.Path)!; 85await Host.AddReferenceAsync(Path.GetFileName(dll.Path));
InteractiveHostDesktopInitTests.cs (2)
32var dllDir = Path.GetDirectoryName(dll.Path)!; 60await Host.AddReferenceAsync(Path.GetFileName(dll.Path));
InteractiveHostDesktopTests.cs (30)
184var file = Temp.CreateFile().WriteAllText(MethodWithInfiniteLoop + "\r\nfoo();").Path; 203var file = Temp.CreateFile().WriteAllText("1 1").Path; 238").Path; 274await Host.ExecuteFileAsync(file.Path); 277Assert.True(errorOut.StartsWith(file.Path + "(1,7):", StringComparison.Ordinal), "Error output should start with file name, line and column"); 465Assert.True(await LoadReference(file1.Path)); 466Assert.True(await LoadReference(file2.Path)); 510#r ""{file.Path}"" 522#r ""{file.Path}"" 553#r ""{file1.Path}"" 554#r ""{file2.Path}"" 564Assert.Equal(@"(2,1): error CS1704: An assembly with the same simple name 'C' has already been imported. Try removing one of the references (e.g. '" + file1.Path + @"') or sign them to enable side-by-side. 588#r ""{file1.Path}"" 589#r ""{file2.Path}"" 706rspFile.WriteAllText($"/lib:{directory1.Path} /r:Assembly2.dll {initFile.Path}"); 708await Host.ResetAsync(new InteractiveHostOptions(Host.OptionsOpt!.HostPath, rspFile.Path, culture: CultureInfo.InvariantCulture, Host.OptionsOpt!.Platform)); 724{string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path))} 744rspFile.WriteAllText($"{initFile.Path}"); 746await Host.ResetAsync(new InteractiveHostOptions(Host.OptionsOpt!.HostPath, rspFile.Path, culture: CultureInfo.InvariantCulture, Host.OptionsOpt!.Platform)); 750@$"{initFile.Path}(1,1): error CS0006: {string.Format(CSharpResources.ERR_NoMetadataFile, "Assembly.dll")}", error); 771await Host.ResetAsync(new InteractiveHostOptions(Host.OptionsOpt!.HostPath, rspFile.Path, CultureInfo.InvariantCulture, Host.OptionsOpt!.Platform)); 804$@"{string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path))} 819{initFile.Path} 822await Host.ResetAsync(new InteractiveHostOptions(Host.OptionsOpt!.HostPath, rspFile.Path, CultureInfo.InvariantCulture, Host.OptionsOpt!.Platform)); 828AssertEx.AssertEqualToleratingWhitespaceDifferences($@"{initFile.Path}(1,3): error CS1002: {CSharpResources.ERR_SemicolonExpected} 832{string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path))} 849await Host.ResetAsync(new InteractiveHostOptions(Host.OptionsOpt!.HostPath, rspFile.Path, CultureInfo.InvariantCulture, Host.OptionsOpt!.Platform)); 854$@"{string.Format(InteractiveHostResources.Loading_context_from_0, Path.GetFileName(rspFile.Path))} 917#r """ + dll.Path + @""" 946await Execute($@"#r ""{libFile.Path}""");
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (30)
CopyRefAssemblyTests.cs (22)
47File.WriteAllText(file.Path, ""); 52SourcePath = file.Path, 65File.WriteAllText(file.Path, "test"); 71SourcePath = file.Path, 76AssertEx.AssertEqualToleratingWhitespaceDifferences($$"""Copying reference assembly from "{{file.Path}}" to "{{dest}}".""", engine.Log); 85File.WriteAllText(source.Path, "test"); 87File.WriteAllText(dest.Path, "dest"); 92SourcePath = source.Path, 93DestinationPath = dest.Path, 99Could not extract the MVID from "{{source.Path}}". Are you sure it is a reference assembly? 100Copying reference assembly from "{{source.Path}}" to "{{dest}}". 104Assert.Equal("test", File.ReadAllText(dest.Path)); 112File.WriteAllBytes(source.Path, TestResources.General.MVID1); 113var sourceTimestamp = File.GetLastWriteTimeUtc(source.Path).ToString("O"); 116File.WriteAllBytes(dest.Path, TestResources.General.MVID2); 117var destTimestamp = File.GetLastWriteTimeUtc(dest.Path).ToString("O"); 123SourcePath = source.Path, 124DestinationPath = dest.Path, 130Source reference assembly "{{source.Path}}" (timestamp "{{sourceTimestamp}}", MVID "f851dda2-6ea3-475e-8c0d-19bd3c4d9437") differs from destination "{{dest.Path}}" (timestamp "{{destTimestamp}}", MVID "8e1ed25b-2980-4f32-9dee-c1e3b0a57c4b"). 131Copying reference assembly from "{{source.Path}}" to "{{dest.Path}}".
DotNetSdkTests.cs (6)
42<Compile Include=""{libFile.Path}"" Link=""Lib.cs"" /> 433editorConfigFile2.Path 494globalConfigFile.Path, 495globalConfigFile2.Path 561globalConfigFile.Path, 562globalConfigFile2.Path
TestUtilities\DotNetSdkTestBase.cs (2)
191Project.Path, 233Project.Path,
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (343)
CommandLineTests.cs (320)
147var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/errorlog:errorlog", $"/doc:{docName}", "/warnaserror", src.Path }); 167var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/t:library", "/preferreduilang:en", $"/doc:{docName}", src.Path }); 200"/analyzerconfig:" + analyzerConfig.Path, 201src.Path }); 203Assert.Equal(analyzerConfig.Path, Assert.Single(cmd.Arguments.AnalyzerConfigPaths)); 235"/analyzerconfig:" + analyzerConfig.Path, 238"/additionalfile:" + additionalFile.Path, 239src.Path }); 241Assert.Equal(analyzerConfig.Path, Assert.Single(cmd.Arguments.AnalyzerConfigPaths)); 288"/analyzerconfig:" + analyzerConfig.Path, 289src.Path }); 291Assert.Equal(analyzerConfig.Path, Assert.Single(cmd.Arguments.AnalyzerConfigPaths)); 297$@"warning InvalidSeverityInAnalyzerConfig: The diagnostic 'cs0169' was given an invalid severity 'garbage' in the analyzer config file at '{analyzerConfig.Path}'. 324"/analyzerconfig:" + analyzerConfig1.Path, 325"/analyzerconfig:" + analyzerConfig2.Path, 326src.Path 344var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", src.Path }); 364var cmd = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/codepage:932", src.Path }); 397").Path; 819string tmpFileName = Temp.CreateFile().WriteAllBytes(new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }).Path; 1205CleanupAllGeneratedFiles(file1.Path); 1206CleanupAllGeneratedFiles(file2.Path); 1207CleanupAllGeneratedFiles(file3.Path); 1208CleanupAllGeneratedFiles(file4.Path); 1209CleanupAllGeneratedFiles(file5.Path); 2198AssertEx.Equal(File.ReadAllBytes(sl.Path), blob); 2203CleanupAllGeneratedFiles(src.Path); 2227AssertEx.Equal(File.ReadAllBytes(sl.Path), blob); 2231CleanupAllGeneratedFiles(src.Path); 2256CleanupAllGeneratedFiles(src.Path); 2376expectedEmbeddedMap.Add(src.Path, embed_cs); 2381expectedEmbeddedMap.Add(src2.Path, embed2_cs); 2386expectedEmbeddedMap.Add(txt.Path, embed_xyz); 2409CleanupAllGeneratedFiles(src.Path); 2674CleanupAllGeneratedFiles(file.Path); 2696CleanupAllGeneratedFiles(file.Path); 2721var parsedArgs = DefaultParse(new string[] { @"/ruleset:" + file.Path, "a.cs" }, WorkingDirectory); 2723Assert.Equal(expected: file.Path, actual: parsedArgs.RuleSetPath); 2747var parsedArgs = DefaultParse(new string[] { @"/ruleset:" + "\"" + file.Path + "\"", "a.cs" }, WorkingDirectory); 2749Assert.Equal(expected: file.Path, actual: parsedArgs.RuleSetPath); 2776parsedArgs = DefaultParse(new string[] { @"/ruleset:" + file.Path, "a.cs" }, WorkingDirectory); 2779Assert.Equal(expected: file.Path, actual: parsedArgs.RuleSetPath); 2784Assert.Equal(file.Path, (string)err.Arguments[0]); 2816CleanupAllGeneratedFiles(file.Path); 2844var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs", "/ruleset:" + ruleSetFile.Path }); 2851CleanupAllGeneratedFiles(file.Path); 2881"/ruleset:" + ruleSetFile.Path, "/warnaserror+", "/nowarn:8032" }); 2892"/warnaserror+", "/ruleset:" + ruleSetFile.Path, "/nowarn:8032" }); 2899CleanupAllGeneratedFiles(file.Path); 3400"/ruleset:" + ruleSetFile.Path, "/warn:0" }); 3411"/warn:0", "/ruleset:" + ruleSetFile.Path }); 3418CleanupAllGeneratedFiles(file.Path); 4139var srcDirectory = Path.GetDirectoryName(srcFile.Path); 4150var silverlight = Temp.CreateFile().WriteAllBytes(ProprietaryTestResources.silverlight_v5_0_5_0.System_v5_0_5_0_silverlight).Path; 4151var net4_0dll = Temp.CreateFile().WriteAllBytes(ResourcesNet451.System).Path; 4159"/appconfig:" + appConfigFile.Path, 4160srcFile.Path }).Run(outWriter); 4164CleanupAllGeneratedFiles(srcFile.Path); 4165CleanupAllGeneratedFiles(appConfigFile.Path); 4172var srcDirectory = Path.GetDirectoryName(srcFile.Path); 4179srcFile.Path }).Run(outWriter); 4183CleanupAllGeneratedFiles(srcFile.Path); 4299var csc = CreateCSharpCompiler(null, dir.Path, new[] { "/modulename:hocusPocus ", "/out:" + exeName + " ", file1.Path }); 4324CleanupAllGeneratedFiles(file1.Path); 4568CleanupAllGeneratedFiles(src.Path); 4586CleanupAllGeneratedFiles(src.Path); 5674public class Mod { }").Path; 5679public class Mod { }").Path; 5684class Test { static void Main() {} }").Path; 5721string source1 = Temp.CreateFile(prefix: "", extension: ".cs").WriteAllText(@"public static class Extensions { public static bool EB(this bool b) { return b; } }").Path; 5722string source2 = Temp.CreateFile(prefix: "", extension: ".cs").WriteAllText(@"class C { static void Main() {} }").Path; 5741string source1 = Temp.CreateFile(prefix: "", extension: ".cs").WriteAllText(@"class Mod { }").Path; 5742string source2 = Temp.CreateFile(prefix: "", extension: ".cs").WriteAllText(@"class C { static void Main() {} }").Path; 5921var srcFile = Temp.CreateFile().WriteAllText("\u265A").Path; 5925var output = ProcessUtilities.RunAndGetOutput("cmd", "/C \"" + s_CSharpCompilerExecutable + "\" /nologo /preferreduilang:en /t:library " + srcFile + " > " + tempOut.Path, expectedRetCode: 1); 5930CleanupAllGeneratedFiles(tempOut.Path); 5936var srcFile = Temp.CreateFile().WriteAllText("\u265A").Path; 5940var output = ProcessUtilities.RunAndGetOutput("cmd", "/C \"" + s_CSharpCompilerExecutable + "\" /utf8output /nologo /preferreduilang:en /t:library " + srcFile + " > " + tempOut.Path, expectedRetCode: 1); 5945CleanupAllGeneratedFiles(tempOut.Path); 5965CleanupAllGeneratedFiles(aCs.Path); 5979CleanupAllGeneratedFiles(aCs.Path); 5993CleanupAllGeneratedFiles(aCs.Path); 6093var kfile = "/keyfile:" + snkFile.Path; 6098parsedArgs = DefaultParse(new[] { "/t:library", kfile, "/r:" + cs1698a.Path, "CS1698b.cs" }, WorkingDirectory); 6101parsedArgs = DefaultParse(new[] { "/t:library", kfile, "/r:" + cs1698b.Path, "/out:" + cs1698a.Path, "CS1698.cs" }, WorkingDirectory); 6111CleanupAllGeneratedFiles(snkFile.Path); 6112CleanupAllGeneratedFiles(cs1698a.Path); 6113CleanupAllGeneratedFiles(cs1698b.Path); 6114CleanupAllGeneratedFiles(cs1698.Path); 6120var binaryPath = Temp.CreateFile().WriteAllBytes(ResourcesNet451.mscorlib).Path; 6157var source = folder.CreateFile("src.vb").WriteAllText("").Path; 6158var _ref = folder.CreateFile("ref.dll").WriteAllText("").Path; 6205").Path; 6210").Path; 6229").Path; 6238").Path; 6243").Path; 6251").Path; 6257").Path; 6304").Path; 6309").Path; 6345").Path; 6351").Path; 6386").Path; 6392").Path; 6736CleanupAllGeneratedFiles(file.Path); 6760CleanupAllGeneratedFiles(file.Path); 6783CleanupAllGeneratedFiles(file.Path); 6811CleanupAllGeneratedFiles(file.Path); 6884CleanupAllGeneratedFiles(file1.Path); 6885CleanupAllGeneratedFiles(file2.Path); 6907CleanupAllGeneratedFiles(file.Path); 7007CleanupAllGeneratedFiles(file.Path); 7035CleanupAllGeneratedFiles(file.Path); 7063CleanupAllGeneratedFiles(file.Path); 7089CleanupAllGeneratedFiles(file.Path); 7115CleanupAllGeneratedFiles(file.Path); 7279CleanupAllGeneratedFiles(file.Path); 7318CleanupAllGeneratedFiles(file.Path); 7587Path.GetFileName(sourceFile.Path), 7597string.Format("/win32manifest:{0}", Path.GetFileName(manifestFile.Path)), 7598Path.GetFileName(sourceFile.Path), 7640}").Path; 7644").Path; 7687}").Path; 7691").Path; 7721}").Path; 7725").Path; 7755}").Path; 7759").Path; 7795outWriter.ToString().Replace(Path.GetFileName(src.Path), "{FILE}").Trim()); 7804CleanupAllGeneratedFiles(src.Path); 7810return Temp.CreateFile().WriteAllBytes(cscRsp).Path; 7949string OriginalSource = src.Path; 7959CleanupAllGeneratedFiles(src.Path); 8019CleanupAllGeneratedFiles(src.Path); 8062CleanupAllGeneratedFiles(src.Path); 8063CleanupAllGeneratedFiles(xml.Path); 8133CleanupAllGeneratedFiles(src.Path); 8134CleanupAllGeneratedFiles(xml.Path); 8173}").Path; 8310}").Path; 8349").Path; 8373").Path; 8407").Path; 8426string source = Temp.CreateFile(prefix: "", extension: ".cs").WriteAllText(@"class Test { static void Main() {} }").Path; 8427string badres = Temp.CreateFile().WriteAllBytes(TestResources.DiagnosticTests.badresfile).Path; 8451string source = Temp.CreateFile(prefix: "", extension: ".cs").WriteAllText(@"class Test { static void Main() {} }").Path; 8452string badres = Temp.CreateFile().WriteAllBytes(new byte[] { 0, 0 }).Path; 8480}").Path; 8502} ").Path; 8546using (var stream = File.OpenWrite(exe.Path)) 8553using (var stream = File.OpenWrite(pdb.Path)) 8559int exitCode1 = CreateCSharpCompiler(null, dir.Path, new[] { "/debug:full", "/out:Program.exe", source1.Path }).Run(outWriter); 8562ValidateZeroes(exe.Path, oldSize); 8563ValidateZeroes(pdb.Path, oldSize); 8565int exitCode2 = CreateCSharpCompiler(null, dir.Path, new[] { "/debug:full", "/out:Program.exe", source2.Path }).Run(outWriter); 8568using (var peFile = File.OpenRead(exe.Path)) 8570PdbValidation.ValidateDebugDirectory(peFile, null, pdb.Path, hashAlgorithm: default, hasEmbeddedPdb: false, isDeterministic: false); 8573Assert.True(new FileInfo(exe.Path).Length < oldSize); 8574Assert.True(new FileInfo(pdb.Path).Length < oldSize); 8576int exitCode3 = CreateCSharpCompiler(null, dir.Path, new[] { "/debug:full", "/out:Program.exe", source3.Path }).Run(outWriter); 8579using (var peFile = File.OpenRead(exe.Path)) 8581PdbValidation.ValidateDebugDirectory(peFile, null, pdb.Path, hashAlgorithm: default, hasEmbeddedPdb: false, isDeterministic: false); 8617var fsDll = new FileStream(libDll.Path, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete); 8618var fsPdb = new FileStream(libPdb.Path, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete); 8621int exitCode = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/debug:full", libSrc.Path }).Run(outWriter); 8629AssertEx.Equal(new byte[] { 0x4D, 0x5A }, ReadBytes(libDll.Path, 2)); 8632AssertEx.Equal(new byte[] { 0x4D, 0x69 }, ReadBytes(libPdb.Path, 2)); 8657var fsDll = new FileStream(libDll.Path, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete); 8658var fsPdb = new FileStream(libPdb.Path, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete); 8667var output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $"/target:library /debug:portable \"{libSrc.Path}\"", startFolder: dir.ToString()); 8683using (var fsNewDll = File.OpenRead(libDll.Path)) 8689AssertEx.Equal(new[] { (byte)'B', (byte)'S', (byte)'J', (byte)'B' }, ReadBytes(libPdb.Path, 4)); 8698File.Delete(libSrc.Path); 8699File.Delete(libDll.Path); 8700File.Delete(libPdb.Path); 8723File.SetAttributes(libDll.Path, FileAttributes.ReadOnly); 8725var fsDll = new FileStream(libDll.Path, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete); 8728int exitCode = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/preferreduilang:en", libSrc.Path }).Run(outWriter); 8729Assert.Contains($"error CS2012: Cannot open '{libDll.Path}' for writing", outWriter.ToString()); 8731AssertEx.Equal(new[] { (byte)'D', (byte)'L', (byte)'L' }, ReadBytes(libDll.Path, 3)); 8747int exitCode = CreateCSharpCompiler(null, dir.Path, new[] { "/target:library", "/preferreduilang:en", libSrc.Path }).Run(outWriter); 8951} ").Path; 8995string sourcePath = Temp.CreateFile(prefix: "", extension: ".cs").WriteAllText(source).Path; 9020var sourcePath = Temp.CreateFile(directory: WorkingDirectory, extension: ".cs").WriteAllText(source).Path; 9093commandLineArgs = new[] { @"tmpDir\a.cs", tempFile.Path }; 9104commandLineArgs = new[] { tempFile.Path, @"tmpDir\*.cs" }; 9119commandLineArgs = new[] { "/preferreduilang:en", tempFile.Path, "tmpDir\a.cs" }; 9124commandLineArgs = new[] { tempFile.Path, @"tmpDi\r*a?.cs" }; 9133commandLineArgs = new[] { tempFile.Path, currentDrive + @":a.cs" }; 9139commandLineArgs = new[] { "/preferreduilang:en", tempFile.Path, @":a.cs" }; 9144CleanupAllGeneratedFiles(tempFile.Path); 9217var srcDirectory = Path.GetDirectoryName(srcFile.Path); 9223new[] { "/reportanalyzer", "/t:library", srcFile.Path }, 9233CleanupAllGeneratedFiles(srcFile.Path); 9274var srcDirectory = Path.GetDirectoryName(srcFile.Path); 9276var args = new List<string>() { "/reportanalyzer", "/t:library", "/a:" + typeof(DoNothingGenerator).Assembly.Location, srcFile.Path }; 9298CleanupAllGeneratedFiles(srcFile.Path); 9307var srcDirectory = Path.GetDirectoryName(srcFile.Path); 9316new[] { "/reportanalyzer", "/t:library", srcFile.Path }, 9332CleanupAllGeneratedFiles(srcFile.Path); 9347workingDirectory: Path.GetDirectoryName(srcFile.Path), 9348args: new[] { "/errorlog:" + errorLog.Path, "/warnaserror+", "/nologo", "/t:library", srcFile.Path }, 9358CleanupAllGeneratedFiles(srcFile.Path); 9359CleanupAllGeneratedFiles(errorLog.Path); 9367var srcDirectory = Path.GetDirectoryName(srcFile.Path); 9370var csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", srcFile.Path }, 9384CleanupAllGeneratedFiles(srcFile.Path); 9392var srcDirectory = Path.GetDirectoryName(srcFile.Path); 9395var csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", $"/warnaserror:{AnalyzerExecutor.AnalyzerExceptionDiagnosticId}", srcFile.Path }, 9406CleanupAllGeneratedFiles(srcFile.Path); 9414var srcDirectory = Path.GetDirectoryName(srcFile.Path); 9417var csc = CreateCSharpCompiler(null, WorkingDirectory, new[] { "/t:library", srcFile.Path }, 9428CleanupAllGeneratedFiles(srcFile.Path); 9521").Path; 9572DefaultParse(new[] { "/lib:" + invalidPath, sourceFile.Path }, WorkingDirectory).Errors.Verify( 9575DefaultParse(new[] { "/lib:" + nonExistentPath, sourceFile.Path }, WorkingDirectory).Errors.Verify( 9580DefaultParse(new[] { sourceFile.Path }, WorkingDirectory, additionalReferenceDirectories: invalidPath).Errors.Verify( 9583DefaultParse(new[] { sourceFile.Path }, WorkingDirectory, additionalReferenceDirectories: nonExistentPath).Errors.Verify( 9587CleanupAllGeneratedFiles(sourceFile.Path); 9613string filePath = Temp.CreateFile().WriteAllText(@"class C {}").Path; 9786string filePath = Temp.CreateFile().WriteAllText(source).Path; 9836string filePath = Temp.CreateFile().WriteAllText(source).Path; 9906CleanupAllGeneratedFiles(src.Path); 9964CleanupAllGeneratedFiles(src.Path); 10029CleanupAllGeneratedFiles(src.Path); 10134CleanupAllGeneratedFiles(src.Path); 10137void RunWithCache() => VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/langversion:preview", "/features:enable-generator-cache", "/additionalFile:" + additionalFile.Path }, generators: new[] { generator.AsSourceGenerator() }, driverCache: cache, analyzers: null); 10230CleanupAllGeneratedFiles(src.Path); 10233void RunWithCache() => VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/langversion:preview", "/features:enable-generator-cache", "/analyzerConfig:" + editorconfig.Path, "/analyzerConfig:" + globalconfig.Path }, generators: new[] { generator.AsSourceGenerator() }, driverCache: cache, analyzers: null); 10266CleanupAllGeneratedFiles(src.Path); 10299sourceFile.Path 10396CleanupAllGeneratedFiles(file.Path); 10508CleanupAllGeneratedFiles(file.Path); 10651CleanupAllGeneratedFiles(file.Path); 10849CleanupAllGeneratedFiles(file.Path); 10933CleanupAllGeneratedFiles(file.Path); 11037CleanupAllGeneratedFiles(file.Path); 11136CleanupAllGeneratedFiles(src.Path); 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); 11758var cscPath = dir.CopyFile(s_CSharpCompilerExecutable).Path; 12171string filePath = Temp.CreateFile().WriteAllText("").Path; 12191string filePath = Temp.CreateFile().WriteAllText("").Path; 12254CleanupAllGeneratedFiles(srcFile.Path); 12316CleanupAllGeneratedFiles(srcFile.Path); 12372CleanupAllGeneratedFiles(srcFile.Path); 12395CleanupAllGeneratedFiles(srcFile.Path); 12421CleanupAllGeneratedFiles(srcFile.Path); 12488CleanupAllGeneratedFiles(srcFile.Path); 12516CleanupAllGeneratedFiles(srcFile.Path); 12758"/analyzerconfig:" + analyzerConfig.Path, 12759src.Path }; 12778arguments = arguments.Append($"/ruleset:{rulesetFile.Path}"); 12784Assert.Equal(analyzerConfig.Path, Assert.Single(cmd.Arguments.AnalyzerConfigPaths)); 12876additionalArgs = additionalArgs.Append("/analyzerconfig:" + analyzerConfig.Path).ToArray(); 12926additionalArgs = additionalArgs.Append("/ruleset:" + rulesetFile.Path).ToArray(); 13010"/analyzerconfig:" + analyzerConfig.Path, 13011src.Path }; 13025Assert.Equal(analyzerConfig.Path, Assert.Single(cmd.Arguments.AnalyzerConfigPaths)); 13070output = VerifyOutput(dir, src, additionalFlags: new[] { "/nullable", "/analyzerconfig:" + analyzerConfig.Path }, expectedWarningCount: 1, includeCurrentAssemblyAsAnalyzerReference: false); 13079output = VerifyOutput(dir, src, additionalFlags: new[] { "/nullable", "/analyzerconfig:" + analyzerConfig.Path }, expectedWarningCount: 1, includeCurrentAssemblyAsAnalyzerReference: false); 13087output = VerifyOutput(dir, src, additionalFlags: new[] { "/nullable", "/analyzerconfig:" + analyzerConfig.Path }, expectedWarningCount: 1, includeCurrentAssemblyAsAnalyzerReference: false); 13108var args = new[] { "/nologo", "/t:library", "/preferreduilang:en", src.Path }; 13146var args = new[] { "/warnaserror+", $"/warnaserror-:{diagnosticId}", "/nologo", "/t:library", "/preferreduilang:en", src.Path }; 13200additionalFlags = additionalFlags.Append($"/analyzerconfig:{analyzerConfig.Path}").ToArray(); 13248CleanupAllGeneratedFiles(src.Path); 13303CleanupAllGeneratedFiles(src.Path); 13334CleanupAllGeneratedFiles(src.Path); 13371<file id=""1"" name=""{src.Path}"" language=""C#"" checksumAlgorithm=""SHA256"" checksum=""A0-78-BB-A8-E8-B1-E1-3B-E8-63-80-7D-CE-CC-4B-0D-14-EF-06-D3-9B-14-52-E1-95-C6-64-D1-36-EC-7C-25"" /> 13417CleanupAllGeneratedFiles(src.Path); 13447CleanupAllGeneratedFiles(src.Path); 13481CleanupAllGeneratedFiles(src.Path); 13519CleanupAllGeneratedFiles(src.Path); 13550options: TestOptions.DebugDll.WithCryptoKeyFile(Path.GetFileName(snk.Path)).WithStrongNameProvider(virtualSnProvider), 13589CleanupAllGeneratedFiles(src.Path); 13610CleanupAllGeneratedFiles(src.Path); 13633CleanupAllGeneratedFiles(src.Path); 13702CleanupAllGeneratedFiles(src.Path); 13730CleanupAllGeneratedFiles(src.Path); 13749VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/analyzerconfig:" + analyzerConfig.Path }, generators: new[] { generator }, analyzers: null); 13812"/analyzerconfig:" + analyzerConfig1.Path, 13813"/analyzerconfig:" + analyzerConfig2.Path, 13814"/analyzerconfig:" + analyzerConfig3.Path, 13816src.Path 13880new[] { "/t:library", "/nologo", "/warnaserror+", src.Path }, 13900new[] { "/t:library", "/nologo", "/nowarn:CS8785", src.Path }, 13925new[] { "/t:library", "/nologo", "/warnaserror+", src.Path }, 13945new[] { "/t:library", "/nologo", "/nowarn:CS8784", src.Path }, 13980VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/additionalfile:" + additionalFile.Path, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null); 13983CleanupAllGeneratedFiles(src.Path); 14025new[] { "/nologo", "/t:library", srcFile.Path }, 14031CleanupAllGeneratedFiles(srcFile.Path); 14054"/analyzerconfig:" + analyzerConfig1.Path, 14055"/analyzerconfig:" + analyzerConfig2.Path, 14056src.Path 14084var output = VerifyOutput(dir, src, additionalFlags: new[] { "/analyzerconfig:" + analyzerConfig.Path + "," + analyzerConfig2.Path }, expectedWarningCount: 1, includeCurrentAssemblyAsAnalyzerReference: false); 14103output = VerifyOutput(dir, src, additionalFlags: new[] { "/analyzerconfig:" + analyzerConfig.Path + "," + analyzerConfig2.Path }, expectedWarningCount: 1, includeCurrentAssemblyAsAnalyzerReference: false); 14134"/analyzerconfig:" + analyzerConfig.Path, 14135"/analyzerconfig:" + globalConfig.Path, 14138"/additionalfile:" + additionalFile.Path, 14139src.Path }); 14219additionalFlags: configs.SelectAsArray(c => "/analyzerconfig:" + c.Path) 14241VerifyOutput(dir, src, additionalFlags: new[] { "/warnaserror+", "/analyzerconfig:" + globalConfig.Path }, includeCurrentAssemblyAsAnalyzerReference: false); 14264additionalFlags = additionalFlags.Append("/analyzerconfig:" + globalConfig.Path).ToArray(); 14298[{PathUtilities.NormalizeWithForwardSlash(src.Path)}] 14302VerifyOutput(dir, src, additionalFlags: new[] { "/nowarn:0164", "/analyzerconfig:" + globalConfig.Path }, expectedErrorCount: 0, includeCurrentAssemblyAsAnalyzerReference: false); 14319VerifyOutput(dir, src, additionalFlags: new[] { "/analyzerconfig:" + globalConfig.Path }, expectedErrorCount: 1, includeCurrentAssemblyAsAnalyzerReference: false, analyzers: new[] { new WarningDiagnosticAnalyzer() }); 14321VerifyOutput(dir, src, additionalFlags: new[] { "/nowarn:Warning01", "/analyzerconfig:" + globalConfig.Path }, includeCurrentAssemblyAsAnalyzerReference: false, analyzers: new[] { new WarningDiagnosticAnalyzer() }); 14341additionalFlags: new[] { "/additionalfile:" + additionalFile.Path }, 14422additionalArgs = additionalArgs.Append("/analyzerconfig:" + analyzerConfig.Path).ToArray(); 14543string path1 = additionalFile1.Path; 14544string path2 = additionalFile2?.Path ?? Path.Combine(srcDirectory.Path, additionalFilePath2);
SarifErrorLoggerTests.cs (8)
40var hello = Temp.CreateFile().WriteAllText(helloWorldCS).Path; 71var sourceFile = Temp.CreateFile().WriteAllText(source).Path; 105var sourceFile = Temp.CreateFile().WriteAllText(source).Path; 137var sourceFile = Temp.CreateFile().WriteAllText(source).Path; 174var sourceFile = Temp.CreateFile().WriteAllText(source).Path; 209var sourceFile = Temp.CreateFile().WriteAllText(source).Path; 244var sourceFile = Temp.CreateFile().WriteAllText(source).Path; 279var sourceFile = Temp.CreateFile().WriteAllText(source).Path;
SarifV2ErrorLoggerTests.cs (5)
381var sourceFile = Temp.CreateFile().WriteAllText(source).Path; 453var sourceFile1 = sourceDir.CreateFile("source1.cs").WriteAllText(source1).Path; 454var sourceFile2 = sourceDir.CreateFile("source2.cs").WriteAllText(source2).Path; 455var editorconfigFile = sourceDir.CreateFile(".editorconfig").WriteAllText(editorconfigText).Path; 517var sourceFile = Temp.CreateFile().WriteAllText(source).Path;
TouchedFileLoggingTests.cs (10)
39var hello = Temp.CreateFile().WriteAllText(helloWorldCS).Path; 67var hello = Temp.CreateFile().WriteAllText(helloWorldCS).Path; 78</configuration>").Path; 80var silverlight = Temp.CreateFile().WriteAllBytes(ProprietaryTestResources.silverlight_v5_0_5_0.System_v5_0_5_0_silverlight).Path; 81var net4_0dll = Temp.CreateFile().WriteAllBytes(ResourcesNet451.System).Path; 113var hello = Temp.CreateFile().WriteAllText(helloWorldCS).Path; 114var snkPath = Temp.CreateFile("TestKeyPair_", ".snk").WriteAllBytes(TestResources.General.snKey).Path; 152public class C { }").Path; 161"/doc:" + xml.Path, 173expectedWrites.Add(xml.Path);
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (1)
EditAndContinue\StatementEditingTests.cs (1)
3398delegateDefs = MetadataReference.CreateFromImage(File.ReadAllBytes(tempAssembly.Path));
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (6)
Emit\CompilationEmitTests.cs (1)
1999options: TestOptions.ReleaseDll.WithCryptoKeyFile(snk.Path).WithPublicSign(true));
Emit\ResourceTests.cs (5)
58lib = LoadLibraryEx(exe.Path, IntPtr.Zero, 0x00000002); 119var fileVer = FileVersionInfo.GetVersionInfo(exe.Path); 148lib = LoadLibraryEx(exe.Path, IntPtr.Zero, 0x00000002); 201var fileVer = FileVersionInfo.GetVersionInfo(exe.Path); 847lib = LoadLibraryEx(exeFile.Path, IntPtr.Zero, 0x00000002);
Microsoft.CodeAnalysis.CSharp.Emit2.UnitTests (10)
Attributes\EmitTestStrongNameProvider.cs (1)
32var keyFile = Temp.CreateFile().WriteAllBytes(TestResources.General.snKey).Path;
Attributes\InternalsVisibleToAndStrongNameTests.cs (9)
344CSharpCompilation other = CreateCompilation(s, options: TestOptions.ReleaseDll.WithCryptoKeyFile(tempFile.Path), parseOptions: parseOptions); 484[assembly: System.Reflection.AssemblyKeyFile(@""" + snk.Path + @""")] 488c = CreateCompilation(source1, options: TestOptions.SigningReleaseModule.WithCryptoKeyFile(snk.Path).WithPublicSign(true)); 557.WithCryptoKeyFile(snk.Path) 579.WithCryptoKeyFile(pubKeyFile.Path) 603.WithCryptoKeyFile(pubKeyFile.Path) 668.WithCryptoKeyFile(snk.Path), 689.WithCryptoKeyFile(snk.Path), 1464using (var metadata = new FileStream(file.Path, FileMode.Open))
Microsoft.CodeAnalysis.CSharp.Scripting.Desktop.UnitTests (31)
InteractiveSessionReferencesTests.cs (31)
347#r ""{c1.Path}"" 348#r ""{c2.Path}"" 363#r ""{c1.Path}"" 365#r ""{c2.Path}"" 383#r ""{c1.Path}"" 384#r ""{c2.Path}"" 402#r ""{c1.Path}"" 404#r ""{c2.Path}"" 422#r ""{c1.Path}"" 430#r ""{c2.Path}"" 448Diagnostic(ErrorCode.ERR_NoImplicitConv, "c2").WithArguments($"C [{c2.Path}]", $"C [{c1.Path}]")); 632var s0 = await CSharpScript.RunAsync($@"#r ""{file1.Path}"""); 634var s2 = await s1.ContinueWithAsync($@"#r ""{file2.Path}"""); 646Assert.Equal(fileBase1.Path, ((PortableExecutableReference)libBaseRefAndSymbol.Key).FilePath); 690var s0 = await CSharpScript.RunAsync($@"#r ""{file1.Path}"""); 692var s2 = await s1.ContinueWithAsync($@"#r ""{file2.Path}"""); 704Assert.Equal(fileBase1.Path, ((PortableExecutableReference)libBaseRefAndSymbol.Key).FilePath); 756var s0 = await CSharpScript.RunAsync($@"#r ""{file1.Path}"""); 758var s2 = await s1.ContinueWithAsync($@"#r ""{file2.Path}"""); 824var s0 = await CSharpScript.RunAsync($@"#r ""{file1.Path}"""); 826var s2 = await s1.ContinueWithAsync($@"#r ""{file2.Path}"""); 892var s0 = await CSharpScript.RunAsync($@"#r ""{file1.Path}"""); 894var s2 = await s1.ContinueWithAsync($@"#r ""{file2.Path}"""); 960var s0 = await CSharpScript.RunAsync($@"#r ""{file1.Path}"""); 962var s2 = await s1.ContinueWithAsync($@"#r ""{file2.Path}"""); 1028var s0 = await CSharpScript.RunAsync($@"#r ""{file1.Path}"""); 1030var s2 = await s1.ContinueWithAsync($@"#r ""{file2.Path}"""); 1096var s0 = await CSharpScript.RunAsync($@"#r ""{file1.Path}"""); 1099var s2 = await s1.ContinueWithAsync($@"#r ""{file2.Path}"""); 1122var s0 = await CSharpScript.RunAsync("C c;", ScriptOptions.Default.WithReferences(libFile.Path));
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (43)
CommandLineRunnerTests.cs (22)
340""{script.Path}"" 347args: new[] { $@"@""{rsp.Path}""", "/arg5", "--", "/arg7" }, 371args: new[] { script.Path, "arg1", "arg2", "arg3" }); 388args: new[] { script.Path, "@arg1", "@arg2", "@arg3" }); 406{script.Path} 414args: new[] { $"@{rsp.Path}", "/arg5", "--", "/arg7" }, 437args: new[] { "--", script.Path, "@arg1", "@arg2", "@arg3" }); 523script.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 }); 751var csi = CreateRunner(new[] { "b.csx" }, responseFile: rsp.Path); 780var runner = CreateRunner(new[] { "/i", init.Path }, input: 800var runner = CreateRunner(new[] { $@"/r:""{reference.Path}""", "/i", init.Path }, input: 807{init.Path}(2,3): error CS1002: {CSharpResources.ERR_SemicolonExpected} 815$@"{init.Path}(2,3): error CS1002: {CSharpResources.ERR_SemicolonExpected}", 907$@"#r ""{file1.Path}"" 909#r ""{file2.Path}"" 916> #r ""{file1.Path}"" 918> #r ""{file2.Path}"" 921{string.Format(ScriptingResources.AssemblyAlreadyLoaded, libBaseName, "0.0.0.0", fileBase1.Path, fileBase2.Path)}
InteractiveSessionReferencesTests.cs (9)
41#r ""{libFile.Path}"" 87var libDRef = MetadataReference.CreateFromFile(libDFile.Path); 95var r1 = swapReferences ? libBFile.Path : libAFile.Path; 96var r2 = swapReferences ? libAFile.Path : libBFile.Path; 132var libBRef = MetadataReference.CreateFromFile(libBFile.Path); 138#r ""{libAFile.Path}"" 144File.Move(libBFile.Path, Path.Combine(dir.Path, "libB.dll"));
InteractiveSessionTests.cs (12)
1212lib1.Emit(file1.Path); 1220lib2.Emit(file2.Path); 1223#r ""{file1.Path}"" 1224#r ""{file2.Path}"" 1235lib.Emit(file.Path); 1237string dir = Path.Combine(Path.GetDirectoryName(file.Path), "subdir"); 1238string libFileName = Path.GetFileName(file.Path); 1253lib.Emit(file.Path); 1255string root = Path.GetPathRoot(file.Path); 1256string unrooted = file.Path[root.Length..]; 1294var r2 = CSharpScript.Create($@"#r ""{fileMain.Path}""").ContinueWith($@"M.X.F").RunAsync().Result.ReturnValue; 1325var r2 = CSharpScript.Create($@"#r ""{fileMain.Path}""").ContinueWith($@"M.X.F").RunAsync().Result.ReturnValue;
Microsoft.CodeAnalysis.CSharp.Semantic.UnitTests (1)
Semantics\SemanticErrorTests.cs (1)
21804var comp = CreateCompilationWithMscorlib40AndDocumentationComments(string.Format(sourceTemplate, xmlFile.Path));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (76)
Compilation\GetUnusedImportDirectivesTests.cs (1)
212var snkPath = Temp.CreateFile().WriteAllBytes(TestResources.General.snKey).Path;
Compilation\ReferenceManagerTests.cs (10)
852string p1 = Temp.CreateFile().WriteAllBytes(TestResources.General.MDTestLib1).Path; 924string p1 = dir.CreateFile("netModule1.netmodule").WriteAllBytes(TestResources.SymbolsTests.netModule.netModule1).Path; 993string p1 = Temp.CreateFile().WriteAllBytes(ResourcesNet451.SystemCore).Path; 994string p2 = Temp.CreateFile().CopyContentFrom(p1).Path; 1013var p1 = Temp.CreateFile().WriteAllBytes(ResourcesNet451.System).Path; 1014var p2 = Temp.CreateFile().WriteAllBytes(ResourcesNet20.System).Path; 1043var ref1 = AssemblyMetadata.CreateFromFile(exe1.Path).GetReference(aliases: ImmutableArray.Create("A1")); 1044var ref2 = AssemblyMetadata.CreateFromFile(exe2.Path).GetReference(aliases: ImmutableArray.Create("A2")); 1270var path1 = Temp.CreateFile().WriteAllBytes(TestResources.General.MDTestLib1).Path; 1271var path2 = Temp.CreateFile().WriteAllBytes(TestResources.General.MDTestLib2).Path;
DocumentationComments\DocumentationCommentCompilerTests.cs (51)
2752string xmlFilePath = xmlFile.Path; 2787string xmlFilePath = xmlFile.Path; 2825string xmlFilePath = xmlFile.Path; 2860string xmlFilePath = xmlFile.Path; 2896string xmlFilePath = xmlFile.Path; 3050var comp = CreateCompilationUtil(string.Format(sourceTemplate, xmlFile.Path)); 3121var comp = CreateCompilationUtil(string.Format(sourceTemplate, xmlFile.Path)); 3147var xmlFilePath = xmlFile.Path; 3184var xmlFilePath1 = xmlFile1.Path; 3187var xmlFilePath2 = xmlFile2.Path; 3220var xmlFilePath = xmlFile.Path; 3254var xmlFilePath1 = xmlFile1.Path; 3257var xmlFilePath2 = xmlFile2.Path; 3287var xmlFilePath = xmlFile.Path; 3321var xmlFilePath1 = xmlFile1.Path; 3324var xmlFilePath2 = xmlFile2.Path; 3354var xmlFilePath = xmlFile.Path; 3386var xmlFilePath = xmlFile.Path; 3420var xmlFilePath = xmlFile.Path; 3474var xmlFilePath = xmlFile.Path; 3513var xmlFilePath1 = xmlFile1.Path; 3516var xmlFilePath2 = xmlFile2.Path; 3552var xmlFilePath = xmlFile.Path; 3629var xmlFilePath = xmlFile.Path; 3664var xmlFilePath = xmlFile.Path; 3699var xmlFilePath = xmlFile.Path; 3746var xmlFilePath = xmlFile.Path; 3787var xmlFilePath = xmlFile.Path; 3841var xmlFilePath = xmlFile.Path; 3886var xmlFilePath = xmlFile.Path; 3963var xmlFilePath = xmlFile.Path; 4043var xmlFilePath = xmlFile.Path; 4114var xmlFilePath = xmlFile.Path; 4158var xmlFilePath = xmlFile.Path; 4196var xmlFilePath = xmlFile.Path; 4237var xmlFilePath = xmlFile.Path; 4273var xmlFilePath = xmlFile.Path; 4315var xmlFilePath = xmlFile.Path; 4385var xmlFilePath = xmlFile.Path; 4554var xmlFilePath = xmlFile.Path; 5274var comp = CreateCompilationUtil(string.Format(sourceTemplate, xmlFile.Path)); 5292Assert.Equal(string.Format(expectedTemplate, TestHelpers.AsXmlCommentText(xmlFile.Path)), actual); 6523var xmlFilePath = xmlFile.Path; 6613string fullPath = xmlFile.Path; 6637/// <include file='file://" + xmlFile.Path + @"' path='hello'/> 6644@"<include file='file://" + xmlFile.Path + @"' path='hello'/>"). 6645WithArguments("file://" + xmlFile.Path, "hello", "File not found.").WithLocation(2, 5)); 6655string xmlFilePath = Path.GetFileName(xmlFile.Path); 6656string dirPath = Path.GetDirectoryName(xmlFile.Path); 6707/// <include file='" + xmlFile.Path + @"' path='hello'/> 6755var xmlFilePath = xmlFile.Path;
DocumentationComments\DocumentationModeTests.cs (1)
369var xmlFilePath = xmlFile.Path;
Symbols\CompilationCreationTests.cs (9)
2676var data = Temp.CreateFile().WriteAllBytes(ResourcesNet451.SystemData).Path; 2677var core = Temp.CreateFile().WriteAllBytes(ResourcesNet451.SystemCore).Path; 2678var xml = Temp.CreateFile().WriteAllBytes(ResourcesNet451.SystemXml).Path; 2679var system = Temp.CreateFile().WriteAllBytes(ResourcesNet451.System).Path; 2721var data = Temp.CreateFile().WriteAllBytes(ResourcesNet451.SystemData).Path; 2722var core = Temp.CreateFile().WriteAllBytes(ResourcesNet451.SystemCore).Path; 2723var system = Temp.CreateFile().WriteAllBytes(ResourcesNet451.System).Path; 2773var csClasses01 = Temp.CreateFile().WriteAllBytes(TestResources.MetadataTests.InterfaceAndClass.CSClasses01).Path; 2774var csInterfaces01 = Temp.CreateFile().WriteAllBytes(TestResources.MetadataTests.InterfaceAndClass.CSInterfaces01).Path;
Symbols\Metadata\PE\TypeForwarders.cs (2)
1556var result = ProcessUtilities.RunAndGetOutput(asmB.Path); 1564result = ProcessUtilities.RunAndGetOutput(asmB2.Path);
Symbols\SymbolErrorTests.cs (2)
7055ilBytes = ReadFromFile(reference.Path); 7124ilBytes = ReadFromFile(reference.Path);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CSharpTestBase.cs (1)
1442return MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path));
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (82)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (79)
513var sourceTreeA1 = SyntaxFactory.ParseSyntaxTree(SourceText.From(sourceBytesA1, sourceBytesA1.Length, encodingA, SourceHashAlgorithms.Default), TestOptions.Regular, sourceFileA.Path); 514var sourceTreeB1 = SyntaxFactory.ParseSyntaxTree(SourceText.From(sourceBytesB1, sourceBytesB1.Length, encodingB, SourceHashAlgorithms.Default), TestOptions.Regular, sourceFileB.Path); 515var sourceTreeC1 = SyntaxFactory.ParseSyntaxTree(SourceText.From(sourceBytesC1, sourceBytesC1.Length, encodingC, SourceHashAlgorithm.Sha1), TestOptions.Regular, sourceFileC.Path); 536loader: new WorkspaceFileTextLoader(solution.Services, sourceFileA.Path, encodingA), 537filePath: sourceFileA.Path)); 543loader: new WorkspaceFileTextLoader(solution.Services, sourceFileB.Path, encodingB), 544filePath: sourceFileB.Path)); 550loader: new WorkspaceFileTextLoader(solution.Services, sourceFileC.Path, encodingC), 551filePath: sourceFileC.Path)); 557loader: new WorkspaceFileTextLoader(solution.Services, sourceFileE.Path, encodingE), 558filePath: sourceFileE.Path)); 579filePath: sourceFileD.Path)); 597solution = solution.WithDocumentTextLoader(documentIdB, new WorkspaceFileTextLoader(solution.Services, sourceFileB.Path, encodingB), PreservationMode.PreserveValue); 604AssertEx.Equal(new[] { $"{projectPId}: Warning ENC1005: {string.Format(FeaturesResources.DocumentIsOutOfSyncWithDebuggee, sourceFileB.Path)}" }, InspectDiagnostics(emitDiagnostics)); 648solution = solution.WithProjectOutputFilePath(document.Project.Id, moduleFile.Path); 649_mockCompilationOutputsProvider = _ => new CompilationOutputFiles(moduleFile.Path); 719solution = solution.WithProjectOutputFilePath(document1.Project.Id, moduleFile.Path).AddDocument(documentInfo); 721_mockCompilationOutputsProvider = _ => new CompilationOutputFiles(moduleFile.Path); 795var sourceFilePath = dir.CreateFile(sourceFileName).WriteAllText(source, Encoding.UTF8).Path; 896using var stream = File.OpenRead(moduleFile.Path); 911_mockCompilationOutputsProvider = _ => new CompilationOutputFiles(moduleFile.Path); 931AssertEx.Equal(new[] { $"{document2.Project.Id}: Error ENC1001: {string.Format(FeaturesResources.ErrorReadingFile, moduleFile.Path, expectedErrorMessage)}" }, InspectDiagnostics(emitDiagnostics)); 982AddDocument("a.cs", CreateText(source1), filePath: sourceFile.Path); 987var moduleId = EmitAndLoadLibraryToDebuggee(source1, sourceFilePath: sourceFile.Path); 1012AssertEx.Equal(new[] { $"{project.Id}: Warning ENC1006: {string.Format(FeaturesResources.UnableToReadSourceFileOrPdb, sourceFile.Path)}" }, InspectDiagnostics(emitDiagnostics)); 1035AddDocument("a.cs", SourceText.From(source1, Encoding.UTF8, SourceHashAlgorithm.Sha1), filePath: sourceFile.Path); 1040var moduleId = EmitAndLoadLibraryToDebuggee(source1, sourceFilePath: sourceFile.Path, checksumAlgorithm: SourceHashAlgorithms.Default); 1049using var fileLock = File.Open(sourceFile.Path, FileMode.Open, FileAccess.Read, FileShare.None); 1059AssertEx.Equal(new[] { $"{project.Id}: Warning ENC1006: {string.Format(FeaturesResources.UnableToReadSourceFileOrPdb, sourceFile.Path)}" }, InspectDiagnostics(emitDiagnostics)); 1094AddDocument("test.cs", CreateText(sourceA), filePath: sourceFileA.Path); 1099EmitAndLoadLibraryToDebuggee(sourceA, sourceFilePath: sourceFileA.Path); 1111var documentB = project.AddDocument("file2.cs", CreateText(sourceB), filePath: sourceFileB.Path); 1184var moduleId = EmitLibrary(source1, sourceFilePath: sourceFile.Path); 1191var document0 = project.AddDocument("a.cs", CreateText(source0), filePath: sourceFile.Path); 1346AddDocument(documentId, "test.cs", SourceText.From(source1, encoding, SourceHashAlgorithm.Sha1), filePath: sourceFile.Path); 1349var moduleId = EmitAndLoadLibraryToDebuggee(source1, sourceFilePath: sourceFile.Path, encoding: encoding, checksumAlgorithm: SourceHashAlgorithm.Sha256); 1573var moduleId = EmitAndLoadLibraryToDebuggee(source0, sourceFilePath: sourceFile.Path); 1579var document1 = project.AddDocument("a.cs", CreateText(source1), filePath: sourceFile.Path); 1601AssertEx.Equal(new[] { $"{project.Id}: Warning ENC1005: {string.Format(FeaturesResources.DocumentIsOutOfSyncWithDebuggee, sourceFile.Path)}" }, InspectDiagnostics(emitDiagnostics)); 1677AddDocument("test.cs", CreateText(source1), filePath: sourceFile.Path); 1682var moduleId = EmitAndLoadLibraryToDebuggee(source1, sourceFilePath: sourceFile.Path); 1721AddDocument("test.cs", CreateText(source1), filePath: sourceFile.Path); 1726var moduleId = EmitLibrary(source1, sourceFilePath: sourceFile.Path); 2091var mvidA = EmitAndLoadLibraryToDebuggee(sourceA1, sourceFilePath: sourceFileA.Path, assemblyName: "A"); 2092var mvidB = EmitAndLoadLibraryToDebuggee(sourceB1, sourceFilePath: sourceFileB.Path, assemblyName: "B"); 2103sourceFileA.Path, 2108sourceFileB.Path, 2118AddDocument("b.cs", CreateText(sourceB2), filePath: sourceFileB.Path); 2431AddDocument("test.cs", CreateText("class C1 { void M() { System.Console.WriteLine(0); } }"), filePath: sourceFile.Path); 2440Assert.Equal(sourceFile.Path, filePath); 2448var moduleId = EmitAndLoadLibraryToDebuggee(source1, sourceFilePath: sourceFile.Path); 2477solution = solution.WithDocumentText(documentId, CreateTextFromFile(sourceFile.Path)); 2519AddDocument("test.cs", CreateText(source2), filePath: sourceFile.Path); 2526var moduleId = EmitAndLoadLibraryToDebuggee(source1, sourceFilePath: sourceFile.Path); 2545AssertEx.Equal(new[] { $"{project.Id}: Warning ENC1005: {string.Format(FeaturesResources.DocumentIsOutOfSyncWithDebuggee, sourceFile.Path)}" }, InspectDiagnostics(emitDiagnostics)); 2590var moduleId = EmitAndLoadLibraryToDebuggee(source1, sourceFilePath: sourceFile.Path); 2613var document1 = project.AddDocument("test.cs", sourceText1, filePath: sourceFile.Path); 2649AddDocument("test.cs", CreateText("class C1 { void M() { System.Console.WriteLine(0); } }"), filePath: sourceFile.Path); 2654var moduleId = EmitLibrary(sourceOnDisk, sourceFilePath: sourceFile.Path); 2834_mockCompilationOutputsProvider = _ => new CompilationOutputFiles(moduleFile.Path, pdbFile.Path); 3349(project.Id == projectA.Id) ? new CompilationOutputFiles(moduleFileA.Path, pdbFileA.Path) : 3350(project.Id == projectB.Id) ? new CompilationOutputFiles(moduleFileB.Path, pdbFileB.Path) : 4466var moduleId = EmitLibrary(source1, sourceFileA.Path, assemblyName: "Proj"); 4480loader: new WorkspaceFileTextLoader(solution.Services, sourceFileA.Path, Encoding.UTF8), 4481filePath: sourceFileA.Path)); 4552var moduleId = EmitLibrary(source1, sourceFileA.Path, assemblyName: "Proj"); 4567loader: new WorkspaceFileTextLoader(solution.Services, sourceFileA.Path, Encoding.UTF8), 4568filePath: sourceFileA.Path)); 4620var moduleId = EmitLibrary(source1, sourceFileA.Path, assemblyName: "Proj"); 4634loader: new WorkspaceFileTextLoader(solution.Services, sourceFileA.Path, Encoding.UTF8), 4635filePath: sourceFileA.Path)); 4699loader: new WorkspaceFileTextLoader(workspace.Services.SolutionServices, sourceFile.Path, Encoding.UTF8), 4700filePath: sourceFile.Path)); 4705var moduleId = EmitAndLoadLibraryToDebuggee(source1, sourceFilePath: sourceFile.Path); 4709File.WriteAllText(sourceFile.Path, source2, Encoding.UTF8); 4722Assert.Equal(sourceFile.Path, key);
Emit\CompilationOutputFilesTests.cs (2)
40var outputs = new CompilationOutputFiles(dllFile.Path, pdbFile.Path);
Utilities\SymbolEquivalenceComparerTests.cs (1)
1699var bytes = File.ReadAllBytes(tempAssembly.Path);
Microsoft.CodeAnalysis.LanguageServerIndexFormat.Generator.UnitTests (1)
CompilerInvocationTests.vb (1)
150""to"": """ + ruleSet.Path.Replace("\", "\\") + """
Microsoft.CodeAnalysis.Scripting.Desktop.UnitTests (23)
MetadataShadowCopyProviderTests.cs (23)
88var sc1 = _provider.GetMetadataShadowCopy(dll.Path, MetadataImageKind.Assembly); 89var sc2 = _provider.GetMetadataShadowCopy(dll.Path, MetadataImageKind.Assembly); 91Assert.Equal(dll.Path, sc1.PrimaryModule.OriginalPath); 92Assert.NotEqual(dll.Path, sc1.PrimaryModule.FullPath); 96Assert.Equal(File.ReadAllBytes(dll.Path), File.ReadAllBytes(sc1.PrimaryModule.FullPath)); 97Assert.Equal(File.ReadAllBytes(doc.Path), File.ReadAllBytes(sc1.DocumentationFile.FullPath)); 105_provider.SuppressShadowCopy(dll.Path); 107var sc1 = _provider.GetMetadataShadowCopy(dll.Path, MetadataImageKind.Assembly); 127var sc1 = _provider.GetMetadataShadowCopy(dll.Path, MetadataImageKind.Assembly); 128Assert.NotEqual(dll.Path, sc1.PrimaryModule.FullPath); 140string path0 = dir.CreateFile("MultiModule.dll").WriteAllBytes(TestResources.SymbolsTests.MultiModule.MultiModuleDll).Path; 141string path1 = dir.CreateFile("mod2.netmodule").WriteAllBytes(TestResources.SymbolsTests.MultiModule.mod2).Path; 142string path2 = dir.CreateFile("mod3.netmodule").WriteAllBytes(TestResources.SymbolsTests.MultiModule.mod3).Path; 186var f0 = Temp.CreateFile().WriteAllText("bogus").Path; 189string f1 = Temp.CreateFile().WriteAllBytes(TestResources.SymbolsTests.MultiModule.MultiModuleDll).Path; 200var sc1 = _provider.GetMetadataShadowCopy(dll.Path, MetadataImageKind.Assembly); 201var sc2 = _provider.GetMetadataShadowCopy(dll.Path, MetadataImageKind.Assembly); 203var md1 = _provider.GetMetadata(dll.Path, MetadataImageKind.Assembly); 213var sc3a = _provider.GetMetadataShadowCopy(dll2.Path, MetadataImageKind.Module); 230var sc = provider.GetMetadataShadowCopy(dll.Path, MetadataImageKind.Assembly); 236sc = provider.GetMetadataShadowCopy(dll.Path, MetadataImageKind.Assembly); 242sc = provider.GetMetadataShadowCopy(dll.Path, MetadataImageKind.Assembly); 248sc = provider.GetMetadataShadowCopy(dll.Path, MetadataImageKind.Assembly);
Microsoft.CodeAnalysis.Scripting.UnitTests (6)
RuntimeMetadataReferenceResolverTests.cs (6)
32packageResolver: new PackageResolver(ImmutableDictionary<string, ImmutableArray<string>>.Empty.Add("nuget:N/1.0", ImmutableArray.Create(assembly1.Path, assembly2.Path))), 38AssertEx.SetEqual(actualReferences.SelectAsArray(r => r.FilePath), assembly1.Path, assembly2.Path); 44AssertEx.SetEqual(actualReferences.SelectAsArray(r => r.FilePath), assembly2.Path); 59AssertEx.SetEqual(actualReferences.SelectAsArray(r => r.FilePath), assembly2.Path);
Microsoft.CodeAnalysis.Test.Utilities (10)
AssemblyLoadTestFixture.cs (3)
341", MetadataReference.CreateFromFile(delta1InAnalyzerReferencesDelta1.Path), compilerReference); 485var fileInfo = new FileInfo(tempFile.Path); 488return tempFile.Path;
Metadata\IlasmUtilities.cs (3)
68string sourceFileName = Path.GetFileNameWithoutExtension(sourceFile.Path); 72Path.ChangeExtension(Path.GetFileName(sourceFile.Path), "dll")); 99var arguments = $"\"{sourceFile.Path}\" -DLL {(autoInherit ? "" : "-noautoinherit")} -out=\"{assemblyPath}\"";
TempFiles\DisposableFile.cs (4)
29if (Path != null) 33File.Delete(Path); 40DeleteFileOnClose(Path); 48{1}: {2}", Path, ex.GetType().Name, ex.Message), ex);
Microsoft.CodeAnalysis.UnitTests (102)
AnalyzerAssemblyLoaderTests.cs (18)
267var delta1Copy = tempDir.CreateDirectory("a").CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta1).Path; 457var deltaFile = tempDir.CreateDirectory("a").CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta1).Path; 458var gammaFile = tempDir.CreateDirectory("b").CreateFile("Gamma.dll").CopyContentFrom(testFixture.Gamma).Path; 495var deltaFile1 = tempDir.CreateDirectory("a").CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta1).Path; 497var gammaFile = tempSubDir.CreateFile("Gamma.dll").CopyContentFrom(testFixture.Gamma).Path; 498var deltaFile2 = tempSubDir.CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta1).Path; 548var deltaFile = tempDir.CreateDirectory("a").CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta1).Path; 549var gammaFile = tempDir.CreateDirectory("b").CreateFile("Gamma.dll").CopyContentFrom(testFixture.Gamma).Path; 865var epsilonFile = tempDir1.CreateFile("Epsilon.dll").CopyContentFrom(testFixture.Epsilon).Path; 866var delta1File = tempDir1.CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta1).Path; 867var delta2File = tempDir2.CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta2).Path; 1125var destFile = tempRoot.CreateDirectory().CreateOrOpenFile($"{assembly.GetName().Name}.dll").Path; 1160var deltaCopy = tempDir.CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta1).Path; 1185var deltaCopy = tempDir.CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta1).Path; 1220var delta1File = tempDir1.CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta1).Path; 1221var delta2File = tempDir2.CreateFile("Delta.dll").CopyContentFrom(testFixture.Delta2).Path; 1222var gammaFile = tempDir3.CreateFile("Gamma.dll").CopyContentFrom(testFixture.Gamma).Path; 1276var path = tempFile.Path;
Analyzers\AnalyzerFileReferenceTests.cs (4)
199var textFile = directory.CreateFile("Goo.txt").WriteAllText("I am the very model of a modern major general.").Path; 231var textFile = directory.CreateFile("Goo.txt").WriteAllText("I am the very model of a modern major general.").Path; 319args: new[] { "/nologo", $@"/analyzer:""{_testFixture.AnalyzerWithLaterFakeCompilerDependency}""", "/nostdlib", $@"/r:""{corlib}""", "/out:something.dll", source.Path }, 348args: new[] { "/nologo", $@"/analyzer:""{_testFixture.AnalyzerWithFakeCompilerDependency}""", $@"/analyzer:""{_testFixture.AnalyzerWithFakeCompilerDependency}""", "/nostdlib", $@"/r:""{corlib}""", "/out:something.dll", source.Path },
AssemblyUtilitiesTests.cs (17)
36var alphaDll = directory.CopyFile(_testFixture.Alpha).Path; 47var alphaDll = directory.CopyFile(_testFixture.Alpha).Path; 48var betaDll = directory.CopyFile(_testFixture.Beta).Path; 59var alphaDll = directory.CopyFile(_testFixture.Alpha).Path; 60var gammaDll = directory.CopyFile(_testFixture.Gamma).Path; 95var assemblyFile = directory.CreateFile("FakeAssembly.dll").Path; 107var assemblyFile = directory.CreateFile("FakeAssembly.dll").Path; 108var satelliteFile = directory.CreateFile("FakeAssembly.resources.dll").Path; 120var assemblyFile = directory.CreateFile("FakeAssembly.dll").Path; 121var satelliteFile = directory.CreateDirectory("de").CreateFile("FakeAssembly.resources.dll").Path; 133var assemblyFile = directory.CreateFile("FakeAssembly.dll").Path; 134var satelliteFile = directory.CreateDirectory("de").CreateDirectory("FakeAssembly.resources").CreateFile("FakeAssembly.resources.dll").Path; 146var assemblyFile = directory.CreateFile("FakeAssembly.dll").Path; 147var satelliteFileDE = directory.CreateDirectory("de").CreateFile("FakeAssembly.resources.dll").Path; 148var satelliteFileFR = directory.CreateDirectory("fr").CreateFile("FakeAssembly.resources.dll").Path; 160var assemblyFile = directory.CreateFile("FakeAssembly.dll").Path; 161var satelliteFile = directory.CreateDirectory("de").CreateDirectory("OtherAssembly.resources").CreateFile("FakeAssembly.resources.dll").Path;
CommonCommandLineParserTests.cs (14)
45return RuleSet.LoadEffectiveRuleSetFromFile(file.Path); 48return RuleSetProcessor.LoadFromFile(file.Path); 474var ruleSet = RuleSet.LoadEffectiveRuleSetFromFile(file.Path); 989RuleSet.LoadEffectiveRuleSetFromFile(file.Path); 994Assert.Contains(string.Format(CodeAnalysisResources.InvalidRuleSetInclude, newFile.Path, string.Format(CodeAnalysisResources.RuleSetBadAttributeValue, "Action", "Default")), e.Message, StringComparison.Ordinal); 1014var includePaths = RuleSet.GetEffectiveIncludesFromFile(file.Path); 1017Assert.Equal(expected: file.Path, actual: includePaths[0]); 1051var includePaths = RuleSet.GetEffectiveIncludesFromFile(file.Path); 1054Assert.Equal(expected: file.Path, actual: includePaths[0]); 1055Assert.Equal(expected: include.Path, actual: includePaths[1]); 1103var includePaths = RuleSet.GetEffectiveIncludesFromFile(file.Path); 1106Assert.Equal(expected: file.Path, actual: includePaths[0]); 1107Assert.Equal(expected: include1.Path, actual: includePaths[1]); 1108Assert.Equal(expected: include2.Path, actual: includePaths[2]);
FileSystem\RelativePathResolverTests.cs (2)
167var f1 = dir1.CreateFile("f.dll").Path; 168var f2 = dir2.CreateFile("f.dll").Path;
MetadataReferences\AssemblyIdentityComparerTests.cs (1)
632policyPath: appConfig.Path);
MetadataReferences\AssemblyMetadataTests.cs (2)
59var mm = dir.CreateFile("MultiModule.dll").WriteAllBytes(TestResources.SymbolsTests.MultiModule.MultiModuleDll).Path; 142var metadata = AssemblyMetadata.CreateFromFile(invalidModuleName.Path);
MetadataReferences\AssemblyPortabilityPolicyTests.cs (28)
75var stream = new FileStream(appConfig.Path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); 80Assert.Throws<COMException>(() => FusionAssemblyPortabilityPolicy.LoadFromFile(appConfig.Path)); 89Assert.Throws<COMException>(() => FusionAssemblyPortabilityPolicy.LoadFromFile(appConfig.Path)); 105Assert.Throws<COMException>(() => FusionAssemblyPortabilityPolicy.LoadFromFile(appConfig.Path)); 125var stream = new FileStream(appConfig.Path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); 127AssertIsEnabled(appConfig.Path, platform: false, nonPlatform: true, fusionOnly: true); 142<linkedConfiguration href=""file://" + appConfig2.Path + @"""/> 161AssertIsEnabled(appConfig1.Path, platform: false, nonPlatform: true); 175AssertIsEnabled(appConfig.Path, platform: true, nonPlatform: true); 183AssertIsEnabled(appConfig.Path, platform: true, nonPlatform: true); 193AssertIsEnabled(appConfig.Path, platform: true, nonPlatform: true); 209AssertIsEnabled(appConfig.Path, platform: true, nonPlatform: true); 227AssertIsEnabled(appConfig.Path, platform: true, nonPlatform: true); 245AssertIsEnabled(appConfig.Path, platform: false, nonPlatform: true); 263AssertIsEnabled(appConfig.Path, platform: true, nonPlatform: false); 281AssertIsEnabled(appConfig.Path, platform: true, nonPlatform: false); 300AssertIsEnabled(appConfig.Path, platform: false, nonPlatform: false); 320AssertIsEnabled(appConfig.Path, platform: true, nonPlatform: false); 344AssertIsEnabled(appConfig.Path, platform: true, nonPlatform: true); 364AssertIsEnabled(appConfig.Path, platform: true, nonPlatform: true); 381AssertIsEnabled(appConfig.Path, platform: true, nonPlatform: true); 389var policy = FusionAssemblyPortabilityPolicy.LoadFromFile(appConfig.Path); 402var policy1 = FusionAssemblyPortabilityPolicy.LoadFromFile(appConfig.Path); 403var policy2 = FusionAssemblyPortabilityPolicy.LoadFromFile(appConfig.Path); 408policy2 = FusionAssemblyPortabilityPolicy.LoadFromFile(appConfig.Path); 413policy2 = FusionAssemblyPortabilityPolicy.LoadFromFile(appConfig.Path); 427policy2 = FusionAssemblyPortabilityPolicy.LoadFromFile(appConfig.Path); 432policy2 = FusionAssemblyPortabilityPolicy.LoadFromFile(appConfig2.Path);
MetadataReferences\MetadataReferenceTests.cs (12)
96var stream = File.OpenRead(file.Path); 110File.Delete(file.Path); 163var r = MetadataReference.CreateFromFile(file.Path, 166Assert.Equal(file.Path, r.FilePath); 167Assert.Equal(file.Path, r.Display); 173Assert.Equal(props, MetadataReference.CreateFromFile(file.Path, props).Properties); 176File.Delete(file.Path); 187var r = MetadataReference.CreateFromFile(file.Path, MetadataReferenceProperties.Module); 189Assert.Equal(file.Path, r.FilePath); 190Assert.Equal(file.Path, r.Display); 196Assert.Equal(props, MetadataReference.CreateFromFile(file.Path, props).Properties); 199File.Delete(file.Path);
Text\StringTextDecodingTests.cs (4)
218string path = Temp.CreateFile().WriteAllBytes(encoding.GetBytes(expectedText)).Path; 306File.WriteAllText(tmpFile.Path, expectedText, encoding); 308using (FileStream fs = new FileStream(tmpFile.Path, FileMode.Open, FileAccess.Read)) 322using (FileStream fs = new FileStream(tmpFile.Path, FileMode.Open, FileAccess.Read))
Microsoft.CodeAnalysis.VisualBasic.CommandLine.UnitTests (208)
CommandLineBreakingChanges.vb (15)
25").Path 28Dim output = ProcessUtilities.RunAndGetOutput("cmd", "/C """ & s_basicCompilerExecutable & """ /nologo /preferreduilang:en /warnaserror+ /warnaserror- /out:" & tempBinary.Path & " " & src & " > " & tempLog.Path, expectedRetCode:=0) 42CleanupAllGeneratedFiles(tempBinary.Path) 43CleanupAllGeneratedFiles(tempLog.Path) 57</text>.Value).Path 59Dim output = ProcessUtilities.RunAndGetOutput("cmd", "/C """ & s_basicCompilerExecutable & """ /nologo /preferreduilang:en /optionstrict:custom /nowarn:41008 /warnaserror+ " & src & " > " & tempOut.Path, expectedRetCode:=1) 89</text>.Value).Path 91Dim output = ProcessUtilities.RunAndGetOutput("cmd", "/C """ & s_basicCompilerExecutable & """ /nologo /preferreduilang:en /optionstrict:custom /nowarn:41008 /warnaserror+ " & src & " > " & tempOut.Path, expectedRetCode:=1) 121</text>.Value).Path 123Dim output = ProcessUtilities.RunAndGetOutput("cmd", "/C """ & s_basicCompilerExecutable & """ /nologo /preferreduilang:en /optionstrict:custom /warnaserror-:42025 /warnaserror+ " & src & " > " & tempOut.Path, expectedRetCode:=1) 142CleanupAllGeneratedFiles(tempOut.Path) 156</text>.Value).Path 158Dim output = ProcessUtilities.RunAndGetOutput("cmd", "/C """ & s_basicCompilerExecutable & """ /nologo /preferreduilang:en /optionstrict:custom /warnaserror-:42025 /warnaserror+ " & src & " > " & tempOut.Path, expectedRetCode:=1) 177CleanupAllGeneratedFiles(tempOut.Path)
CommandLineTests.vb (182)
80"/analyzerconfig:" + analyzerConfig.Path, 81src.Path}) 83Assert.Equal(analyzerConfig.Path, Assert.Single(cmd.Arguments.AnalyzerConfigPaths)) 117"/analyzerconfig:" + analyzerConfig.Path, 120"/additionalfile:" + additionalFile.Path, 121src.Path}) 123Assert.Equal(analyzerConfig.Path, Assert.Single(cmd.Arguments.AnalyzerConfigPaths)) 175"/analyzerconfig:" + analyzerConfig.Path, 176src.Path}) 178Assert.Equal(analyzerConfig.Path, Assert.Single(cmd.Arguments.AnalyzerConfigPaths)) 184$"vbc : warning InvalidSeverityInAnalyzerConfig: The diagnostic 'bc42024' was given an invalid severity 'garbage' in the analyzer config file at '{analyzerConfig.Path}'. 185{src.Path}(4) : warning BC42024: Unused local variable: 'x'. 212"/analyzerconfig:" + analyzerConfig1.Path, 213"/analyzerconfig:" + analyzerConfig2.Path, 214src.Path 238Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/errorlog:errorlog", $"/doc:{docName}", "/warnaserror", src.Path}) 257Dim cmd = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/t:library", "/preferreduilang:en", $"/doc:{docName}", src.Path}) 285</text>.Value).Path 331</text>.Value).Path 357").Path 469</text>.Value).Path 510</text>.Value).Path 528</text>.Value).Path 546</text>.Value).Path 587</text>.Value).Path 608Dim src As String = Temp.CreateFile().WriteAllText("♚", New System.Text.UTF8Encoding(False)).Path 612Dim output = ProcessUtilities.RunAndGetOutput("cmd", "/C """ & s_basicCompilerExecutable & """ /nologo /preferreduilang:en /t:library " & src & " > " & tempOut.Path, expectedRetCode:=1) 627Dim src As String = Temp.CreateFile().WriteAllText("♚", New System.Text.UTF8Encoding(False)).Path 631Dim output = ProcessUtilities.RunAndGetOutput("cmd", "/C """ & s_basicCompilerExecutable & """ /utf8output /nologo /preferreduilang:en /t:library " & src & " > " & tempOut.Path, expectedRetCode:=1) 757</text>.Value).Path 779</text>.Value).Path 928/imports:System.Text</text>.Value).Path 990Dim tmpFileName As String = Temp.CreateFile().WriteAllBytes(New Byte() {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}).Path 1009End Module").Path 1010Dim badres = Temp.CreateFile().WriteAllBytes(New Byte() {0, 0}).Path 2386CleanupAllGeneratedFiles(file1.Path) 2387CleanupAllGeneratedFiles(file2.Path) 2388CleanupAllGeneratedFiles(file3.Path) 2389CleanupAllGeneratedFiles(file4.Path) 2390CleanupAllGeneratedFiles(file5.Path) 2450CleanupAllGeneratedFiles(file1.Path) 2451CleanupAllGeneratedFiles(file2.Path) 2452CleanupAllGeneratedFiles(file3.Path) 2453CleanupAllGeneratedFiles(file4.Path) 2454CleanupAllGeneratedFiles(file5.Path) 2455CleanupAllGeneratedFiles(file6.Path) 2601CleanupAllGeneratedFiles(file.Path) 2618CleanupAllGeneratedFiles(file.Path) 2640CleanupAllGeneratedFiles(file.Path) 2664Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.vb", "/ruleset:" + ruleSetFile.Path}) 2674CleanupAllGeneratedFiles(file.Path) 2698"/ruleset:" & ruleSetFile.Path, "/warnaserror", "/nowarn:42376" 2712"/warnaserror+", "/ruleset:" & ruleSetFile.Path, "/nowarn:42376" 2721CleanupAllGeneratedFiles(file.Path) 2748"/ruleset:" & ruleSetFile.Path, "/nowarn" 2763"/nowarn", "/ruleset:" & ruleSetFile.Path 2773CleanupAllGeneratedFiles(file.Path) 2798Dim vbc = New MockVisualBasicCompiler(Nothing, dir.Path, {"/nologo", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.vb", "/ruleset:" + ruleSetFile.Path}) 2807CleanupAllGeneratedFiles(file.Path) 2831Dim parsedArgs = DefaultParse(New String() {"/ruleset:" + file.Path, "a.cs"}, _baseDirectory) 2833Assert.Equal(expected:=file.Path, actual:=parsedArgs.RuleSetPath) 2856Dim parsedArgs = DefaultParse(New String() {"/ruleset:" + """" + file.Path + """", "a.cs"}, _baseDirectory) 2858Assert.Equal(expected:=file.Path, actual:=parsedArgs.RuleSetPath) 2884parsedArgs = DefaultParse(New String() {"/ruleset:" + file.Path, "a.cs"}, _baseDirectory) 2887Assert.Equal(expected:=file.Path, actual:=parsedArgs.RuleSetPath) 2892Assert.Equal(file.Path, DirectCast(err.Arguments(0), String)) 3196AssertEx.Equal(File.ReadAllBytes(sl.Path), blob) 3200CleanupAllGeneratedFiles(src.Path) 3225AssertEx.Equal(File.ReadAllBytes(sl.Path), blob) 3228CleanupAllGeneratedFiles(src.Path) 3361expectedEmbeddedMap.Add(src.Path, embed_vb) 3365expectedEmbeddedMap.Add(src2.Path, embed2_vb) 3369expectedEmbeddedMap.Add(txt.Path, embed_xyz) 3388CleanupAllGeneratedFiles(src.Path) 3620CleanupAllGeneratedFiles(file.Path) 4111CleanupAllGeneratedFiles(src.Path) 4161CleanupAllGeneratedFiles(src.Path) 4162CleanupAllGeneratedFiles(xml.Path) 4242CleanupAllGeneratedFiles(src.Path) 4243CleanupAllGeneratedFiles(xml.Path) 4262CleanupAllGeneratedFiles(src.Path) 4281CleanupAllGeneratedFiles(src.Path) 4300CleanupAllGeneratedFiles(src.Path) 4319CleanupAllGeneratedFiles(src.Path) 4338CleanupAllGeneratedFiles(src.Path) 4357CleanupAllGeneratedFiles(src.Path) 4940Dim binaryPath = Temp.CreateFile().WriteAllBytes(TestMetadata.ResourcesNet451.mscorlib).Path 5017CleanupAllGeneratedFiles(src.Path) 5034CleanupAllGeneratedFiles(src.Path) 5128CleanupAllGeneratedFiles(src.Path) 5160CleanupAllGeneratedFiles(src.Path) 5234File.Delete(sysRuntime.Path) 5240File.Delete(msCorLib.Path) 5242CleanupAllGeneratedFiles(src.Path) 5287File.Delete(msCorLib.Path) 5288CleanupAllGeneratedFiles(src.Path) 5321CleanupAllGeneratedFiles(src.Path) 5344CleanupAllGeneratedFiles(file.Path) 5747CleanupAllGeneratedFiles(file1.Path) 5748CleanupAllGeneratedFiles(file2.Path) 5932CleanupAllGeneratedFiles(file.Path) 5983CleanupAllGeneratedFiles(file.Path) 6022CleanupAllGeneratedFiles(file.Path) 6070CleanupAllGeneratedFiles(file.Path) 6114CleanupAllGeneratedFiles(file.Path) 6162CleanupAllGeneratedFiles(file.Path) 6208CleanupAllGeneratedFiles(file.Path) 6250CleanupAllGeneratedFiles(file.Path) 6254Return result.Value.Replace("PATH", file.Path).Replace("VERSION (HASH)", s_compilerVersion).Replace(vbLf, vbCrLf) 6286CleanupAllGeneratedFiles(file.Path) 6320CleanupAllGeneratedFiles(file.Path) 6354CleanupAllGeneratedFiles(file.Path) 6386CleanupAllGeneratedFiles(file.Path) 6418CleanupAllGeneratedFiles(file.Path) 6466CleanupAllGeneratedFiles(file.Path) 6803Path.GetFileName(sourceFile.Path) 6811String.Format("/win32manifest:{0}", Path.GetFileName(manifestFile.Path)), 6812Path.GetFileName(sourceFile.Path) 6836CleanupAllGeneratedFiles(sourceFile.Path) 6851Dim source As String = folder.CreateFile("src.vb").WriteAllText("").Path 6852Dim ref As String = folder.CreateFile("ref.dll").WriteAllText("").Path 6884</text>.Value).Path 6888</text>.Value).Path 6932</text>.Value).Path 6936</text>.Value).Path 6966</text>.Value).Path 6970</text>.Value).Path 7000</text>.Value).Path 7004</text>.Value).Path 7029</text>.Value).Path 7034</text>.Value).Path 7053</text>.Value).Path 7119Return Temp.CreateFile().WriteAllBytes(GetType(CommandLineTests).Assembly.GetManifestResourceStream("vbc.rsp").ReadAllBytes()).Path 7221</text>.Value).Path 7242</text>.Value).Path 7279</text>.Value).Path 7434</text>.Value).Path 7532CleanupAllGeneratedFiles(src.Path) 7588file.Path & "(4) : error BC30451: 'Goo' is not declared. It may be inaccessible due to its protection level. 7621" & file.Path & "(35) : error BC30451: 'Goo' is not declared. It may be inaccessible due to its protection level. 7629CleanupAllGeneratedFiles(file.Path) 7818sourceFile.Path 7893CleanupAllGeneratedFiles(file.Path) 8019CleanupAllGeneratedFiles(file.Path) 8174CleanupAllGeneratedFiles(file.Path) 8397CleanupAllGeneratedFiles(file.Path) 8474CleanupAllGeneratedFiles(file.Path) 8536CleanupAllGeneratedFiles(file.Path) 8585CleanupAllGeneratedFiles(src.Path) 8835</text>.Value).Path 8892</text>.Value).Path 8915</text>.Value).Path 8939</text>.Value).Path 8960</text>.Value).Path 8982</text>.Value).Path 8987</text>.Value).Path 8991</text>.Value).Path 9043CleanupAllGeneratedFiles(file.Path) 9457CleanupAllGeneratedFiles(sourceFile.Path) 9563Dim vbcPath = dir.CopyFile(s_basicCompilerExecutable).Path 9623End Class").Path 9629Dim filePath = Temp.CreateFile().WriteAllText("").Path 9686CleanupAllGeneratedFiles(file.Path) 9738CleanupAllGeneratedFiles(file.Path) 9764CleanupAllGeneratedFiles(file.Path) 9830CleanupAllGeneratedFiles(file.Path) 9858CleanupAllGeneratedFiles(file.Path) 9936additionalFlags = additionalFlags.Append("/analyzerconfig:" + analyzerConfig.Path).ToArray() 9993additionalFlags = additionalFlags.Append("/ruleset:" + ruleSetFile.Path).ToArray() 10065Dim args = {"/nologo", "/t:library", "/preferreduilang:en", src.Path} 10103Dim args = {"/warnaserror+", $"/warnaserror-:{diagnosticId}", "/nologo", "/t:library", "/preferreduilang:en", src.Path} 10149additionalFlags = additionalFlags.Append($"/analyzerconfig:{analyzerConfig.Path}").ToArray() 10192Dim globalOption = "/analyzerconfig:" + globalConfig.Path 10193Dim specificOption = "/analyzerconfig:" + analyzerConfig.Path 10223additionalFlags = additionalFlags.Append("/analyzerconfig:" & globalConfig.Path).ToArray() 10255VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference:=False, additionalFlags:={"/warnaserror+", "/analyzerconfig:" + globalConfig.Path}) 10277additionalFlags:={"/additionalfile:" & additionalFile.Path}, 10352additionalArgs = additionalArgs.Append($"/analyzerconfig:{analyzerConfig.Path}").ToArray() 10424CleanupAllGeneratedFiles(src.Path) 10446CleanupAllGeneratedFiles(src.Path) 10473CleanupAllGeneratedFiles(src.Path) 10489CleanupAllGeneratedFiles(src.Path)
SarifErrorLoggerTests.vb (4)
47Dim hello = Temp.CreateFile().WriteAllText(helloWorldVB).Path 82Dim sourceFilePath = Temp.CreateFile().WriteAllText(source).Path 123Dim sourceFilePath = Temp.CreateFile().WriteAllText(source).Path 161Dim sourceFilePath = Temp.CreateFile().WriteAllText(source).Path
TouchedFileLoggingTests.vb (7)
34Dim hello = Temp.CreateFile().WriteAllText(_helloWorldCS).Path 64Dim hello = Temp.CreateFile().WriteAllText(_helloWorldCS).Path 65Dim snkPath = Temp.CreateFile("TestKeyPair_", ".snk").WriteAllBytes(TestResources.General.snKey).Path 106]]></text>.Value).Path 114"/doc:" + xml.Path, 124expectedWrites.Add(xml.Path) 156CleanupAllGeneratedFiles(xml.Path)
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (18)
Attributes\InternalsVisibleToAndStrongNameTests.vb (13)
418<assembly: System.Reflection.AssemblyKeyFile("]]><%= snk.Path %><![CDATA[")> 425c = CreateCompilationWithMscorlib40(source1, options:=TestOptions.ReleaseModule.WithCryptoKeyFile(snk.Path).WithPublicSign(True), parseOptions:=parseOptions) 473options:=TestOptions.ReleaseDll.WithCryptoKeyFile(tmp.Path).WithStrongNameProvider(New DesktopStrongNameProvider()), 477Diagnostic(ERRID.ERR_PublicKeyFileFailure).WithArguments(tmp.Path, CodeAnalysisResources.InvalidPublicKey)) 1422Using peStream = New FileStream(file.Path, FileMode.Open) 2010Dim options = TestOptions.ReleaseDll.WithCryptoKeyFile(snk.Path).WithPublicSign(True) 2018Dim options = TestOptions.ReleaseDll.WithCryptoKeyFile(snk.Path).WithPublicSign(True) 2026Dim options = TestOptions.SigningReleaseDll.WithCryptoKeyFile(snk.Path).WithPublicSign(True) 2034Dim options = TestOptions.ReleaseDll.WithCryptoKeyFile(snk.Path).WithPublicSign(True) 2072Dim options = TestOptions.ReleaseDll.WithCryptoKeyFile(snk.Path).WithPublicSign(True) 2097Dim options = TestOptions.ReleaseDll.WithCryptoKeyFile(snk.Path).WithPublicSign(True) 2111Dim options = TestOptions.ReleaseDll.WithCryptoKeyFile(snk.Path).WithPublicSign(True).WithDelaySign(True) 2136Dim options = TestOptions.ReleaseDll.WithCryptoKeyFile(snk.Path).WithPublicSign(True).WithDelaySign(False)
Emit\ResourceTests.vb (5)
49[lib] = LoadLibraryEx(exe.Path, IntPtr.Zero, &H2) 107Dim fileVer = FileVersionInfo.GetVersionInfo(exe.Path) 136[lib] = LoadLibraryEx(exe.Path, IntPtr.Zero, &H2) 180Dim fileVer = FileVersionInfo.GetVersionInfo(exe.Path) 336[lib] = LoadLibraryEx(exeFile.Path, IntPtr.Zero, &H2)
Microsoft.CodeAnalysis.VisualBasic.Scripting.UnitTests (2)
CommandLineRunnerTests.vb (2)
89Dim runner = CreateRunner(args:={}, input:="#r """ & file1.Path & """" & vbCrLf & "? New C1().Goo()") 94> #r """ & file1.Path & """
Microsoft.CodeAnalysis.VisualBasic.Semantic.UnitTests (8)
Compilation\ReferenceManagerTests.vb (6)
798MetadataReference.CreateFromFile(tempFile1_copy1.Path), 799MetadataReference.CreateFromFile(tempFile2.Path), 800MetadataReference.CreateFromFile(tempFile1_copy2.Path)}, TestOptions.ReleaseDll) 808MetadataReference.CreateFromFile(tempFile1_copy1.Path), 809MetadataReference.CreateFromFile(tempFile2.Path), 810MetadataReference.CreateFromFile(tempFile1_copy1.Path)}, TestOptions.ReleaseDll)
Semantics\FieldInitializerBindingTests.vb (1)
1397reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path))
Semantics\GetUnusedImportDirectivesTests.vb (1)
67Dim snkPath = Temp.CreateFile().WriteAllBytes(TestResources.General.snKey).Path
Microsoft.CodeAnalysis.VisualBasic.Symbol.UnitTests (47)
DocumentationComments\DocCommentTests.vb (1)
7570Using _stream = New FileStream(xmlFile.Path, FileMode.Open, FileAccess.ReadWrite)
SymbolsTests\ExtensionMethods\ExtensionMethodTests.vb (6)
211Dim ILRef = MetadataReference.CreateFromImage(ReadFromFile(reference.Path)) 421Dim ILRef = MetadataReference.CreateFromImage(ReadFromFile(reference.Path)) 616Dim ILRef = MetadataReference.CreateFromImage(ReadFromFile(reference.Path)) 810Dim ILRef = MetadataReference.CreateFromImage(ReadFromFile(reference.Path)) 1006Dim ILRef = ModuleMetadata.CreateFromImage(File.ReadAllBytes(reference.Path)).GetReference() 2234Dim ILRef = ModuleMetadata.CreateFromImage(File.ReadAllBytes(reference.Path)).GetReference()
SymbolsTests\InaccessibleOverriding.vb (8)
351Dim proj2AssemblyName = IO.Path.GetFileNameWithoutExtension(proj2ILFile.Path) 352Dim proj2Ref = MetadataReference.CreateFromImage(ReadFromFile(proj2ILFile.Path)) 402Dim proj1Ref = MetadataReference.CreateFromImage(ReadFromFile(proj1ILFile.Path)) 482Dim proj2AssemblyName = IO.Path.GetFileNameWithoutExtension(proj2ILFile.Path) 483Dim proj2Ref = MetadataReference.CreateFromImage(ReadFromFile(proj2ILFile.Path)) 526Dim proj1Ref = MetadataReference.CreateFromImage(ReadFromFile(proj1ILFile.Path)) 623Dim ilRef = MetadataReference.CreateFromImage(ReadFromFile(reference.Path)) 709Dim ilRef = MetadataReference.CreateFromImage(ReadFromFile(reference.Path))
SymbolsTests\Metadata\PE\TypeForwarders.vb (3)
1027ilBytes = ReadFromFile(reference.Path) 1089ilBytes = ReadFromFile(reference.Path) 1208ilBytes = ReadFromFile(reference.Path)
SymbolsTests\Source\ImplementsTests.vb (8)
3872reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 3956reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 4051reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 4109reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 4178reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 4247reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 4332reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 4397reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path))
SymbolsTests\Source\OverridesTests.vb (15)
2752reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 3080reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 3182reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 3445reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 3559reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 3669reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 3778reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 3890reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 4000reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 4108reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 4779reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 5001reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 5162reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 5430reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path)) 5967reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path))
SymbolsTests\Source\TypeTests.vb (6)
2922ilBytes = ReadFromFile(reference.Path) 2988ilBytes = ReadFromFile(reference.Path) 3095ilBytes = ReadFromFile(reference.Path) 3102ilBytes = ReadFromFile(reference.Path) 3109ilBytes = ReadFromFile(reference.Path) 3140ilBytes = ReadFromFile(reference.Path)
Microsoft.CodeAnalysis.VisualBasic.Test.Utilities (2)
BasicTestBase.vb (1)
380reference = MetadataReference.CreateFromImage(ReadFromFile(tempAssembly.Path))
CompilationTestUtils.vb (1)
392ilImage = ImmutableArray.Create(File.ReadAllBytes(reference.Path))
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (1)
VisualStudioMSBuildWorkspaceTests.cs (1)
3170var expectedEditorConfigPath = SolutionDirectory.CreateOrOpenFile(".editorconfig").Path;
Microsoft.CodeAnalysis.Workspaces.UnitTests (9)
CommandLineProject\CommandLineProjectWorkspaceTests.cs (1)
41Assert.Equal(tempFile.Path, gooDoc.FilePath);
SolutionTests\SolutionTests.cs (8)
1123solution = solution.AddDocument(DocumentInfo.Create(fileDocumentId, "d.cs", loader: new FileTextLoader(fileD.Path, defaultEncoding: null), filePath: fileD.Path)); 2653.AddDocument(did, "x", new WorkspaceFileTextLoader(workspace.Services.SolutionServices, file.Path, Encoding.UTF8)); 2712.AddDocument(did, "x", new WorkspaceFileTextLoader(workspace.Services.SolutionServices, file.Path, Encoding.UTF8)); 2779.AddDocument(did, "x", new WorkspaceFileTextLoader(workspace.Services.SolutionServices, file.Path, Encoding.UTF8)); 3753var loader = new TestSmallFileTextLoader(file.Path, Encoding.UTF8); 3755var textLength = FileUtilities.GetFileLength(file.Path); 3757var expected = string.Format(WorkspacesResources.File_0_size_of_1_exceeds_maximum_allowed_size_of_2, file.Path, textLength, 1);
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (27)
PersistentStorage\AbstractPersistentStorageTests.cs (3)
985var info = SolutionInfo.Create(SolutionId.CreateNewId(), VersionStamp.Create(), solutionFile.Path); 994filePath: nullPaths ? null : projectFile.Path)); 999filePath: nullPaths ? null : documentFile.Path));
ProjectSystemShim\CPS\AnalyzersTests.cs (5)
39project.SetOptions(ImmutableArray.Create($"/ruleset:{ruleSetFile.Path}")); 63project.SetOptions(ImmutableArray.Create($"/ruleset:{ruleSetFile.Path}")); 66project.SetOptions(ImmutableArray.Create($"/ruleset:{ruleSetFile.Path}")); 80project.SetOptions(ImmutableArray.Create($"/ruleset:{ruleSetFile.Path}")); 84Assert.Equal(ruleSetFile.Path, environment.Workspace.TryGetRuleSetPathForProject(projectId));
ProjectSystemShim\CPS\CSharpCompilerOptionsTests.cs (1)
156var newFilePath = Temp.CreateFile().Path;
ProjectSystemShim\CPS\CSharpReferencesTests.cs (1)
135var analyzerAssemblyFullPath = tempRoot.CreateFile().Path;
ProjectSystemShim\LegacyProject\AnalyzersTests.cs (14)
44((IAnalyzerHost)project).SetRuleSetFile(ruleSetFile.Path); 59((IAnalyzerHost)project).SetRuleSetFile(ruleSetFile.Path); 62Assert.Equal(ruleSetFile.Path, environment.Workspace.TryGetRuleSetPathForProject(projectId)); 78((IAnalyzerHost)project).SetRuleSetFile(ruleSetFile.Path); 109((IAnalyzerHost)project).SetRuleSetFile(ruleSetFile.Path); 132((IAnalyzerHost)project).SetRuleSetFile(ruleSetFile.Path); 147var pathWithExtraBackslashes = ruleSetFile.Path.Replace(@"\", @"\\"); 153Assert.Equal(expected: ruleSetFile.Path, actual: projectRuleSetFile); 175((IAnalyzerHost)project).SetRuleSetFile(ruleSetFile.Path); 210((IAnalyzerHost)project).SetRuleSetFile(ruleSetFile.Path); 237await CSharpHelpers.CreateCSharpCPSProjectAsync(environment, "Test", binOutputPath: @"C:\test.dll", $"/ruleset:\"{ruleSetFile.Path}\""); 243((IAnalyzerHost)project).SetRuleSetFile(ruleSetFile.Path); 252File.WriteAllText(ruleSetFile.Path, ruleSetSource.Replace("Error", "Warning")); 253await environment.RaiseFileChangeAsync(ruleSetFile.Path);
ProjectSystemShim\VisualStudioCompilationOutputFilesTests.cs (3)
41var debugDirPdbPath = exactPdbPath ? pdbFile.Path : "a/y/z/lib.pdb"; 51var outputs = new CompilationOutputFilesWithImplicitPdbPath(dllFile.Path); 96var outputs = new CompilationOutputFilesWithImplicitPdbPath(dllFile.Path);
Microsoft.VisualStudio.LanguageServices.UnitTests (7)
AnalyzerSupport\AnalyzerDependencyCheckerTests.vb (5)
256Dim libraryC2 = directory2.CreateFile("C.dll").CopyContentFrom(libraryC1).Path 376Dim libraryC2 = directory2.CreateFile("C.dll").CopyContentFrom(libraryC1).Path 506Dim libraryA2 = directory2.CreateFile("A.dll").CopyContentFrom(libraryA1).Path 618Dim libraryB2 = directory2.CreateFile("B.dll").CopyContentFrom(libraryB1).Path 851Dim sourceFile = directory.CreateFile(libraryName + ".cs").WriteAllText(fileContents).Path
Diagnostics\VisualStudioDiagnosticAnalyzerProviderTests.vb (1)
55Dim hostAnalyzers = New HostDiagnosticAnalyzers(ImmutableArray.Create(Of AnalyzerReference)(New AnalyzerFileReference(analyzerFile.Path, analyzerLoader)))
ProjectSystemShim\VisualStudioAnalyzerTests.vb (1)
38Using tempRoot = New TempRoot(), analyzer = New ProjectAnalyzerReference(tempRoot.CreateFile().Path, hostDiagnosticUpdateSource, ProjectId.CreateNewId(), LanguageNames.VisualBasic)
Roslyn.VisualStudio.Next.UnitTests (11)
Remote\SnapshotSerializationTests.cs (9)
426var reference = new AnalyzerFileReference(location, new MockShadowCopyAnalyzerAssemblyLoader(ImmutableDictionary<string, string>.Empty.Add(location, file.Path))); 447var reference = new AnalyzerFileReference(location, new MockShadowCopyAnalyzerAssemblyLoader(ImmutableDictionary<string, string>.Empty.Add(location, file.Path))); 484var analyzer1 = new AnalyzerFileReference(file1.Path, TestAnalyzerAssemblyLoader.LoadNotImplemented); 485var analyzer2 = new AnalyzerFileReference(file2.Path, TestAnalyzerAssemblyLoader.LoadNotImplemented); 493AssertEx.Equal(new[] { file1.Path, file2.Path }, recovered.GetProject(project.Id).AnalyzerReferences.Select(r => r.FullPath)); 565var tempCorlibXml = tempDir.CreateFile(Path.ChangeExtension(tempCorlib.Path, "xml")); 581.AddMetadataReference(MetadataReference.CreateFromFile(tempCorlib.Path)) 703return new AnalyzerFileReference(original, new MockShadowCopyAnalyzerAssemblyLoader(ImmutableDictionary<string, string>.Empty.Add(original, shadow.Path)));
Services\ServiceHubServicesTests.cs (2)
308p1, VersionStamp.Create(), "p1", "p1", LanguageNames.CSharp, outputFilePath: file.Path, 312metadataReferences: new [] { MetadataReference.CreateFromFile(file.Path) })
VBCSCompiler.UnitTests (21)
AnalyzerConsistencyCheckerTests.cs (4)
75var emitResult = comp.Emit(file.Path); 119new CommandLineAnalyzerReference(mvidAlpha1.Path), 120new CommandLineAnalyzerReference(mvidAlpha2.Path)); 193var analyzerReferences = ImmutableArray.Create(new CommandLineAnalyzerReference(compFile.Path));
CompilerServerTests.cs (15)
223var srcFile = tempDir.CreateFile("test.cs").WriteAllText(source).Path; 264var result = ProcessUtilities.Run(file.Path, "", Path.GetDirectoryName(file.Path)); 341var srcFile = _tempDirectory.CreateFile("test.cs").WriteAllText("♕").Path; 363var srcFile = _tempDirectory.CreateFile("test.vb").WriteAllText("♕").Path; 387var srcFile = _tempDirectory.CreateFile("test.vb").WriteAllText("♕").Path; 1148var srcFile = _tempDirectory.CreateFile("test.cs").WriteAllText("♕").Path; 1170var srcFile = _tempDirectory.CreateFile("test.vb").WriteAllText(@"♕").Path; 1197var srcFile = _tempDirectory.CreateFile("test.cs").WriteAllText("♕").Path; 1219var srcFile = _tempDirectory.CreateFile("test.vb").WriteAllText(@"♕").Path; 1304var srcFile = _tempDirectory.CreateFile("test.cs").WriteAllText("♕").Path; 1328var srcFile = _tempDirectory.CreateFile("test.cs").WriteAllText("♕").Path; 1394var srcFile = _tempDirectory.CreateFile("test.cs").WriteAllText("").Path; 1428var srcFile = _tempDirectory.CreateFile("test.vb").WriteAllText("").Path; 1464var serverExe = dir.CopyFile(compilerServerExecutable).Path;
TouchedFileLoggingTests.cs (2)
57var source1 = Temp.CreateFile().WriteAllText(HelloWorldCS).Path; 107var source1 = Temp.CreateFile().WriteAllText(HelloWorldVB).Path;