606 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)
93
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)
93
currentDirectory.
Path
,
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (350)
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 (321)
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
);
1879
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/langversion:?" });
2253
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/debug:embedded", "/sourcelink:sl.json", "a.cs" });
2257
var peStream = File.OpenRead(Path.Combine(dir.
Path
, "a.exe"));
2285
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/debug:portable", "/sourcelink:sl.json", "a.cs" });
2289
var pdbStream = File.OpenRead(Path.Combine(dir.
Path
, "a.pdb"));
2314
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/debug:full", "/sourcelink:sl.json", "a.cs" });
2318
var pdbStream = File.OpenRead(Path.Combine(dir.
Path
, "a.pdb"));
2457
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", debugSwitch, embedSwitch, "embed.cs", "embed2.cs" });
2481
using (var peReader = new PEReader(File.OpenRead(Path.Combine(dir.
Path
, "embed.exe"))))
2488
MetadataReaderProvider.FromPortablePdbStream(File.OpenRead(Path.Combine(dir.
Path
, "embed.pdb"))))
2516
symReader = SymReaderFactory.CreateReader(File.OpenRead(Path.Combine(dir.
Path
, "embed.pdb")));
2788
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/a:missing.dll", "a.cs" });
2811
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + typeof(object).Assembly.Location, "a.cs" });
2928
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs" });
2964
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs", "/ruleset:" + ruleSetFile.Path });
2997
var csc = CreateCSharpCompiler(null, dir.
Path
,
3008
csc = CreateCSharpCompiler(null, dir.
Path
,
3044
dir.
Path
);
3076
dir.
Path
);
3109
dir.
Path
);
3142
dir.
Path
);
3176
dir.
Path
);
3210
dir.
Path
);
3244
dir.
Path
);
3278
dir.
Path
);
3313
dir.
Path
);
3348
dir.
Path
);
3372
dir.
Path
);
3405
dir.
Path
);
3438
dir.
Path
);
3472
dir.
Path
);
3516
var csc = CreateCSharpCompiler(null, dir.
Path
,
3527
csc = CreateCSharpCompiler(null, dir.
Path
,
3585
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", "a.cs" });
3595
" + Path.GetFullPath(Path.Combine(dir.
Path
, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Goo' does not exist in the current context
3596
" + Path.GetFullPath(Path.Combine(dir.
Path
, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Goo' does not exist in the current context
3613
csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/fullpaths", "a.cs" });
3618
" + Path.Combine(dir.
Path
, @"a.cs") + @"(8,13): error CS0103: The name 'Goo' does not exist in the current context
3622
" + Path.GetFullPath(Path.Combine(dir.
Path
, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Goo' does not exist in the current context
3623
" + Path.GetFullPath(Path.Combine(dir.
Path
, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Goo' does not exist in the current context
3630
" + Path.Combine(dir.
Path
, @"a.cs") + @"(32,13): error CS0103: The name 'Goo' does not exist in the current context
4494
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/modulename:hocusPocus ", "/out:" + exeName + " ", file1.Path });
4502
Assert.Equal(1, Directory.EnumerateFiles(dir.
Path
, exeName).Count());
4504
using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.
Path
, "aa.exe"))))
4681
var parsedArgs = DefaultParse(new[] { @"/lib:lib1", @"/libpath:lib2", @"/libpaths:lib3", "a.cs" }, dir.
Path
, sdkDirectory: sdkDirectory);
4685
lib1.
Path
,
4686
lib2.
Path
,
4687
lib3.
Path
6016
string tempDir = Temp.CreateDirectory().
Path
;
6052
string tempDir = Temp.CreateDirectory().
Path
;
6085
string tempDir = Temp.CreateDirectory().
Path
;
6119
string tempDir = Temp.CreateDirectory().
Path
;
6131
string tempDir = Temp.CreateDirectory().
Path
;
6969
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/target:exe", "a.cs" });
6991
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/target:exe", "a.cs" });
7015
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/target:library", "a.cs" });
7038
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/target:library", "/preferreduilang:en", "a.cs" });
7083
var csc = CreateCSharpCompiler(null, dir.
Path
, commandLineArguments.Concat(new[] { inputName1, inputName2 }).ToArray());
7091
Assert.Equal(1, Directory.EnumerateFiles(dir.
Path
, "*" + PathUtilities.GetExtension(expectedOutputName)).Count());
7092
Assert.Equal(1, Directory.EnumerateFiles(dir.
Path
, expectedOutputName).Count());
7094
using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.
Path
, expectedOutputName))))
7127
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/r:missing.dll", "a.cs" });
7203
var csc = CreateCSharpCompiler(null, dir.
Path
, commandLineArguments.Concat(new[] { fileName }).ToArray());
7226
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\a.exe" });
7230
Assert.Contains("error CS2012: Cannot open '" + dir.
Path
+ "\\sub\\a.exe' for writing", outWriter.ToString(), StringComparison.Ordinal);
7252
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\" });
7280
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\ " });
7308
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:aaa:\\a.exe" });
7334
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out: " });
7368
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "a.cs", "/keyfile:key.snk", });
7390
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "a.cs", "/keycontainer:bbb", });
7413
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "a.cs", "/keyFile:key.snk", "/features:UseLegacyStrongNameProvider" });
7433
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "a.cs", "/features:disable-length-based-switch" });
7437
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "a.cs" });
7528
var output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $"/nologo /t:library \"{file}\"", startFolder: dir.
Path
);
7531
output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $"/nologo /preferreduilang:en /t:library /codepage:20127 \"{file}\"", expectedRetCode: 1, startFolder: dir.
Path
); // 20127: US-ASCII
7809
csc = CreateCSharpCompiler(null, dir.
Path
, new[]
7819
csc = CreateCSharpCompiler(null, dir.
Path
, new[]
7833
IntPtr lib = LoadLibraryEx(Path.Combine(dir.
Path
, outputFileName), IntPtr.Zero, 0x00000002);
8428
csc = CreateCSharpCompiler(null, Temp.CreateDirectory().
Path
, new[] { source, "/preferreduilang:en" });
8455
csc = CreateCSharpCompiler(null, Temp.CreateDirectory().
Path
, new[] { source, "/preferreduilang:en", "/fullpaths" });
8785
int exitCode1 = CreateCSharpCompiler(null, dir.
Path
, new[] { "/debug:full", "/out:Program.exe", source1.Path }).Run(outWriter);
8791
int exitCode2 = CreateCSharpCompiler(null, dir.
Path
, new[] { "/debug:full", "/out:Program.exe", source2.Path }).Run(outWriter);
8802
int exitCode3 = CreateCSharpCompiler(null, dir.
Path
, new[] { "/debug:full", "/out:Program.exe", source3.Path }).Run(outWriter);
8847
int exitCode = CreateCSharpCompiler(null, dir.
Path
, new[] { "/target:library", "/debug:full", libSrc.Path }).Run(outWriter);
8864
AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.
Path
).Select(p => Path.GetFileName(p)).Order());
8921
AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.
Path
).Select(p => Path.GetFileName(p)).Order());
8929
Directory.Delete(dir.
Path
, recursive: false);
8954
int exitCode = CreateCSharpCompiler(null, dir.
Path
, new[] { "/target:library", "/preferreduilang:en", libSrc.Path }).Run(outWriter);
8962
AssertEx.Equal(new[] { "Lib.cs", "Lib.dll" }, Directory.GetFiles(dir.
Path
).Select(p => Path.GetFileName(p)).Order());
8973
int exitCode = CreateCSharpCompiler(null, dir.
Path
, new[] { "/target:library", "/preferreduilang:en", libSrc.Path }).Run(outWriter);
8974
Assert.Contains($"error CS2012: Cannot open '{libDll.
Path
}' for writing", outWriter.ToString());
8995
var srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
);
9017
var srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
);
9040
var srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
);
9064
var srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
);
9298
TestCS2002(commandLineArgs, tempDir.
Path
, 0, aWrnString);
9304
TestCS2002(commandLineArgs, tempDir.
Path
, 0, warnings);
9310
TestCS2002(commandLineArgs, tempDir.
Path
, 0, AWrnString);
9316
TestCS2002(commandLineArgs, tempDir.
Path
, 0, String.Empty);
9322
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9327
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9332
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9337
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9341
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9347
var formattedcs1504Str = String.Format(cs1504, PathUtilities.CombineAbsoluteAndRelativePaths(tempParentDir.
Path
, "tmpDir\a.cs"), "Illegal characters in path.");
9348
TestCS2002(commandLineArgs, tempParentDir.
Path
, 1, formattedcs1504Str);
9356
TestCS2002(commandLineArgs, tempParentDir.
Path
, 1, (string[])null, parseDiags);
9363
TestCS2002(commandLineArgs, tempParentDir.
Path
, 1, (string[])null, parseDiags);
9367
var formattedcs1504 = String.Format(cs1504, PathUtilities.CombineAbsoluteAndRelativePaths(tempParentDir.
Path
, @":a.cs"), @"The given path's format is not supported.");
9368
TestCS2002(commandLineArgs, tempParentDir.
Path
, 1, formattedcs1504);
9371
System.IO.Directory.Delete(tempParentDir.
Path
, true);
9974
args = DefaultParse(new[] { "/additionalfile:web*.config", "a.cs" }, baseDir.
Path
);
9977
Assert.Equal(Path.Combine(baseDir.
Path
, "web1.config"), args.AdditionalFiles[0].Path);
9978
Assert.Equal(Path.Combine(baseDir.
Path
, "web2.config"), args.AdditionalFiles[1].Path);
9979
Assert.Equal(Path.Combine(baseDir.
Path
, "web3.config"), args.AdditionalFiles[2].Path);
10196
Directory.Delete(dir.
Path
, true);
10255
Directory.Delete(dir.
Path
, true);
10321
Directory.Delete(dir.
Path
, true);
10428
Directory.Delete(dir.
Path
, true);
10525
Directory.Delete(dir.
Path
, true);
10562
Directory.Delete(dir.
Path
, true);
10602
Directory.Delete(dir.
Path
, true);
10654
var csc = CreateCSharpCompiler(null, sourceDir.
Path
, args, analyzers: analyzers, generators: generators, driverCache: driverCache);
11692
var csc = CreateCSharpCompiler(null, dir.
Path
, args);
11696
var exePath = Path.Combine(dir.
Path
, "a.exe");
11708
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11715
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11716
AssertPdbEmit(dir, pdbPath, @"q:\a.pdb", $@"/pathmap:{dir.
Path
}=q:\");
11722
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11723
AssertPdbEmit(dir, pdbPath, @"q:\a.pdb", $@"/pathmap:{dir.
Path
}=q:\", "/deterministic");
11730
var pdbPath = Path.Combine(dir.
Path
, @"pdb\a.pdb");
11731
AssertPdbEmit(dir, pdbPath, @"q:\pdb\a.pdb", $@"/pathmap:{dir.
Path
}=q:\");
11738
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11745
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11746
AssertPdbEmit(dir, pdbPath, @"/a.pdb", $@"/pathmap:{dir.
Path
}=/");
11752
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11753
AssertPdbEmit(dir, pdbPath, "/goo/a.pdb", $"/pathmap:{dir.
Path
}=/goo,{dir.
Path
}{PathUtilities.DirectorySeparatorChar}=/bar");
11818
var output = ProcessUtilities.RunAndGetOutput(csc32exe.Path, $@"/nologo /debug:full /deterministic /out:Program.exe /pathmap:""{dir32.
Path
}""=X:\ ""{sourceFile.Path}""", expectedRetCode: 0, startFolder: dir32.
Path
);
11821
output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $@"/nologo /debug:full /deterministic /out:Program.exe /pathmap:""{dir64.
Path
}""=X:\ ""{sourceFile.Path}""", expectedRetCode: 0, startFolder: dir64.
Path
);
11871
var csc = CreateCSharpCompiler(null, dir.
Path
,
11877
var exe = Path.Combine(dir.
Path
, "a.exe");
11886
var doc = Path.Combine(dir.
Path
, "doc.xml");
11907
var output = ProcessUtilities.RunAndGetOutput(exe, startFolder: dir.
Path
);
11910
var refDll = Path.Combine(refDir.
Path
, "a.dll");
11922
CleanupAllGeneratedFiles(dir.
Path
);
11923
CleanupAllGeneratedFiles(refDir.
Path
);
11936
var csc = CreateCSharpCompiler(null, dir.
Path
,
11941
var dll = Path.Combine(dir.
Path
, "a.dll");
11944
var refDll = Path.Combine(dir.
Path
, Path.Combine("ref", "a.dll"));
11950
CleanupAllGeneratedFiles(dir.
Path
);
11987
var csc = CreateCSharpCompiler(null, dir.
Path
,
11993
var refDll = Path.Combine(dir.
Path
, "a.dll");
12004
var pdb = Path.Combine(dir.
Path
, "a.pdb");
12007
var doc = Path.Combine(dir.
Path
, "doc.xml");
12035
CleanupAllGeneratedFiles(dir.
Path
);
12096
var result = ProcessUtilities.Run(cscPath, arguments: "/nologo /t:library unknown.cs", workingDirectory: dir.
Path
);
12104
result = ProcessUtilities.Run(cscPath, arguments: "/nologo /t:library unknown.cs", workingDirectory: dir.
Path
);
12325
var cscCopy = Path.Combine(dir.
Path
, "csc.exe");
12333
workingDirectory: dir.
Path
,
12341
result = ProcessUtilities.Run(cscCopy, arguments, workingDirectory: dir.
Path
);
12348
workingDirectory: dir.
Path
,
12365
var csc = CreateCSharpCompiler(null, dir.
Path
, args);
12369
var exePath = Path.Combine(dir.
Path
, "a.exe");
12387
var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.
Path
, sdkDir: null, tempDir: tempDir.
Path
);
12403
var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.
Path
, sdkDir: null, tempDir: tempDir.
Path
);
12423
var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.
Path
, sdkDir: null, tempDir: tempDir.
Path
);
12444
var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.
Path
, sdkDir: null, tempDir: tempDir.
Path
);
13495
var cmd = CreateCSharpCompiler(null, dir.
Path
, arguments,
13557
string binaryPath = Path.Combine(dir.
Path
, "temp.dll");
13560
string pdbPath = Path.Combine(dir.
Path
, pdbName);
13563
string xmlDocFilePath = Path.Combine(dir.
Path
, docName);
13603
string binaryPath = Path.Combine(dir.
Path
, "temp.dll");
13606
string pdbPath = Path.Combine(dir.
Path
, pdbName);
13609
string xmlDocFilePath = Path.Combine(dir.
Path
, docName);
13653
string binaryPath = Path.Combine(dir.
Path
, "temp.dll");
13656
string pdbPath = Path.Combine(dir.
Path
, pdbName);
13659
string xmlDocFilePath = Path.Combine(dir.
Path
, docName);
13684
string binaryPath = Path.Combine(dir.
Path
, "temp.dll");
13740
var cmd = CreateCSharpCompiler(null, dir.
Path
, arguments,
13831
var cmd = CreateCSharpCompiler(null, dir.
Path
, args, analyzers: new[] { analyzer });
13868
var cmd = CreateCSharpCompiler(null, dir.
Path
, args, analyzers: new[] { analyzer });
14001
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.
Path
, generator);
14002
ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.
Path
, generatorPrefix, $"generatedSource.cs"), generatedSource } }, dir, true);
14006
Directory.Delete(dir.
Path
, true);
14042
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.
Path
, generator);
14043
ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.
Path
, generatorPrefix, "generatedSource.cs"), generatedSource } }, dir, true);
14081
var generator1Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.
Path
, generator);
14082
var generator2Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.
Path
, generator2);
14086
{ Path.Combine(dir.
Path
, generator1Prefix, source1Name), source1},
14087
{ Path.Combine(dir.
Path
, generator2Prefix, source2Name), source2},
14092
Directory.Delete(dir.
Path
, true);
14104
var genPath1 = Path.Combine(dir.
Path
, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint1.cs");
14105
var genPath2 = Path.Combine(dir.
Path
, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint2.cs");
14124
using (Stream peStream = File.OpenRead(Path.Combine(dir.
Path
, "checksum.exe")), pdbStream = File.OpenRead(Path.Combine(dir.
Path
, "checksum.pdb")))
14136
Directory.Delete(dir.
Path
, true);
14146
var genPath1 = Path.Combine(dir.
Path
, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint1.cs");
14147
var genPath2 = Path.Combine(dir.
Path
, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint2.cs");
14166
using (Stream peStream = File.OpenRead(Path.Combine(dir.
Path
, "checksum.exe")), pdbStream = File.OpenRead(Path.Combine(dir.
Path
, "checksum.pdb")))
14178
Directory.Delete(dir.
Path
, true);
14208
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null);
14210
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator);
14213
{ Path.Combine(generatedDir.
Path
, generatorPrefix, expectedDir), new() { { expectedFileName, generatedSource } } }
14218
Directory.Delete(dir.
Path
, true);
14234
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator1 }, analyzers: null);
14236
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator1);
14237
ValidateWrittenSources(new() { { Path.Combine(generatedDir.
Path
, generatorPrefix), new() { { "generatedSource.cs", generatedSource1 } } } });
14242
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator2 }, analyzers: null);
14244
ValidateWrittenSources(new() { { Path.Combine(generatedDir.
Path
, generatorPrefix), new() { { "generatedSource.cs", generatedSource2 } } } });
14248
Directory.Delete(dir.
Path
, true);
14269
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator, generator2 }, analyzers: null);
14271
var generator1Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator);
14272
var generator2Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator2);
14282
Directory.Delete(dir.
Path
, true);
14310
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null);
14312
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator);
14315
{ Path.Combine(generatedDir.
Path
, generatorPrefix, expectedDir), new() { { generatedFileName, generatedSource } } }
14320
Directory.Delete(dir.
Path
, true);
14329
var snk = Temp.CreateFile("TestKeyPair_", ".snk", dir.
Path
).WriteAllBytes(TestResources.General.snKey);
14331
var virtualSnProvider = new DesktopStrongNameProvider(ImmutableArray.Create(dir.
Path
));
14346
var path = Path.Combine(dir.
Path
, Guid.NewGuid().ToString() + ".dll");
14361
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/analyzer:" + gen1, "/analyzer:" + gen2 }.ToArray());
14368
{ Path.Combine(generatedDir.
Path
, "generator", "TestGenerator"), new() { { "generatedSource.cs", "//from version 2.0.0.0" } } }
14386
ValidateWrittenSources(new() { { generatedDir.
Path
, new() } });
14390
Directory.Delete(dir.
Path
, true);
14402
var generatedDirPath = Path.Combine(dir.
Path
, "noexist");
14411
Directory.Delete(dir.
Path
, true);
14427
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null);
14429
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator);
14430
ValidateWrittenSources(new() { { Path.Combine(generatedDir.
Path
, generatorPrefix), new() { { "generatedSource.cs", generatedSource } } } });
14434
Directory.Delete(dir.
Path
, true);
14503
Directory.Delete(dir.
Path
, true);
14519
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, $"/touchedfiles:{dir.
Path
}/touched", "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null);
14521
var touchedFiles = Directory.GetFiles(dir.
Path
, "touched*");
14524
string[] writtenText = File.ReadAllLines(Path.Combine(dir.
Path
, "touched.write"));
14531
Directory.Delete(dir.
Path
, true);
14599
Directory.Delete(dir.
Path
, true);
14658
$"/out:{objDir.
Path
}/embed.exe",
14668
Directory.Delete(dir.
Path
, true);
14724
pathMapArgument = pathMapArgument.Replace("DIRPATH", dir.
Path
).Replace("SRCDIRPATH", srcDir.
Path
).Replace("OBJDIRPATH", objDir.
Path
);
14730
"/generatedfilesout:" + objDir.
Path
,
14741
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(objDir.
Path
, generator);
14749
Directory.Delete(dir.
Path
, true);
14837
var cmd = CreateCSharpCompiler(null, dir.
Path
, args, generators: new[] { generator });
14897
var cmd = CreateCSharpCompiler(null, dir.
Path
,
14917
var cmd = CreateCSharpCompiler(null, dir.
Path
,
14942
var cmd = CreateCSharpCompiler(null, dir.
Path
,
14962
var cmd = CreateCSharpCompiler(null, dir.
Path
,
15002
Directory.Delete(dir.
Path
, true);
15068
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15149
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15363
CleanupAllGeneratedFiles(srcDirectory.
Path
);
15519
var generatorPath = Path.Combine(directory.
Path
, "generator.dll");
15555
Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.
Path
, additionalFilePath1)));
15556
Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.
Path
, additionalFilePath2)));
15562
string path2 = additionalFile2?.Path ?? Path.Combine(srcDirectory.
Path
, additionalFilePath2);
15579
CleanupAllGeneratedFiles(srcDirectory.
Path
);
15674
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15685
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15726
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15737
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15808
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15819
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15861
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15872
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15939
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15978
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
16018
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"))).
941
var designTimeOnlyFilePath = Path.Combine(dir.
Path
, designTimeOnlyFileName);
Microsoft.CodeAnalysis.LanguageServer.UnitTests (79)
DefaultFileChangeWatcherTests.cs (62)
34
using var context = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [])]);
60
new WatchedDirectory(subDir1.
Path
, extensionFilters: []),
61
new WatchedDirectory(subDir2.
Path
, extensionFilters: [])
71
var filePath = Path.Combine(tempDirectory.
Path
, "test.cs");
74
using var context = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [".cs"])]);
86
var filePath = Path.Combine(otherDir.
Path
, "test.cs");
89
using var context = watcher.CreateContext([new WatchedDirectory(watchedDir.
Path
, extensionFilters: [])]);
100
var filePath = Path.Combine(tempDirectory.
Path
, "test.cs");
103
using var context = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [".cs"])]);
113
var filePath = Path.Combine(tempDirectory.
Path
, "test.txt");
117
using var context = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [".cs"])]);
128
var filePath = Path.Combine(tempDirectory.
Path
, "multi.txt");
147
var filePath = Path.Combine(subDirectory.
Path
, "nested.cs");
150
using var context = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [])]);
174
var csFilePath = Path.Combine(tempDirectory.
Path
, "test.cs");
175
var vbFilePath = Path.Combine(tempDirectory.
Path
, "test.vb");
176
var txtFilePath = Path.Combine(tempDirectory.
Path
, "test.txt");
179
using var context = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [".cs", ".vb"])]);
200
var filePath = Path.Combine(level3.
Path
, "deep.cs");
203
using var context = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [".cs"])]);
216
var filePath = Path.Combine(siblingDir.
Path
, "test.cs");
219
using var context = watcher.CreateContext([new WatchedDirectory(watchedDir.
Path
, extensionFilters: [])]);
231
var filePath = Path.Combine(rootDir.
Path
, "test.cs");
234
using var context = watcher.CreateContext([new WatchedDirectory(watchedDir.
Path
, extensionFilters: [])]);
245
var filePath = Path.Combine(tempDirectory.
Path
, "test.txt");
292
var filePath = Path.Combine(tempDirectory.
Path
, "created.cs");
295
using var context = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [])]);
311
var filePath = Path.Combine(tempDirectory.
Path
, "modified.cs");
317
using var context = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [])]);
333
var filePath = Path.Combine(tempDirectory.
Path
, "deleted.cs");
339
using var context = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [])]);
355
var filePath = Path.Combine(tempDirectory.
Path
, "filtered.cs");
358
using var context = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [".cs"])]);
374
var txtFilePath = Path.Combine(tempDirectory.
Path
, "filtered.txt");
378
using var context = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [".cs"])]);
395
var filePath = Path.Combine(subDirectory.
Path
, "nested.cs");
398
using var context = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [])]);
414
var filePath = Path.Combine(tempDirectory.
Path
, "individual.txt");
437
var filePath = Path.Combine(tempDirectory.
Path
, "individual_modify.txt");
463
var filePath = Path.Combine(tempDirectory.
Path
, "disposed.txt");
492
using var context = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [])]);
495
var file1 = Path.Combine(tempDirectory.
Path
, "file1.cs");
496
var file2 = Path.Combine(tempDirectory.
Path
, "file2.cs");
497
var file3 = Path.Combine(tempDirectory.
Path
, "file3.cs");
522
var originalPath = Path.Combine(tempDirectory.
Path
, "original.cs");
523
var renamedPath = Path.Combine(tempDirectory.
Path
, "renamed.cs");
529
using var context = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [])]);
545
var originalPath = Path.Combine(tempDirectory.
Path
, "original.cs");
546
var renamedPath = Path.Combine(tempDirectory.
Path
, "renamed.cs");
552
using var context = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [])]);
574
using var context1 = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [])]);
575
using var context2 = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [".cs"])]);
591
var context1 = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [])]);
592
var context2 = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [".cs"])]);
614
var filePath = Path.Combine(tempDirectory.
Path
, "test.cs");
617
using var context1 = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [])]);
618
using var context2 = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [".cs"])]);
639
var filePath = Path.Combine(tempDirectory.
Path
, "test.cs");
642
var context1 = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [])]);
643
using var context2 = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [".cs"])]);
670
var context1 = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [])]);
676
using var context2 = watcher.CreateContext([new WatchedDirectory(tempDirectory.
Path
, extensionFilters: [])]);
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)
51
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)
421
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)
41
["NUGET_PACKAGES"] = _nugetCacheDir.
Path
48
workingDirectory: SolutionDirectory.
Path
,
56
RunDotNet($@"msbuild ""{solutionOrProjectFileName}"" /t:restore /bl:{Path.Combine(SolutionDirectory.
Path
, "restore.binlog")}");
61
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 (15)
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\SdkAnalyzerAssemblyRedirectorTests.cs (5)
26
var vsDir = Path.Combine(testDir.
Path
, "vs");
41
var vsDir = Path.Combine(testDir.
Path
, "vs");
56
var vsDir = Path.Combine(testDir.
Path
, "vs");
73
var vsDir = Path.Combine(testDir.
Path
, "vs");
102
var vsDir = Path.Combine(testDir.
Path
, "vs");
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
;