527 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)
87
currentDirectory.
Path
,
Microsoft.Build.Tasks.CodeAnalysis.UnitTests (19)
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
);
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)
87
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
5999
string tempDir = Temp.CreateDirectory().
Path
;
6035
string tempDir = Temp.CreateDirectory().
Path
;
6068
string tempDir = Temp.CreateDirectory().
Path
;
6102
string tempDir = Temp.CreateDirectory().
Path
;
6114
string tempDir = Temp.CreateDirectory().
Path
;
6952
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/target:exe", "a.cs" });
6974
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/target:exe", "a.cs" });
6998
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/target:library", "a.cs" });
7021
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/target:library", "/preferreduilang:en", "a.cs" });
7079
var csc = CreateCSharpCompiler(null, dir.
Path
, commandLineArguments.Concat(new[] { inputName1, inputName2 }).ToArray());
7087
Assert.Equal(1, Directory.EnumerateFiles(dir.
Path
, "*" + PathUtilities.GetExtension(expectedOutputName)).Count());
7088
Assert.Equal(1, Directory.EnumerateFiles(dir.
Path
, expectedOutputName).Count());
7090
using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.
Path
, expectedOutputName))))
7123
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/r:missing.dll", "a.cs" });
7199
var csc = CreateCSharpCompiler(null, dir.
Path
, commandLineArguments.Concat(new[] { fileName }).ToArray());
7222
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\a.exe" });
7226
Assert.Contains("error CS2012: Cannot open '" + dir.
Path
+ "\\sub\\a.exe' for writing", outWriter.ToString(), StringComparison.Ordinal);
7248
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\" });
7276
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\ " });
7304
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:aaa:\\a.exe" });
7330
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out: " });
7364
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "a.cs", "/keyfile:key.snk", });
7386
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "a.cs", "/keycontainer:bbb", });
7408
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "a.cs", "/keyFile:key.snk", "/features:UseLegacyStrongNameProvider" });
7428
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "a.cs", "/features:disable-length-based-switch" });
7432
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "a.cs" });
7523
var output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $"/nologo /t:library \"{file}\"", startFolder: dir.
Path
);
7526
output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $"/nologo /preferreduilang:en /t:library /codepage:20127 \"{file}\"", expectedRetCode: 1, startFolder: dir.
Path
); // 20127: US-ASCII
7804
csc = CreateCSharpCompiler(null, dir.
Path
, new[]
7814
csc = CreateCSharpCompiler(null, dir.
Path
, new[]
7828
IntPtr lib = LoadLibraryEx(Path.Combine(dir.
Path
, outputFileName), IntPtr.Zero, 0x00000002);
8422
csc = CreateCSharpCompiler(null, Temp.CreateDirectory().
Path
, new[] { source, "/preferreduilang:en" });
8449
csc = CreateCSharpCompiler(null, Temp.CreateDirectory().
Path
, new[] { source, "/preferreduilang:en", "/fullpaths" });
8780
int exitCode1 = CreateCSharpCompiler(null, dir.
Path
, new[] { "/debug:full", "/out:Program.exe", source1.Path }).Run(outWriter);
8786
int exitCode2 = CreateCSharpCompiler(null, dir.
Path
, new[] { "/debug:full", "/out:Program.exe", source2.Path }).Run(outWriter);
8797
int exitCode3 = CreateCSharpCompiler(null, dir.
Path
, new[] { "/debug:full", "/out:Program.exe", source3.Path }).Run(outWriter);
8842
int exitCode = CreateCSharpCompiler(null, dir.
Path
, new[] { "/target:library", "/debug:full", libSrc.Path }).Run(outWriter);
8859
AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.
Path
).Select(p => Path.GetFileName(p)).Order());
8916
AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.
Path
).Select(p => Path.GetFileName(p)).Order());
8924
Directory.Delete(dir.
Path
, recursive: false);
8949
int exitCode = CreateCSharpCompiler(null, dir.
Path
, new[] { "/target:library", "/preferreduilang:en", libSrc.Path }).Run(outWriter);
8957
AssertEx.Equal(new[] { "Lib.cs", "Lib.dll" }, Directory.GetFiles(dir.
Path
).Select(p => Path.GetFileName(p)).Order());
8968
int exitCode = CreateCSharpCompiler(null, dir.
Path
, new[] { "/target:library", "/preferreduilang:en", libSrc.Path }).Run(outWriter);
8969
Assert.Contains($"error CS2012: Cannot open '{libDll.
Path
}' for writing", outWriter.ToString());
8990
var srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
);
9012
var srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
);
9035
var srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
);
9059
var srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
);
9293
TestCS2002(commandLineArgs, tempDir.
Path
, 0, aWrnString);
9299
TestCS2002(commandLineArgs, tempDir.
Path
, 0, warnings);
9305
TestCS2002(commandLineArgs, tempDir.
Path
, 0, AWrnString);
9311
TestCS2002(commandLineArgs, tempDir.
Path
, 0, String.Empty);
9317
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9322
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9327
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9332
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9336
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9342
var formattedcs1504Str = String.Format(cs1504, PathUtilities.CombineAbsoluteAndRelativePaths(tempParentDir.
Path
, "tmpDir\a.cs"), "Illegal characters in path.");
9343
TestCS2002(commandLineArgs, tempParentDir.
Path
, 1, formattedcs1504Str);
9351
TestCS2002(commandLineArgs, tempParentDir.
Path
, 1, (string[])null, parseDiags);
9358
TestCS2002(commandLineArgs, tempParentDir.
Path
, 1, (string[])null, parseDiags);
9362
var formattedcs1504 = String.Format(cs1504, PathUtilities.CombineAbsoluteAndRelativePaths(tempParentDir.
Path
, @":a.cs"), @"The given path's format is not supported.");
9363
TestCS2002(commandLineArgs, tempParentDir.
Path
, 1, formattedcs1504);
9366
System.IO.Directory.Delete(tempParentDir.
Path
, true);
9908
args = DefaultParse(new[] { "/additionalfile:web*.config", "a.cs" }, baseDir.
Path
);
9911
Assert.Equal(Path.Combine(baseDir.
Path
, "web1.config"), args.AdditionalFiles[0].Path);
9912
Assert.Equal(Path.Combine(baseDir.
Path
, "web2.config"), args.AdditionalFiles[1].Path);
9913
Assert.Equal(Path.Combine(baseDir.
Path
, "web3.config"), args.AdditionalFiles[2].Path);
10130
Directory.Delete(dir.
Path
, true);
10189
Directory.Delete(dir.
Path
, true);
10255
Directory.Delete(dir.
Path
, true);
10362
Directory.Delete(dir.
Path
, true);
10459
Directory.Delete(dir.
Path
, true);
10496
Directory.Delete(dir.
Path
, true);
10536
Directory.Delete(dir.
Path
, true);
10588
var csc = CreateCSharpCompiler(null, sourceDir.
Path
, args, analyzers: analyzers, generators: generators, driverCache: driverCache);
11626
var csc = CreateCSharpCompiler(null, dir.
Path
, args);
11630
var exePath = Path.Combine(dir.
Path
, "a.exe");
11642
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11649
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11650
AssertPdbEmit(dir, pdbPath, @"q:\a.pdb", $@"/pathmap:{dir.
Path
}=q:\");
11656
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11657
AssertPdbEmit(dir, pdbPath, @"q:\a.pdb", $@"/pathmap:{dir.
Path
}=q:\", "/deterministic");
11664
var pdbPath = Path.Combine(dir.
Path
, @"pdb\a.pdb");
11665
AssertPdbEmit(dir, pdbPath, @"q:\pdb\a.pdb", $@"/pathmap:{dir.
Path
}=q:\");
11671
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11678
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11679
AssertPdbEmit(dir, pdbPath, @"/a.pdb", $@"/pathmap:{dir.
Path
}=/");
11685
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11686
AssertPdbEmit(dir, pdbPath, "/goo/a.pdb", $"/pathmap:{dir.
Path
}=/goo,{dir.
Path
}{PathUtilities.DirectorySeparatorChar}=/bar");
11751
var output = ProcessUtilities.RunAndGetOutput(csc32exe.Path, $@"/nologo /debug:full /deterministic /out:Program.exe /pathmap:""{dir32.
Path
}""=X:\ ""{sourceFile.Path}""", expectedRetCode: 0, startFolder: dir32.
Path
);
11754
output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $@"/nologo /debug:full /deterministic /out:Program.exe /pathmap:""{dir64.
Path
}""=X:\ ""{sourceFile.Path}""", expectedRetCode: 0, startFolder: dir64.
Path
);
11804
var csc = CreateCSharpCompiler(null, dir.
Path
,
11810
var exe = Path.Combine(dir.
Path
, "a.exe");
11819
var doc = Path.Combine(dir.
Path
, "doc.xml");
11840
var output = ProcessUtilities.RunAndGetOutput(exe, startFolder: dir.
Path
);
11843
var refDll = Path.Combine(refDir.
Path
, "a.dll");
11855
CleanupAllGeneratedFiles(dir.
Path
);
11856
CleanupAllGeneratedFiles(refDir.
Path
);
11869
var csc = CreateCSharpCompiler(null, dir.
Path
,
11874
var dll = Path.Combine(dir.
Path
, "a.dll");
11877
var refDll = Path.Combine(dir.
Path
, Path.Combine("ref", "a.dll"));
11883
CleanupAllGeneratedFiles(dir.
Path
);
11920
var csc = CreateCSharpCompiler(null, dir.
Path
,
11926
var refDll = Path.Combine(dir.
Path
, "a.dll");
11937
var pdb = Path.Combine(dir.
Path
, "a.pdb");
11940
var doc = Path.Combine(dir.
Path
, "doc.xml");
11968
CleanupAllGeneratedFiles(dir.
Path
);
12029
var result = ProcessUtilities.Run(cscPath, arguments: "/nologo /t:library unknown.cs", workingDirectory: dir.
Path
);
12037
result = ProcessUtilities.Run(cscPath, arguments: "/nologo /t:library unknown.cs", workingDirectory: dir.
Path
);
12258
var cscCopy = Path.Combine(dir.
Path
, "csc.exe");
12266
workingDirectory: dir.
Path
,
12274
result = ProcessUtilities.Run(cscCopy, arguments, workingDirectory: dir.
Path
);
12281
workingDirectory: dir.
Path
,
12298
var csc = CreateCSharpCompiler(null, dir.
Path
, args);
12302
var exePath = Path.Combine(dir.
Path
, "a.exe");
12320
var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.
Path
, sdkDir: null, tempDir: tempDir.
Path
);
12335
var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.
Path
, sdkDir: null, tempDir: tempDir.
Path
);
12355
var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.
Path
, sdkDir: null, tempDir: tempDir.
Path
);
12376
var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.
Path
, sdkDir: null, tempDir: tempDir.
Path
);
13427
var cmd = CreateCSharpCompiler(null, dir.
Path
, arguments,
13489
string binaryPath = Path.Combine(dir.
Path
, "temp.dll");
13492
string pdbPath = Path.Combine(dir.
Path
, pdbName);
13495
string xmlDocFilePath = Path.Combine(dir.
Path
, docName);
13535
string binaryPath = Path.Combine(dir.
Path
, "temp.dll");
13538
string pdbPath = Path.Combine(dir.
Path
, pdbName);
13541
string xmlDocFilePath = Path.Combine(dir.
Path
, docName);
13585
string binaryPath = Path.Combine(dir.
Path
, "temp.dll");
13588
string pdbPath = Path.Combine(dir.
Path
, pdbName);
13591
string xmlDocFilePath = Path.Combine(dir.
Path
, docName);
13616
string binaryPath = Path.Combine(dir.
Path
, "temp.dll");
13672
var cmd = CreateCSharpCompiler(null, dir.
Path
, arguments,
13763
var cmd = CreateCSharpCompiler(null, dir.
Path
, args, analyzers: new[] { analyzer });
13800
var cmd = CreateCSharpCompiler(null, dir.
Path
, args, analyzers: new[] { analyzer });
13933
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.
Path
, generator);
13934
ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.
Path
, generatorPrefix, $"generatedSource.cs"), generatedSource } }, dir, true);
13938
Directory.Delete(dir.
Path
, true);
13974
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.
Path
, generator);
13975
ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.
Path
, generatorPrefix, "generatedSource.cs"), generatedSource } }, dir, true);
14013
var generator1Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.
Path
, generator);
14014
var generator2Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.
Path
, generator2);
14018
{ Path.Combine(dir.
Path
, generator1Prefix, source1Name), source1},
14019
{ Path.Combine(dir.
Path
, generator2Prefix, source2Name), source2},
14024
Directory.Delete(dir.
Path
, true);
14034
var genPath1 = Path.Combine(dir.
Path
, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint1.cs");
14035
var genPath2 = Path.Combine(dir.
Path
, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint2.cs");
14054
using (Stream peStream = File.OpenRead(Path.Combine(dir.
Path
, "checksum.exe")), pdbStream = File.OpenRead(Path.Combine(dir.
Path
, "checksum.pdb")))
14067
Directory.Delete(dir.
Path
, true);
14097
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null);
14099
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator);
14102
{ Path.Combine(generatedDir.
Path
, generatorPrefix, expectedDir), new() { { expectedFileName, generatedSource } } }
14107
Directory.Delete(dir.
Path
, true);
14123
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator1 }, analyzers: null);
14125
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator1);
14126
ValidateWrittenSources(new() { { Path.Combine(generatedDir.
Path
, generatorPrefix), new() { { "generatedSource.cs", generatedSource1 } } } });
14131
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator2 }, analyzers: null);
14133
ValidateWrittenSources(new() { { Path.Combine(generatedDir.
Path
, generatorPrefix), new() { { "generatedSource.cs", generatedSource2 } } } });
14137
Directory.Delete(dir.
Path
, true);
14158
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator, generator2 }, analyzers: null);
14160
var generator1Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator);
14161
var generator2Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator2);
14171
Directory.Delete(dir.
Path
, true);
14199
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null);
14201
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator);
14204
{ Path.Combine(generatedDir.
Path
, generatorPrefix, expectedDir), new() { { generatedFileName, generatedSource } } }
14209
Directory.Delete(dir.
Path
, true);
14218
var snk = Temp.CreateFile("TestKeyPair_", ".snk", dir.
Path
).WriteAllBytes(TestResources.General.snKey);
14220
var virtualSnProvider = new DesktopStrongNameProvider(ImmutableArray.Create(dir.
Path
));
14235
var path = Path.Combine(dir.
Path
, Guid.NewGuid().ToString() + ".dll");
14250
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/analyzer:" + gen1, "/analyzer:" + gen2 }.ToArray());
14257
{ Path.Combine(generatedDir.
Path
, "generator", "TestGenerator"), new() { { "generatedSource.cs", "//from version 2.0.0.0" } } }
14275
ValidateWrittenSources(new() { { generatedDir.
Path
, new() } });
14279
Directory.Delete(dir.
Path
, true);
14291
var generatedDirPath = Path.Combine(dir.
Path
, "noexist");
14300
Directory.Delete(dir.
Path
, true);
14316
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null);
14318
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator);
14319
ValidateWrittenSources(new() { { Path.Combine(generatedDir.
Path
, generatorPrefix), new() { { "generatedSource.cs", generatedSource } } } });
14323
Directory.Delete(dir.
Path
, true);
14392
Directory.Delete(dir.
Path
, true);
14408
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, $"/touchedfiles:{dir.
Path
}/touched", "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null);
14410
var touchedFiles = Directory.GetFiles(dir.
Path
, "touched*");
14413
string[] writtenText = File.ReadAllLines(Path.Combine(dir.
Path
, "touched.write"));
14420
Directory.Delete(dir.
Path
, true);
14488
Directory.Delete(dir.
Path
, true);
14547
$"/out:{objDir.
Path
}/embed.exe",
14557
Directory.Delete(dir.
Path
, true);
14613
pathMapArgument = pathMapArgument.Replace("DIRPATH", dir.
Path
).Replace("SRCDIRPATH", srcDir.
Path
).Replace("OBJDIRPATH", objDir.
Path
);
14619
"/generatedfilesout:" + objDir.
Path
,
14630
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(objDir.
Path
, generator);
14638
Directory.Delete(dir.
Path
, true);
14726
var cmd = CreateCSharpCompiler(null, dir.
Path
, args, generators: new[] { generator });
14786
var cmd = CreateCSharpCompiler(null, dir.
Path
,
14806
var cmd = CreateCSharpCompiler(null, dir.
Path
,
14831
var cmd = CreateCSharpCompiler(null, dir.
Path
,
14851
var cmd = CreateCSharpCompiler(null, dir.
Path
,
14891
Directory.Delete(dir.
Path
, true);
14957
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15038
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15252
CleanupAllGeneratedFiles(srcDirectory.
Path
);
15408
var generatorPath = Path.Combine(directory.
Path
, "generator.dll");
15444
Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.
Path
, additionalFilePath1)));
15445
Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.
Path
, additionalFilePath2)));
15451
string path2 = additionalFile2?.Path ?? Path.Combine(srcDirectory.
Path
, additionalFilePath2);
15468
CleanupAllGeneratedFiles(srcDirectory.
Path
);
15563
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15574
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15615
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15626
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15697
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15708
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15750
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15761
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15828
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15867
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15907
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 (2)
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)
381
workingDirectory: dir.
Path
);
484
var scriptPath = PathUtilities.CombinePathsUnchecked(PathUtilities.GetFileName(directory.
Path
), scriptName);
485
var workingDirectory = PathUtilities.GetDirectoryName(directory.
Path
);
539
var runner = CreateRunner([$"/loadpath:{dir1.
Path
}", $"/loadpaths:{dir2.
Path
};{dir3.
Path
}", main.Path]);
576
var runner = CreateRunner(["/r:4.dll", $"/lib:{dir1.
Path
}", $"/libpath:{dir2.
Path
}", $"/libpaths:{dir3.
Path
};{dir4.
Path
}", main.Path]);
597
SourcePaths.Add(@""{dir.
Path
}"")
612
> SourcePaths.Add(@""{dir.
Path
}"")
633
ReferencePaths.Add(@""{dir.
Path
}"")
648
> 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"))).
913
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)
45
var projectPath = Path.Combine(projectDirectory.
Path
, "Project.csproj");
59
var codePath = Path.Combine(projectDirectory.
Path
, "Code.cs");
70
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)
39
["NUGET_PACKAGES"] = _nugetCacheDir.
Path
46
workingDirectory: SolutionDirectory.
Path
,
54
RunDotNet($@"msbuild ""{solutionOrProjectFileName}"" /t:restore /bl:{Path.Combine(SolutionDirectory.
Path
, "restore.binlog")}");
59
var arguments = $@"msbuild ""{solutionOrProjectFileName}"" /bl:{Path.Combine(SolutionDirectory.
Path
, "build.binlog")}";
NewlyCreatedProjectsFromDotNetNew.cs (1)
153
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)
1426
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)
40
var workingDirectory = TempRoot.CreateDirectory().
Path
;
69
var workingDirectory = TempRoot.CreateDirectory().
Path
;
99
ProtocolUtil.CreateEmptyCSharp(TempRoot.CreateDirectory().
Path
),
120
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)
101
var filePath = Path.Combine(currentDirectory.
Path
, "netstandard.dll");
201
workingDir: currentDirectory.
Path
,
231
finalFlags = $"{flags} /shared:{serverData.PipeName} /pathmap:{tempDir.
Path
}=/ /out:{outFile} {srcFile}";
257
return new DisposableFile(Path.Combine(directory.
Path
, resultFileName));
290
var newTempDir = _tempDirectory.CreateDirectory(new string('a', 100 - _tempDirectory.
Path
.Length));
292
new[] { new KeyValuePair<string, string>("TMPDIR", newTempDir.
Path
) },
559
Assert.False(File.Exists(Path.Combine(_tempDirectory.
Path
, "hello.exe")));
589
Assert.False(File.Exists(Path.Combine(_tempDirectory.
Path
, "hello.exe")));
606
Assert.False(File.Exists(Path.Combine(_tempDirectory.
Path
, "missingfile.exe")));
624
Assert.False(File.Exists(Path.Combine(_tempDirectory.
Path
, "hello.exe")));
649
Assert.False(File.Exists(Path.Combine(_tempDirectory.
Path
, "app.exe")));
667
Assert.False(File.Exists(Path.Combine(_tempDirectory.
Path
, "missingfile.exe")));
696
Assert.False(File.Exists(Path.Combine(_tempDirectory.
Path
, "hellovb.exe")));
725
Assert.False(File.Exists(Path.Combine(_tempDirectory.
Path
, "app.exe")));
1063
$"src1.cs /shared:{serverData.PipeName} /nologo /t:library /out:" + Path.Combine(libDirectory.
Path
, "lib.dll"),
1081
additionalEnvironmentVars: new Dictionary<string, string>() { { "LIB", libDirectory.
Path
} });
1114
$"src1.vb /shared:{serverData.PipeName} /vbruntime* /nologo /t:library /out:" + Path.Combine(libDirectory.
Path
, "lib.dll"),
1133
additionalEnvironmentVars: new Dictionary<string, string>() { { "LIB", libDirectory.
Path
} });
1397
var tmp = Path.Combine(_tempDirectory.
Path
, "Temp");
1431
var tmp = Path.Combine(_tempDirectory.
Path
, "Temp");
1463
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
;