534 references to Path
InteractiveHost.UnitTests (4)
InteractiveHostCoreInitTests.cs (1)
76
AssertEx.AssertEqualToleratingWhitespaceDifferences(PrintSearchPaths(srcDir.
Path
), output);
InteractiveHostDesktopInitTests.cs (1)
49
AssertEx.AssertEqualToleratingWhitespaceDifferences(PrintSearchPaths(srcDir.
Path
), output);
InteractiveHostDesktopTests.cs (2)
705
rspFile.WriteAllText($"/lib:{directory1.
Path
} /r:Assembly2.dll {initFile.Path}");
719
var expectedSearchPaths = PrintSearchPaths(fxDir, directory1.
Path
);
Microsoft.Build.Tasks.CodeAnalysis.Sdk.UnitTests (1)
src\Compilers\Core\MSBuildTaskTests\TestUtilities\IntegrationTestBase.cs (1)
88
currentDirectory.
Path
,
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (24)
CopyRefAssemblyTests.cs (2)
35
SourcePath = Path.Combine(dir.
Path
, "does_not_exist.dll")
66
var dest = Path.Combine(dir.
Path
, "dest.dll");
DotNetSdkTests.cs (8)
28
var root1 = Path.GetFullPath(ProjectDir.
Path
+ Path.DirectorySeparatorChar);
29
var root2 = Path.GetFullPath(sourcePackageDir.
Path
+ Path.DirectorySeparatorChar);
38
var sourceLinkJsonPath = Path.Combine(ObjDir.
Path
, ProjectName + ".sourcelink.json");
432
Path.Combine(ProjectDir.
Path
, ".editorconfig"),
493
Path.Combine(ProjectDir.
Path
, ".editorconfig"),
528
Path.Combine(ProjectDir.
Path
, ".editorconfig"),
573
var dir = Directory.GetParent(ProjectDir.
Path
);
653
Path.Combine(ProjectDir.
Path
, ".editorconfig"),
IntegrationTests.cs (2)
18
return new DisposableFile(Path.Combine(directory.
Path
, resultFileName));
695
var result = RunCommandLineCompiler(_msbuildExecutable, "/p:UseSharedCompilation=false", testDir.
Path
);
RuntimeHostInfoTests.cs (5)
49
new("PATH", globalDotNetDir.
Path
),
56
AssertEx.Equal(NormalizePath(globalDotNetDir.
Path
), NormalizePath(result));
81
var symlinkPath = Path.Combine(binDir.
Path
, $"dotnet{PlatformInformation.ExeExtension}");
88
new("PATH", binDir.
Path
),
95
AssertEx.Equal(NormalizePath(globalDotNetDir.
Path
), NormalizePath(result));
TestUtilities\DotNetSdkTestBase.cs (6)
196
Assert.True(File.Exists(Path.Combine(ObjDir.
Path
, "project.assets.json")));
197
Assert.True(File.Exists(Path.Combine(ObjDir.
Path
, ProjectFileName + ".nuget.g.props")));
198
Assert.True(File.Exists(Path.Combine(ObjDir.
Path
, ProjectFileName + ".nuget.g.targets")));
221
var evaluationResultsFile = Path.Combine(OutDir.
Path
, "EvaluationResult.txt");
223
EmitTestHelperProps(ObjDir.
Path
, ProjectFileName, customProps, uploadUtil);
224
EmitTestHelperTargets(ObjDir.
Path
, evaluationResultsFile, ProjectFileName, expressions, customTargets, uploadUtil);
TestUtilities\IntegrationTestBase.cs (1)
88
currentDirectory.
Path
,
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (345)
CommandLineIVTTests.cs (4)
44
var outputFilePath = $"{Path.GetFileName(dir.
Path
)}{Path.DirectorySeparatorChar}{Path.GetFileName(source2.Path)}";
121
var outputFilePath = $"{Path.GetFileName(dir.
Path
)}{Path.DirectorySeparatorChar}{Path.GetFileName(source2.Path)}";
200
var outputFilePath = $"{Path.GetFileName(dir.
Path
)}{Path.DirectorySeparatorChar}{Path.GetFileName(source2.Path)}";
285
var outputFilePath = $"{Path.GetFileName(dir.
Path
)}{Path.DirectorySeparatorChar}{Path.GetFileName(source2.Path)}";
CommandLineTestBase.cs (2)
41
File.WriteAllBytes(Path.Combine(dir.
Path
, "mscorlib.dll"), Net461.ReferenceInfos.mscorlib.ImageBytes);
42
return dir.
Path
;
CommandLineTests.cs (316)
147
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/errorlog:errorlog", $"/doc:{docName}", "/warnaserror", src.Path });
154
string exePath = Path.Combine(dir.
Path
, "temp.exe");
167
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/t:library", "/preferreduilang:en", $"/doc:{docName}", src.Path });
174
var xmlPath = Path.Combine(dir.
Path
, docName);
196
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
289
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
341
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
377
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
390
$"error CS8700: Multiple analyzer config files cannot be in the same directory ('{dir.
Path
}').",
401
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", src.Path });
410
var result = ProcessUtilities.Run(Path.Combine(dir.
Path
, "sjis.exe"), arguments: "", workingDirectory: dir.
Path
);
412
Assert.Equal("星野 八郎太", File.ReadAllText(Path.Combine(dir.
Path
, "output.txt"), Encoding.GetEncoding(932)));
421
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/codepage:932", src.Path });
430
var result = ProcessUtilities.Run(Path.Combine(dir.
Path
, "sjis.exe"), arguments: "", workingDirectory: dir.
Path
);
432
Assert.Equal("星野 八郎太", File.ReadAllText(Path.Combine(dir.
Path
, "output.txt"), Encoding.GetEncoding(932)));
478
string basePath = baseDir.
Path
;
491
{ Path.Combine(dirSubDir.
Path
, @"b.rsp"), @"
566
var parser = CSharpCommandLineParser.Default.Parse(new[] { "file.cs", $"-out:{parentDir.
Path
}", "/noSdkPath" }, parentDir.
Path
, null);
584
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/nosdkpath", "/r:System.dll", "a.cs" });
623
args = DefaultParse(new[] { "/main:Test", "a.cs" }, folder.
Path
);
627
args = DefaultParse(new[] { "/main:\"Test\"", "a.cs" }, folder.
Path
);
631
args = DefaultParse(new[] { "/main:\"Test.Class1\"", "a.cs" }, folder.
Path
);
635
args = DefaultParse(new[] { "/m:Test", "a.cs" }, folder.
Path
);
639
args = DefaultParse(new[] { "/m:\"Test\"", "a.cs" }, folder.
Path
);
643
args = DefaultParse(new[] { "/m:\"Test.Class1\"", "a.cs" }, folder.
Path
);
648
args = DefaultParse(new[] { "/m:\"решения.Class1\"", "a.cs" }, folder.
Path
);
660
args = DefaultParse(new[] { "-debug+/debug:portable" }, folder.
Path
);
692
int exitCode = CreateCSharpCompiler(null, folder.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", @"/recurse:.", "/out:abc.dll" }).Run(outWriter);
697
exitCode = CreateCSharpCompiler(null, folder.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", @"/recurse:. ", "/out:abc.dll" }).Run(outWriter);
702
exitCode = CreateCSharpCompiler(null, folder.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", @"/recurse: . ", "/out:abc.dll" }).Run(outWriter);
707
exitCode = CreateCSharpCompiler(null, folder.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", @"/recurse:././.", "/out:abc.dll" }).Run(outWriter);
714
args = DefaultParse(new[] { @"/recurse:*.cp*", @"/recurse:a\*.c*", @"/out:a.dll" }, folder.
Path
);
717
AssertEx.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);
719
args = DefaultParse(new[] { @"/recurse:.\\\\\\*.cs", @"/out:a.dll" }, folder.
Path
);
724
args = DefaultParse(new[] { @"/recurse:.////*.cs", @"/out:a.dll" }, folder.
Path
);
1876
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/langversion:?" });
2250
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/debug:embedded", "/sourcelink:sl.json", "a.cs" });
2254
var peStream = File.OpenRead(Path.Combine(dir.
Path
, "a.exe"));
2282
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/debug:portable", "/sourcelink:sl.json", "a.cs" });
2286
var pdbStream = File.OpenRead(Path.Combine(dir.
Path
, "a.pdb"));
2311
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/debug:full", "/sourcelink:sl.json", "a.cs" });
2315
var pdbStream = File.OpenRead(Path.Combine(dir.
Path
, "a.pdb"));
2454
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", debugSwitch, embedSwitch, "embed.cs", "embed2.cs" });
2478
using (var peReader = new PEReader(File.OpenRead(Path.Combine(dir.
Path
, "embed.exe"))))
2485
MetadataReaderProvider.FromPortablePdbStream(File.OpenRead(Path.Combine(dir.
Path
, "embed.pdb"))))
2513
symReader = SymReaderFactory.CreateReader(File.OpenRead(Path.Combine(dir.
Path
, "embed.pdb")));
2785
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/a:missing.dll", "a.cs" });
2808
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + typeof(object).Assembly.Location, "a.cs" });
2925
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs" });
2961
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs", "/ruleset:" + ruleSetFile.Path });
2994
var csc = CreateCSharpCompiler(null, dir.
Path
,
3005
csc = CreateCSharpCompiler(null, dir.
Path
,
3041
dir.
Path
);
3073
dir.
Path
);
3106
dir.
Path
);
3139
dir.
Path
);
3173
dir.
Path
);
3207
dir.
Path
);
3241
dir.
Path
);
3275
dir.
Path
);
3310
dir.
Path
);
3345
dir.
Path
);
3369
dir.
Path
);
3402
dir.
Path
);
3435
dir.
Path
);
3469
dir.
Path
);
3513
var csc = CreateCSharpCompiler(null, dir.
Path
,
3524
csc = CreateCSharpCompiler(null, dir.
Path
,
3582
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", "a.cs" });
3592
" + Path.GetFullPath(Path.Combine(dir.
Path
, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Goo' does not exist in the current context
3593
" + Path.GetFullPath(Path.Combine(dir.
Path
, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Goo' does not exist in the current context
3610
csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/fullpaths", "a.cs" });
3615
" + Path.Combine(dir.
Path
, @"a.cs") + @"(8,13): error CS0103: The name 'Goo' does not exist in the current context
3619
" + Path.GetFullPath(Path.Combine(dir.
Path
, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Goo' does not exist in the current context
3620
" + Path.GetFullPath(Path.Combine(dir.
Path
, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Goo' does not exist in the current context
3627
" + Path.Combine(dir.
Path
, @"a.cs") + @"(32,13): error CS0103: The name 'Goo' does not exist in the current context
4491
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/modulename:hocusPocus ", "/out:" + exeName + " ", file1.Path });
4499
Assert.Equal(1, Directory.EnumerateFiles(dir.
Path
, exeName).Count());
4501
using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.
Path
, "aa.exe"))))
4678
var parsedArgs = DefaultParse(new[] { @"/lib:lib1", @"/libpath:lib2", @"/libpaths:lib3", "a.cs" }, dir.
Path
, sdkDirectory: sdkDirectory);
4682
lib1.
Path
,
4683
lib2.
Path
,
4684
lib3.
Path
6003
string tempDir = Temp.CreateDirectory().
Path
;
6039
string tempDir = Temp.CreateDirectory().
Path
;
6072
string tempDir = Temp.CreateDirectory().
Path
;
6106
string tempDir = Temp.CreateDirectory().
Path
;
6118
string tempDir = Temp.CreateDirectory().
Path
;
6956
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/target:exe", "a.cs" });
6978
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/target:exe", "a.cs" });
7002
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/target:library", "a.cs" });
7025
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/target:library", "/preferreduilang:en", "a.cs" });
7070
var csc = CreateCSharpCompiler(null, dir.
Path
, commandLineArguments.Concat(new[] { inputName1, inputName2 }).ToArray());
7078
Assert.Equal(1, Directory.EnumerateFiles(dir.
Path
, "*" + PathUtilities.GetExtension(expectedOutputName)).Count());
7079
Assert.Equal(1, Directory.EnumerateFiles(dir.
Path
, expectedOutputName).Count());
7081
using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.
Path
, expectedOutputName))))
7114
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/r:missing.dll", "a.cs" });
7190
var csc = CreateCSharpCompiler(null, dir.
Path
, commandLineArguments.Concat(new[] { fileName }).ToArray());
7213
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\a.exe" });
7217
Assert.Contains("error CS2012: Cannot open '" + dir.
Path
+ "\\sub\\a.exe' for writing", outWriter.ToString(), StringComparison.Ordinal);
7239
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\" });
7267
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\ " });
7295
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:aaa:\\a.exe" });
7321
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out: " });
7355
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "a.cs", "/keyfile:key.snk", });
7377
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "a.cs", "/keycontainer:bbb", });
7400
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "a.cs", "/keyFile:key.snk", "/features:UseLegacyStrongNameProvider" });
7420
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "a.cs", "/features:disable-length-based-switch" });
7424
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "a.cs" });
7515
var output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $"/nologo /t:library \"{file}\"", startFolder: dir.
Path
);
7518
output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $"/nologo /preferreduilang:en /t:library /codepage:20127 \"{file}\"", expectedRetCode: 1, startFolder: dir.
Path
); // 20127: US-ASCII
7796
csc = CreateCSharpCompiler(null, dir.
Path
, new[]
7806
csc = CreateCSharpCompiler(null, dir.
Path
, new[]
7820
IntPtr lib = LoadLibraryEx(Path.Combine(dir.
Path
, outputFileName), IntPtr.Zero, 0x00000002);
8415
csc = CreateCSharpCompiler(null, Temp.CreateDirectory().
Path
, new[] { source, "/preferreduilang:en" });
8442
csc = CreateCSharpCompiler(null, Temp.CreateDirectory().
Path
, new[] { source, "/preferreduilang:en", "/fullpaths" });
8771
int exitCode1 = CreateCSharpCompiler(null, dir.
Path
, new[] { "/debug:full", "/out:Program.exe", source1.Path }).Run(outWriter);
8777
int exitCode2 = CreateCSharpCompiler(null, dir.
Path
, new[] { "/debug:full", "/out:Program.exe", source2.Path }).Run(outWriter);
8788
int exitCode3 = CreateCSharpCompiler(null, dir.
Path
, new[] { "/debug:full", "/out:Program.exe", source3.Path }).Run(outWriter);
8833
int exitCode = CreateCSharpCompiler(null, dir.
Path
, new[] { "/target:library", "/debug:full", libSrc.Path }).Run(outWriter);
8850
AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.
Path
).Select(p => Path.GetFileName(p)).Order());
8907
AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.
Path
).Select(p => Path.GetFileName(p)).Order());
8915
Directory.Delete(dir.
Path
, recursive: false);
8940
int exitCode = CreateCSharpCompiler(null, dir.
Path
, new[] { "/target:library", "/preferreduilang:en", libSrc.Path }).Run(outWriter);
8948
AssertEx.Equal(new[] { "Lib.cs", "Lib.dll" }, Directory.GetFiles(dir.
Path
).Select(p => Path.GetFileName(p)).Order());
8959
int exitCode = CreateCSharpCompiler(null, dir.
Path
, new[] { "/target:library", "/preferreduilang:en", libSrc.Path }).Run(outWriter);
8960
Assert.Contains($"error CS2012: Cannot open '{libDll.
Path
}' for writing", outWriter.ToString());
8981
var srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
);
9003
var srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
);
9026
var srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
);
9050
var srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
);
9284
TestCS2002(commandLineArgs, tempDir.
Path
, 0, aWrnString);
9290
TestCS2002(commandLineArgs, tempDir.
Path
, 0, warnings);
9296
TestCS2002(commandLineArgs, tempDir.
Path
, 0, AWrnString);
9302
TestCS2002(commandLineArgs, tempDir.
Path
, 0, String.Empty);
9308
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9313
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9318
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9323
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9327
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9333
var formattedcs1504Str = String.Format(cs1504, PathUtilities.CombineAbsoluteAndRelativePaths(tempParentDir.
Path
, "tmpDir\a.cs"), "Illegal characters in path.");
9334
TestCS2002(commandLineArgs, tempParentDir.
Path
, 1, formattedcs1504Str);
9342
TestCS2002(commandLineArgs, tempParentDir.
Path
, 1, (string[])null, parseDiags);
9349
TestCS2002(commandLineArgs, tempParentDir.
Path
, 1, (string[])null, parseDiags);
9353
var formattedcs1504 = String.Format(cs1504, PathUtilities.CombineAbsoluteAndRelativePaths(tempParentDir.
Path
, @":a.cs"), @"The given path's format is not supported.");
9354
TestCS2002(commandLineArgs, tempParentDir.
Path
, 1, formattedcs1504);
9357
System.IO.Directory.Delete(tempParentDir.
Path
, true);
9899
args = DefaultParse(new[] { "/additionalfile:web*.config", "a.cs" }, baseDir.
Path
);
9902
Assert.Equal(Path.Combine(baseDir.
Path
, "web1.config"), args.AdditionalFiles[0].Path);
9903
Assert.Equal(Path.Combine(baseDir.
Path
, "web2.config"), args.AdditionalFiles[1].Path);
9904
Assert.Equal(Path.Combine(baseDir.
Path
, "web3.config"), args.AdditionalFiles[2].Path);
10121
Directory.Delete(dir.
Path
, true);
10180
Directory.Delete(dir.
Path
, true);
10246
Directory.Delete(dir.
Path
, true);
10353
Directory.Delete(dir.
Path
, true);
10450
Directory.Delete(dir.
Path
, true);
10487
Directory.Delete(dir.
Path
, true);
10527
Directory.Delete(dir.
Path
, true);
10579
var csc = CreateCSharpCompiler(null, sourceDir.
Path
, args, analyzers: analyzers, generators: generators, driverCache: driverCache);
11617
var csc = CreateCSharpCompiler(null, dir.
Path
, args);
11621
var exePath = Path.Combine(dir.
Path
, "a.exe");
11633
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11640
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11641
AssertPdbEmit(dir, pdbPath, @"q:\a.pdb", $@"/pathmap:{dir.
Path
}=q:\");
11647
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11648
AssertPdbEmit(dir, pdbPath, @"q:\a.pdb", $@"/pathmap:{dir.
Path
}=q:\", "/deterministic");
11655
var pdbPath = Path.Combine(dir.
Path
, @"pdb\a.pdb");
11656
AssertPdbEmit(dir, pdbPath, @"q:\pdb\a.pdb", $@"/pathmap:{dir.
Path
}=q:\");
11663
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11670
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11671
AssertPdbEmit(dir, pdbPath, @"/a.pdb", $@"/pathmap:{dir.
Path
}=/");
11677
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11678
AssertPdbEmit(dir, pdbPath, "/goo/a.pdb", $"/pathmap:{dir.
Path
}=/goo,{dir.
Path
}{PathUtilities.DirectorySeparatorChar}=/bar");
11743
var output = ProcessUtilities.RunAndGetOutput(csc32exe.Path, $@"/nologo /debug:full /deterministic /out:Program.exe /pathmap:""{dir32.
Path
}""=X:\ ""{sourceFile.Path}""", expectedRetCode: 0, startFolder: dir32.
Path
);
11746
output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $@"/nologo /debug:full /deterministic /out:Program.exe /pathmap:""{dir64.
Path
}""=X:\ ""{sourceFile.Path}""", expectedRetCode: 0, startFolder: dir64.
Path
);
11796
var csc = CreateCSharpCompiler(null, dir.
Path
,
11802
var exe = Path.Combine(dir.
Path
, "a.exe");
11811
var doc = Path.Combine(dir.
Path
, "doc.xml");
11832
var output = ProcessUtilities.RunAndGetOutput(exe, startFolder: dir.
Path
);
11835
var refDll = Path.Combine(refDir.
Path
, "a.dll");
11847
CleanupAllGeneratedFiles(dir.
Path
);
11848
CleanupAllGeneratedFiles(refDir.
Path
);
11861
var csc = CreateCSharpCompiler(null, dir.
Path
,
11866
var dll = Path.Combine(dir.
Path
, "a.dll");
11869
var refDll = Path.Combine(dir.
Path
, Path.Combine("ref", "a.dll"));
11875
CleanupAllGeneratedFiles(dir.
Path
);
11912
var csc = CreateCSharpCompiler(null, dir.
Path
,
11918
var refDll = Path.Combine(dir.
Path
, "a.dll");
11929
var pdb = Path.Combine(dir.
Path
, "a.pdb");
11932
var doc = Path.Combine(dir.
Path
, "doc.xml");
11960
CleanupAllGeneratedFiles(dir.
Path
);
12021
var result = ProcessUtilities.Run(cscPath, arguments: "/nologo /t:library unknown.cs", workingDirectory: dir.
Path
);
12029
result = ProcessUtilities.Run(cscPath, arguments: "/nologo /t:library unknown.cs", workingDirectory: dir.
Path
);
12250
var cscCopy = Path.Combine(dir.
Path
, "csc.exe");
12258
workingDirectory: dir.
Path
,
12266
result = ProcessUtilities.Run(cscCopy, arguments, workingDirectory: dir.
Path
);
12273
workingDirectory: dir.
Path
,
12290
var csc = CreateCSharpCompiler(null, dir.
Path
, args);
12294
var exePath = Path.Combine(dir.
Path
, "a.exe");
12312
var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.
Path
, sdkDir: null, tempDir: tempDir.
Path
);
12328
var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.
Path
, sdkDir: null, tempDir: tempDir.
Path
);
12348
var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.
Path
, sdkDir: null, tempDir: tempDir.
Path
);
12369
var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.
Path
, sdkDir: null, tempDir: tempDir.
Path
);
13420
var cmd = CreateCSharpCompiler(null, dir.
Path
, arguments,
13482
string binaryPath = Path.Combine(dir.
Path
, "temp.dll");
13485
string pdbPath = Path.Combine(dir.
Path
, pdbName);
13488
string xmlDocFilePath = Path.Combine(dir.
Path
, docName);
13528
string binaryPath = Path.Combine(dir.
Path
, "temp.dll");
13531
string pdbPath = Path.Combine(dir.
Path
, pdbName);
13534
string xmlDocFilePath = Path.Combine(dir.
Path
, docName);
13578
string binaryPath = Path.Combine(dir.
Path
, "temp.dll");
13581
string pdbPath = Path.Combine(dir.
Path
, pdbName);
13584
string xmlDocFilePath = Path.Combine(dir.
Path
, docName);
13609
string binaryPath = Path.Combine(dir.
Path
, "temp.dll");
13665
var cmd = CreateCSharpCompiler(null, dir.
Path
, arguments,
13756
var cmd = CreateCSharpCompiler(null, dir.
Path
, args, analyzers: new[] { analyzer });
13793
var cmd = CreateCSharpCompiler(null, dir.
Path
, args, analyzers: new[] { analyzer });
13926
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.
Path
, generator);
13927
ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.
Path
, generatorPrefix, $"generatedSource.cs"), generatedSource } }, dir, true);
13931
Directory.Delete(dir.
Path
, true);
13967
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.
Path
, generator);
13968
ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.
Path
, generatorPrefix, "generatedSource.cs"), generatedSource } }, dir, true);
14006
var generator1Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.
Path
, generator);
14007
var generator2Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.
Path
, generator2);
14011
{ Path.Combine(dir.
Path
, generator1Prefix, source1Name), source1},
14012
{ Path.Combine(dir.
Path
, generator2Prefix, source2Name), source2},
14017
Directory.Delete(dir.
Path
, true);
14027
var genPath1 = Path.Combine(dir.
Path
, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint1.cs");
14028
var genPath2 = Path.Combine(dir.
Path
, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint2.cs");
14047
using (Stream peStream = File.OpenRead(Path.Combine(dir.
Path
, "checksum.exe")), pdbStream = File.OpenRead(Path.Combine(dir.
Path
, "checksum.pdb")))
14060
Directory.Delete(dir.
Path
, true);
14090
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null);
14092
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator);
14095
{ Path.Combine(generatedDir.
Path
, generatorPrefix, expectedDir), new() { { expectedFileName, generatedSource } } }
14100
Directory.Delete(dir.
Path
, true);
14116
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator1 }, analyzers: null);
14118
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator1);
14119
ValidateWrittenSources(new() { { Path.Combine(generatedDir.
Path
, generatorPrefix), new() { { "generatedSource.cs", generatedSource1 } } } });
14124
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator2 }, analyzers: null);
14126
ValidateWrittenSources(new() { { Path.Combine(generatedDir.
Path
, generatorPrefix), new() { { "generatedSource.cs", generatedSource2 } } } });
14130
Directory.Delete(dir.
Path
, true);
14151
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator, generator2 }, analyzers: null);
14153
var generator1Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator);
14154
var generator2Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator2);
14164
Directory.Delete(dir.
Path
, true);
14192
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null);
14194
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator);
14197
{ Path.Combine(generatedDir.
Path
, generatorPrefix, expectedDir), new() { { generatedFileName, generatedSource } } }
14202
Directory.Delete(dir.
Path
, true);
14211
var snk = Temp.CreateFile("TestKeyPair_", ".snk", dir.
Path
).WriteAllBytes(TestResources.General.snKey);
14213
var virtualSnProvider = new DesktopStrongNameProvider(ImmutableArray.Create(dir.
Path
));
14228
var path = Path.Combine(dir.
Path
, Guid.NewGuid().ToString() + ".dll");
14243
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/analyzer:" + gen1, "/analyzer:" + gen2 }.ToArray());
14250
{ Path.Combine(generatedDir.
Path
, "generator", "TestGenerator"), new() { { "generatedSource.cs", "//from version 2.0.0.0" } } }
14268
ValidateWrittenSources(new() { { generatedDir.
Path
, new() } });
14272
Directory.Delete(dir.
Path
, true);
14284
var generatedDirPath = Path.Combine(dir.
Path
, "noexist");
14293
Directory.Delete(dir.
Path
, true);
14309
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null);
14311
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator);
14312
ValidateWrittenSources(new() { { Path.Combine(generatedDir.
Path
, generatorPrefix), new() { { "generatedSource.cs", generatedSource } } } });
14316
Directory.Delete(dir.
Path
, true);
14385
Directory.Delete(dir.
Path
, true);
14401
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, $"/touchedfiles:{dir.
Path
}/touched", "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null);
14403
var touchedFiles = Directory.GetFiles(dir.
Path
, "touched*");
14406
string[] writtenText = File.ReadAllLines(Path.Combine(dir.
Path
, "touched.write"));
14413
Directory.Delete(dir.
Path
, true);
14481
Directory.Delete(dir.
Path
, true);
14540
$"/out:{objDir.
Path
}/embed.exe",
14550
Directory.Delete(dir.
Path
, true);
14606
pathMapArgument = pathMapArgument.Replace("DIRPATH", dir.
Path
).Replace("SRCDIRPATH", srcDir.
Path
).Replace("OBJDIRPATH", objDir.
Path
);
14612
"/generatedfilesout:" + objDir.
Path
,
14623
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(objDir.
Path
, generator);
14631
Directory.Delete(dir.
Path
, true);
14719
var cmd = CreateCSharpCompiler(null, dir.
Path
, args, generators: new[] { generator });
14779
var cmd = CreateCSharpCompiler(null, dir.
Path
,
14799
var cmd = CreateCSharpCompiler(null, dir.
Path
,
14824
var cmd = CreateCSharpCompiler(null, dir.
Path
,
14844
var cmd = CreateCSharpCompiler(null, dir.
Path
,
14884
Directory.Delete(dir.
Path
, true);
14950
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15031
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15245
CleanupAllGeneratedFiles(srcDirectory.
Path
);
15401
var generatorPath = Path.Combine(directory.
Path
, "generator.dll");
15437
Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.
Path
, additionalFilePath1)));
15438
Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.
Path
, additionalFilePath2)));
15444
string path2 = additionalFile2?.Path ?? Path.Combine(srcDirectory.
Path
, additionalFilePath2);
15461
CleanupAllGeneratedFiles(srcDirectory.
Path
);
15556
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15567
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15608
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15619
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15690
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15701
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15743
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15754
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15821
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15860
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15900
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
SarifErrorLoggerTests.cs (10)
43
var errorLogFile = Path.Combine(errorLogDir.
Path
, "ErrorLog.txt");
74
var errorLogFile = Path.Combine(errorLogDir.
Path
, "ErrorLog.txt");
108
var errorLogFile = Path.Combine(errorLogDir.
Path
, "ErrorLog.txt");
140
var errorLogFile = Path.Combine(outputDir.
Path
, "ErrorLog.txt");
141
var outputFilePath = Path.Combine(outputDir.
Path
, "test.dll");
177
var errorLogFile = Path.Combine(errorLogDir.
Path
, "ErrorLog.txt");
212
var errorLogFile = Path.Combine(errorLogDir.
Path
, "ErrorLog.txt");
247
var errorLogFile = Path.Combine(errorLogDir.
Path
, "ErrorLog.txt");
282
var errorLogFile = Path.Combine(errorLogDir.
Path
, "ErrorLog.txt");
315
var errorLogFile = Path.Combine(errorLogDir.
Path
, "ErrorLog.txt");
SarifV2ErrorLoggerTests.cs (8)
447
var errorLogFile = Path.Combine(errorLogDir.
Path
, "ErrorLog.txt");
529
var errorLogFile = Path.Combine(errorLogDir.
Path
, "ErrorLog.txt");
599
var errorLogFile = Path.Combine(errorLogDir.
Path
, "ErrorLog.txt");
669
Assert.False(File.Exists(Path.Combine(mappedDir.
Path
, "otherfile.cs")));
674
#line 123 "{{mappedDir.
Path
}}\otherfile.cs"
679
var errorLogFile = Path.Combine(errorLogDir.
Path
, "ErrorLog.txt");
713
Assert.Equal($"file:///{mappedDir.
Path
.Replace(@"\", "/")}/otherfile.cs", (string)resultFile["uri"]);
739
Assert.Equal(expected: $"file:///{mappedDir.
Path
.Replace(@"\", "/")}/otherfile.cs", (string)physicalLocation["artifactLocation"]["uri"]);
TouchedFileLoggingTests.cs (5)
40
var touchedBase = Path.Combine(touchedDir.
Path
, "touched");
68
var touchedBase = Path.Combine(touchedDir.
Path
, "touched");
115
var touchedBase = Path.Combine(touchedDir.
Path
, "touched");
154
var touchedBase = Path.Combine(touchedDir.
Path
, "touched");
161
"/touchedfiles:" + touchedDir.
Path
+ "\\touched",
Microsoft.CodeAnalysis.CSharp.EditorFeatures.UnitTests (4)
Completion\CompletionProviders\AppDirectiveCompletionProviderTests.cs (2)
59
var scriptFilePath = Path.Combine(tempDirectory.
Path
, "App.cs");
90
var scriptFilePath = Path.Combine(tempDirectory.
Path
, "App.cs");
Workspaces\WorkspaceTests_EditorFeatures.cs (2)
1147
var analyzerConfigPath = PathUtilities.CombineAbsoluteAndRelativePaths(Temp.CreateDirectory().
Path
, ".editorconfig");
1392
var analyzerConfigDocFilePath = PathUtilities.CombineAbsoluteAndRelativePaths(Temp.CreateDirectory().
Path
, ".editorconfig");
Microsoft.CodeAnalysis.CSharp.Emit.UnitTests (15)
Emit\CompilationEmitTests.cs (2)
4635
var dllPath = Path.Combine(tmpDir.
Path
, "assemblyname.dll");
4636
var pdbPath = Path.Combine(tmpDir.
Path
, "assemblyname.pdb");
Emit\DesktopStrongNameProviderTests.cs (13)
23
var provider = new DesktopStrongNameProvider(tempPath: tempDir.
Path
);
24
Assert.Equal(tempDir.
Path
, provider.FileSystem.GetSigningTempPath());
38
var provider1 = new DesktopStrongNameProvider(tempPath: tempDir.
Path
);
39
var provider2 = new DesktopStrongNameProvider(tempPath: tempDir.
Path
);
48
var provider1 = new DesktopStrongNameProvider(keyFileSearchPaths: [tempDir.
Path
]);
49
var provider2 = new DesktopStrongNameProvider(keyFileSearchPaths: [tempDir.
Path
]);
58
var provider1 = new DesktopStrongNameProvider(tempPath: tempDir.
Path
);
59
var provider2 = new DesktopStrongNameProvider(tempPath: tempDir.
Path
+ "2");
68
var provider1 = new DesktopStrongNameProvider(keyFileSearchPaths: [tempDir.
Path
]);
69
var provider2 = new DesktopStrongNameProvider(keyFileSearchPaths: [tempDir.
Path
+ "2"]);
78
var provider1 = new DesktopStrongNameProvider(keyFileSearchPaths: [tempDir.
Path
]);
79
var provider2 = new DesktopStrongNameProvider(keyFileSearchPaths: [tempDir.
Path
.ToUpper()]);
93
var provider = new DesktopStrongNameProvider(ImmutableArray<string>.Empty, new VirtualizedStrongNameFileSystem(tempDir.
Path
));
Microsoft.CodeAnalysis.CSharp.Emit3.UnitTests (8)
Attributes\AttributeTests_Security.cs (4)
1502
var resolver = new XmlFileResolver(tempDir.
Path
);
1585
var resolver = new XmlFileResolver(tempDir.
Path
);
1606
string filePath = Path.Combine(tempDir.
Path
, "pset_01.xml");
1629
TestOptions.ReleaseDll.WithXmlReferenceResolver(new XmlFileResolver(tempDir.
Path
)));
Attributes\EmitTestStrongNameProvider.cs (1)
25
var fileSystem = new TestStrongNameFileSystem(_signingTempDirectory.
Path
)
Attributes\InternalsVisibleToAndStrongNameTests.cs (3)
65
new DesktopStrongNameProvider(ImmutableArray.Create(keyFilePath), strongNameFileSystem: new VirtualizedStrongNameFileSystem(_signingTempDirectory.
Path
));
230
new VirtualizedStrongNameFileSystem(_signingTempDirectory.
Path
))
2857
var provider = new TestDesktopStrongNameProvider(fileSystem: new VirtualizedStrongNameFileSystem(_signingTempDirectory.
Path
))
Microsoft.CodeAnalysis.CSharp.Scripting.UnitTests (15)
CommandLineRunnerTests.cs (14)
378
workingDirectory: dir.
Path
);
481
var scriptPath = PathUtilities.CombinePathsUnchecked(PathUtilities.GetFileName(directory.
Path
), scriptName);
482
var workingDirectory = PathUtilities.GetDirectoryName(directory.
Path
);
536
var runner = CreateRunner([$"/loadpath:{dir1.
Path
}", $"/loadpaths:{dir2.
Path
};{dir3.
Path
}", main.Path]);
573
var runner = CreateRunner(["/r:4.dll", $"/lib:{dir1.
Path
}", $"/libpath:{dir2.
Path
}", $"/libpaths:{dir3.
Path
};{dir4.
Path
}", main.Path]);
594
SourcePaths.Add(@""{dir.
Path
}"")
609
> SourcePaths.Add(@""{dir.
Path
}"")
630
ReferencePaths.Add(@""{dir.
Path
}"")
645
> ReferencePaths.Add(@""{dir.
Path
}"")
InteractiveSessionReferencesTests.cs (1)
143
File.Move(libBFile.Path, Path.Combine(dir.
Path
, "libB.dll"));
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
DocumentationComments\DocumentationCommentCompilerTests.cs (2)
4714
var resolver = new XmlFileResolver(rootDir.
Path
);
8655
var path = dir.
Path
;
Microsoft.CodeAnalysis.EditorFeatures.UnitTests (1)
Emit\CompilationOutputFilesTests.cs (1)
57
Directory.Delete(dir.
Path
, recursive: true);
Microsoft.CodeAnalysis.ExternalAccess.Razor.UnitTests (5)
RazorAnalyzerAssemblyResolverTests.cs (5)
102
var dir1 = TempRoot.CreateDirectory().
Path
;
104
var dir2 = TempRoot.CreateDirectory().
Path
;
136
var dir1 = TempRoot.CreateDirectory().
Path
;
138
var dir2 = TempRoot.CreateDirectory().
Path
;
160
var dir = TempRoot.CreateDirectory().
Path
;
Microsoft.CodeAnalysis.Features.UnitTests (2)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (2)
122
AddDocument(CreateDesignTimeOnlyDocument(projectPId, name: "dt1.cs", path: Path.Combine(dir.
Path
, "dt1.cs"))).
907
var designTimeOnlyFilePath = Path.Combine(dir.
Path
, designTimeOnlyFileName);
Microsoft.CodeAnalysis.LanguageServer.UnitTests (17)
ExportProviderBuilderTests.cs (2)
89
await using var testServer = await TestLspServer.CreateAsync(new Roslyn.LanguageServer.Protocol.ClientCapabilities(), LoggerFactory, MefCacheDirectory.
Path
, includeDevKitComponents: true, [dllPath]);
165
var mefCompositions = Directory.EnumerateFiles(MefCacheDirectory.
Path
, "*.mef-composition", SearchOption.AllDirectories);
FileBasedProgramsWorkspaceTests.cs (1)
47
cacheDirectory: _mefCacheDirectory.
Path
,
LspFileChangeWatcherTests.cs (6)
31
await using var testLspServer = await TestLspServer.CreateAsync(new ClientCapabilities(), LoggerFactory, MefCacheDirectory.
Path
);
39
await using var testLspServer = await TestLspServer.CreateAsync(_clientCapabilitiesWithFileWatcherSupport, LoggerFactory, MefCacheDirectory.
Path
);
49
await using var testLspServer = await TestLspServer.CreateAsync(_clientCapabilitiesWithFileWatcherSupport, LoggerFactory, MefCacheDirectory.
Path
);
60
var context = lspFileChangeWatcher.CreateContext([new ProjectSystem.WatchedDirectory(tempDirectory.
Path
, extensionFilters: [])]);
65
Assert.Equal(tempDirectory.
Path
, watcher.GlobPattern.Second.BaseUri.Second.GetRequiredParsedUri().LocalPath);
79
await using var testLspServer = await TestLspServer.CreateAsync(_clientCapabilitiesWithFileWatcherSupport, LoggerFactory, MefCacheDirectory.
Path
);
TelemetryReporterTests.cs (1)
20
MefCacheDirectory.
Path
,
Utilities\AbstractLanguageServerClientTests.cs (3)
46
var projectPath = Path.Combine(projectDirectory.
Path
, "Project.csproj");
60
var codePath = Path.Combine(projectDirectory.
Path
, "Code.cs");
71
ExtensionLogsDirectory.
Path
,
Utilities\AbstractLanguageServerHostTests.cs (1)
32
return TestLspServer.CreateAsync(new ClientCapabilities(), LoggerFactory, MefCacheDirectory.
Path
, includeDevKitComponents);
VirtualProjectXmlProviderTests.cs (2)
47
LoggerFactory, includeDevKitComponents: false, MefCacheDirectory.
Path
, extensionPaths: null);
153
var content = await projectProvider.GetVirtualProjectContentAsync(Path.Combine(tempDir.
Path
, "BAD"), LoggerFactory.CreateLogger<VirtualProjectXmlProviderTests>(), CancellationToken.None);
WorkspaceProjectFactoryServiceTests.cs (1)
22
loggerFactory, includeDevKitComponents: false, MefCacheDirectory.
Path
, []);
Microsoft.CodeAnalysis.Rebuild.UnitTests (1)
CSharpDeterministicKeyBuilderTests.cs (1)
412
var fileSystem = new TestStrongNameFileSystem(temp.CreateDirectory().
Path
);
Microsoft.CodeAnalysis.Scripting.UnitTests (4)
RuntimeMetadataReferenceResolverTests.cs (4)
30
new RelativePathResolver(ImmutableArray.Create(directory.
Path
), directory.
Path
),
50
searchPaths: ImmutableArray.Create(directory.
Path
),
51
baseDirectory: directory.
Path
);
Microsoft.CodeAnalysis.Test.Utilities (4)
AssemblyLoadTestFixture.cs (1)
23
public string TempDirectory => _directory.
Path
;
TempFiles\DisposableDirectory.cs (3)
21
if (
Path
!= null && Directory.Exists(
Path
))
25
Directory.Delete(
Path
, recursive: true);
Microsoft.CodeAnalysis.UnitTests (17)
AnalyzerAssemblyLoaderTests.cs (2)
341
var analyzerPath = Path.Combine(tempDir.CreateDirectory("a").
Path
, "analyzer.dll");
1661
AnalyzerTestKind.ShadowLoad => new AnalyzerAssemblyLoader([new ShadowCopyAnalyzerPathResolver(Temp.CreateDirectory().
Path
)], [AnalyzerAssemblyLoader.DiskAnalyzerAssemblyResolver], alc),
Analyzers\AnalyzerFileReferenceTests.cs (5)
320
new BuildPaths(clientDir: directory.
Path
, workingDir: directory.
Path
, sdkDir: null, tempDir: null),
349
new BuildPaths(clientDir: directory.
Path
, workingDir: directory.
Path
, sdkDir: null, tempDir: null),
482
var generatorPath = Path.Combine(directory.
Path
, $"generator_{targetFramework}.dll");
CompilerResolverTests.cs (2)
53
var assembly = Loader.CompilerAnalyzerAssemblyResolver.Resolve(Loader, name, ScratchContext, TempRoot.CreateDirectory().
Path
);
60
var assembly = Loader.CompilerAnalyzerAssemblyResolver.Resolve(Loader, AssemblyInCompilerContext.GetName(), ScratchContext, TempRoot.CreateDirectory().
Path
);
FileSystem\RelativePathResolverTests.cs (2)
171
ImmutableArray.Create(dir1.
Path
, dir2.
Path
),
InvokeUtil.cs (1)
58
pathResolvers = [.. pathResolvers, new ShadowCopyAnalyzerPathResolver(tempRoot.CreateDirectory().
Path
)];
ShadowCopyAnalyzerPathResolverTests.cs (5)
25
PathResolver = new ShadowCopyAnalyzerPathResolver(TempRoot.CreateDirectory().
Path
);
55
var analyzerPath = Path.Combine(TempRoot.CreateDirectory().
Path
, "analyzer.dll");
63
var analyzerPath = Path.Combine(TempRoot.CreateDirectory().
Path
, "analyzer.dll");
77
var dir = TempRoot.CreateDirectory().
Path
;
90
var dir = TempRoot.CreateDirectory().
Path
;
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (6)
NetCoreTests.cs (4)
40
["NUGET_PACKAGES"] = _nugetCacheDir.
Path
47
workingDirectory: SolutionDirectory.
Path
,
55
RunDotNet($@"msbuild ""{solutionOrProjectFileName}"" /t:restore /bl:{Path.Combine(SolutionDirectory.
Path
, "restore.binlog")}");
60
var arguments = $@"msbuild ""{solutionOrProjectFileName}"" /bl:{Path.Combine(SolutionDirectory.
Path
, "build.binlog")}";
NewlyCreatedProjectsFromDotNetNew.cs (1)
155
var projectDirectory = SolutionDirectory.
Path
;
WorkspaceTestBase.cs (1)
35
return Path.Combine(this.SolutionDirectory.
Path
, relativeFileName);
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
CommandLineProject\CommandLineProjectWorkspaceTests.cs (1)
28
var info = CommandLineProject.CreateProjectInfo("TestProject", LanguageNames.CSharp, commandLine, tempDirectory.
Path
, ws);
SolutionTests\SolutionWithSourceGeneratorTests.cs (1)
1468
var analyzerPath = Path.Combine(tempDirectory.
Path
, "Microsoft.CodeAnalysis.TestAnalyzerReference.dll");
WorkspaceTests\AdhocWorkspaceTests.cs (1)
283
var analyzerConfigDocFilePath = PathUtilities.CombineAbsoluteAndRelativePaths(Temp.CreateDirectory().
Path
, ".editorconfig");
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (10)
PersistentStorage\AbstractPersistentStorageTests.cs (4)
873
solution = solution.AddDocument(id, "file.cs", "class C { void M() }", filePath: Path.Combine(_persistentFolder.
Path
, "file.cs"));
893
solution = solution.AddDocument(id, "file.cs", "class C { void M() }", filePath: Path.Combine(_persistentFolder.
Path
, "file.cs"));
1009
var configuration = new MockPersistentStorageConfiguration(solution.Id, persistentFolder.
Path
, throwOnFailure);
1027
var configuration = new MockPersistentStorageConfiguration(solutionKey.Id, _persistentFolder.
Path
, throwOnFailure: true);
ProjectSystemShim\TempPECompilerServiceTests.cs (2)
31
pszOutputFileName: Path.Combine(directory.
Path
, "Output.dll"),
37
optionValues: [Path.Combine(directory.
Path
, "MissingReference.dll")]);
ProjectSystemShim\VisualStudioCompilationOutputFilesTests.cs (4)
65
Directory.Delete(dir.
Path
, recursive: true);
72
var outputs = new CompilationOutputFilesWithImplicitPdbPath(Path.Combine(dir.
Path
, "nonexistent.dll"));
87
var debugDirPdbPath = Path.Combine(dir.
Path
, "nonexistent.pdb");
104
Directory.Delete(dir.
Path
, recursive: true);
VBCSCompiler.UnitTests (46)
AnalyzerConsistencyCheckerTests.cs (12)
87
var assemblyLoader = AnalyzerAssemblyLoader.CreateNonLockingLoader(directory.CreateDirectory("shadow").
Path
);
90
var result = AnalyzerConsistencyChecker.Check(directory.
Path
, analyzerReferences, assemblyLoader, Logger);
98
var assemblyLoader = AnalyzerAssemblyLoader.CreateNonLockingLoader(directory.CreateDirectory("shadow").
Path
);
113
var assemblyLoader = AnalyzerAssemblyLoader.CreateNonLockingLoader(directory.CreateDirectory("shadow").
Path
);
123
var result = AnalyzerConsistencyChecker.Check(directory.
Path
, analyzerReferences, assemblyLoader, Logger);
138
var assemblyLoader = AnalyzerAssemblyLoader.CreateNonLockingLoader(directory.CreateDirectory("shadow").
Path
);
144
directory.
Path
,
154
directory.
Path
,
187
var result = AnalyzerConsistencyChecker.Check(directory.
Path
, analyzerReferences, assemblyLoader, Logger);
210
var result = AnalyzerConsistencyChecker.Check(directory.
Path
, analyzerReferences, assemblyLoader, Logger);
228
var result = AnalyzerConsistencyChecker.Check(directory.
Path
, analyzerReferences, new ThrowingLoader(), Logger);
242
var result = AnalyzerConsistencyChecker.Check(directory.
Path
, analyzerReferences, new AnalyzerAssemblyLoader(), Logger);
BuildClientTests.cs (2)
40
workingDir: Temp.CreateDirectory().
Path
,
41
tempDir: Temp.CreateDirectory().
Path
);
BuildServerConnectionTests.cs (4)
41
var workingDirectory = TempRoot.CreateDirectory().
Path
;
70
var workingDirectory = TempRoot.CreateDirectory().
Path
;
100
ProtocolUtil.CreateEmptyCSharp(TempRoot.CreateDirectory().
Path
),
121
var workingDirectory = TempRoot.CreateDirectory().
Path
;
CompilerServerApiTest.cs (1)
115
var request = BuildRequest.Create(RequestLanguage.CSharpCompile, workingDirectory: temp.CreateDirectory().
Path
, tempDirectory: null, compilerHash: BuildProtocolConstants.GetCommitHash(), libDirectory: null, args: Array.Empty<string>());
CompilerServerTests.cs (21)
97
var filePath = Path.Combine(currentDirectory.
Path
, "netstandard.dll");
168
workingDir: currentDirectory.
Path
,
198
finalFlags = $"{flags} /shared:{serverData.PipeName} /pathmap:{tempDir.
Path
}=/ /out:{outFile} {srcFile}";
224
return new DisposableFile(Path.Combine(directory.
Path
, resultFileName));
257
var newTempDir = _tempDirectory.CreateDirectory(new string('a', 100 - _tempDirectory.
Path
.Length));
259
new[] { new KeyValuePair<string, string>("TMPDIR", newTempDir.
Path
) },
526
Assert.False(File.Exists(Path.Combine(_tempDirectory.
Path
, "hello.exe")));
556
Assert.False(File.Exists(Path.Combine(_tempDirectory.
Path
, "hello.exe")));
573
Assert.False(File.Exists(Path.Combine(_tempDirectory.
Path
, "missingfile.exe")));
591
Assert.False(File.Exists(Path.Combine(_tempDirectory.
Path
, "hello.exe")));
616
Assert.False(File.Exists(Path.Combine(_tempDirectory.
Path
, "app.exe")));
634
Assert.False(File.Exists(Path.Combine(_tempDirectory.
Path
, "missingfile.exe")));
663
Assert.False(File.Exists(Path.Combine(_tempDirectory.
Path
, "hellovb.exe")));
692
Assert.False(File.Exists(Path.Combine(_tempDirectory.
Path
, "app.exe")));
1030
$"src1.cs /shared:{serverData.PipeName} /nologo /t:library /out:" + Path.Combine(libDirectory.
Path
, "lib.dll"),
1048
additionalEnvironmentVars: new Dictionary<string, string>() { { "LIB", libDirectory.
Path
} });
1081
$"src1.vb /shared:{serverData.PipeName} /vbruntime* /nologo /t:library /out:" + Path.Combine(libDirectory.
Path
, "lib.dll"),
1100
additionalEnvironmentVars: new Dictionary<string, string>() { { "LIB", libDirectory.
Path
} });
1364
var tmp = Path.Combine(_tempDirectory.
Path
, "Temp");
1398
var tmp = Path.Combine(_tempDirectory.
Path
, "Temp");
1430
var workingDirectory = dir.
Path
;
TouchedFileLoggingTests.cs (4)
49
var loader = AnalyzerAssemblyLoader.CreateNonLockingLoader(Temp.CreateDirectory().
Path
);
60
var touchedBase = Path.Combine(touchedDir.
Path
, "touched");
100
var loader = AnalyzerAssemblyLoader.CreateNonLockingLoader(Temp.CreateDirectory().
Path
);
111
var touchedBase = Path.Combine(touchedDir.
Path
, "touched");
VBCSCompilerServerTests.cs (2)
305
var workingDirectory = TempRoot.CreateDirectory().
Path
;
346
var workingDirectory = TempRoot.CreateDirectory().
Path
;