738 references to Path
InteractiveHost.UnitTests (4)
InteractiveHostCoreInitTests.cs (1)
75
AssertEx.AssertEqualToleratingWhitespaceDifferences(PrintSearchPaths(srcDir.
Path
), output);
InteractiveHostDesktopInitTests.cs (1)
48
AssertEx.AssertEqualToleratingWhitespaceDifferences(PrintSearchPaths(srcDir.
Path
), output);
InteractiveHostDesktopTests.cs (2)
704
rspFile.WriteAllText($"/lib:{directory1.
Path
} /r:Assembly2.dll {initFile.Path}");
718
var expectedSearchPaths = PrintSearchPaths(fxDir, directory1.
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 (3)
87
currentDirectory.
Path
,
93
return new DisposableFile(Path.Combine(directory.
Path
, resultFileName));
782
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);
Microsoft.CodeAnalysis.CSharp.CommandLine.UnitTests (346)
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 (317)
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
);
1865
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/langversion:?" });
2239
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/debug:embedded", "/sourcelink:sl.json", "a.cs" });
2243
var peStream = File.OpenRead(Path.Combine(dir.
Path
, "a.exe"));
2271
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/debug:portable", "/sourcelink:sl.json", "a.cs" });
2275
var pdbStream = File.OpenRead(Path.Combine(dir.
Path
, "a.pdb"));
2300
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/debug:full", "/sourcelink:sl.json", "a.cs" });
2304
var pdbStream = File.OpenRead(Path.Combine(dir.
Path
, "a.pdb"));
2443
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", debugSwitch, embedSwitch, "embed.cs", "embed2.cs" });
2467
using (var peReader = new PEReader(File.OpenRead(Path.Combine(dir.
Path
, "embed.exe"))))
2474
MetadataReaderProvider.FromPortablePdbStream(File.OpenRead(Path.Combine(dir.
Path
, "embed.pdb"))))
2502
symReader = SymReaderFactory.CreateReader(File.OpenRead(Path.Combine(dir.
Path
, "embed.pdb")));
2774
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/a:missing.dll", "a.cs" });
2797
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + typeof(object).Assembly.Location, "a.cs" });
2914
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs" });
2950
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs", "/ruleset:" + ruleSetFile.Path });
2983
var csc = CreateCSharpCompiler(null, dir.
Path
,
2994
csc = CreateCSharpCompiler(null, dir.
Path
,
3030
dir.
Path
);
3062
dir.
Path
);
3095
dir.
Path
);
3128
dir.
Path
);
3162
dir.
Path
);
3196
dir.
Path
);
3230
dir.
Path
);
3264
dir.
Path
);
3299
dir.
Path
);
3334
dir.
Path
);
3358
dir.
Path
);
3391
dir.
Path
);
3424
dir.
Path
);
3458
dir.
Path
);
3502
var csc = CreateCSharpCompiler(null, dir.
Path
,
3513
csc = CreateCSharpCompiler(null, dir.
Path
,
3571
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", "a.cs" });
3581
" + Path.GetFullPath(Path.Combine(dir.
Path
, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Goo' does not exist in the current context
3582
" + Path.GetFullPath(Path.Combine(dir.
Path
, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Goo' does not exist in the current context
3599
csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/fullpaths", "a.cs" });
3604
" + Path.Combine(dir.
Path
, @"a.cs") + @"(8,13): error CS0103: The name 'Goo' does not exist in the current context
3608
" + Path.GetFullPath(Path.Combine(dir.
Path
, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Goo' does not exist in the current context
3609
" + Path.GetFullPath(Path.Combine(dir.
Path
, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Goo' does not exist in the current context
3616
" + Path.Combine(dir.
Path
, @"a.cs") + @"(32,13): error CS0103: The name 'Goo' does not exist in the current context
4480
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/modulename:hocusPocus ", "/out:" + exeName + " ", file1.Path });
4488
Assert.Equal(1, Directory.EnumerateFiles(dir.
Path
, exeName).Count());
4490
using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.
Path
, "aa.exe"))))
4667
var parsedArgs = DefaultParse(new[] { @"/lib:lib1", @"/libpath:lib2", @"/libpaths:lib3", "a.cs" }, dir.
Path
, sdkDirectory: sdkDirectory);
4671
lib1.
Path
,
4672
lib2.
Path
,
4673
lib3.
Path
5988
string tempDir = Temp.CreateDirectory().
Path
;
6024
string tempDir = Temp.CreateDirectory().
Path
;
6057
string tempDir = Temp.CreateDirectory().
Path
;
6091
string tempDir = Temp.CreateDirectory().
Path
;
6103
string tempDir = Temp.CreateDirectory().
Path
;
6941
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/target:exe", "a.cs" });
6963
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/target:exe", "a.cs" });
6987
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/target:library", "a.cs" });
7010
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/target:library", "/preferreduilang:en", "a.cs" });
7068
var csc = CreateCSharpCompiler(null, dir.
Path
, commandLineArguments.Concat(new[] { inputName1, inputName2 }).ToArray());
7076
Assert.Equal(1, Directory.EnumerateFiles(dir.
Path
, "*" + PathUtilities.GetExtension(expectedOutputName)).Count());
7077
Assert.Equal(1, Directory.EnumerateFiles(dir.
Path
, expectedOutputName).Count());
7079
using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.
Path
, expectedOutputName))))
7112
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/r:missing.dll", "a.cs" });
7188
var csc = CreateCSharpCompiler(null, dir.
Path
, commandLineArguments.Concat(new[] { fileName }).ToArray());
7211
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\a.exe" });
7215
Assert.Contains("error CS2012: Cannot open '" + dir.
Path
+ "\\sub\\a.exe' for writing", outWriter.ToString(), StringComparison.Ordinal);
7237
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\" });
7265
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\ " });
7293
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:aaa:\\a.exe" });
7319
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out: " });
7353
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "a.cs", "/keyfile:key.snk", });
7375
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "a.cs", "/keycontainer:bbb", });
7397
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "a.cs", "/keyFile:key.snk", "/features:UseLegacyStrongNameProvider" });
7417
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "a.cs", "/features:disable-length-based-switch" });
7421
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "a.cs" });
7512
var output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $"/nologo /t:library \"{file}\"", startFolder: dir.
Path
);
7515
output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $"/nologo /preferreduilang:en /t:library /codepage:20127 \"{file}\"", expectedRetCode: 1, startFolder: dir.
Path
); // 20127: US-ASCII
7793
csc = CreateCSharpCompiler(null, dir.
Path
, new[]
7803
csc = CreateCSharpCompiler(null, dir.
Path
, new[]
7817
IntPtr lib = LoadLibraryEx(Path.Combine(dir.
Path
, outputFileName), IntPtr.Zero, 0x00000002);
8411
csc = CreateCSharpCompiler(null, Temp.CreateDirectory().
Path
, new[] { source, "/preferreduilang:en" });
8438
csc = CreateCSharpCompiler(null, Temp.CreateDirectory().
Path
, new[] { source, "/preferreduilang:en", "/fullpaths" });
8769
int exitCode1 = CreateCSharpCompiler(null, dir.
Path
, new[] { "/debug:full", "/out:Program.exe", source1.Path }).Run(outWriter);
8775
int exitCode2 = CreateCSharpCompiler(null, dir.
Path
, new[] { "/debug:full", "/out:Program.exe", source2.Path }).Run(outWriter);
8786
int exitCode3 = CreateCSharpCompiler(null, dir.
Path
, new[] { "/debug:full", "/out:Program.exe", source3.Path }).Run(outWriter);
8831
int exitCode = CreateCSharpCompiler(null, dir.
Path
, new[] { "/target:library", "/debug:full", libSrc.Path }).Run(outWriter);
8848
AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.
Path
).Select(p => Path.GetFileName(p)).Order());
8905
AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.
Path
).Select(p => Path.GetFileName(p)).Order());
8913
Directory.Delete(dir.
Path
, recursive: false);
8938
int exitCode = CreateCSharpCompiler(null, dir.
Path
, new[] { "/target:library", "/preferreduilang:en", libSrc.Path }).Run(outWriter);
8946
AssertEx.Equal(new[] { "Lib.cs", "Lib.dll" }, Directory.GetFiles(dir.
Path
).Select(p => Path.GetFileName(p)).Order());
8957
int exitCode = CreateCSharpCompiler(null, dir.
Path
, new[] { "/target:library", "/preferreduilang:en", libSrc.Path }).Run(outWriter);
8958
Assert.Contains($"error CS2012: Cannot open '{libDll.
Path
}' for writing", outWriter.ToString());
8979
var srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
);
9001
var srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
);
9024
var srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
);
9048
var srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
);
9282
TestCS2002(commandLineArgs, tempDir.
Path
, 0, aWrnString);
9288
TestCS2002(commandLineArgs, tempDir.
Path
, 0, warnings);
9294
TestCS2002(commandLineArgs, tempDir.
Path
, 0, AWrnString);
9300
TestCS2002(commandLineArgs, tempDir.
Path
, 0, String.Empty);
9306
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9311
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9316
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9321
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9325
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9331
var formattedcs1504Str = String.Format(cs1504, PathUtilities.CombineAbsoluteAndRelativePaths(tempParentDir.
Path
, "tmpDir\a.cs"), "Illegal characters in path.");
9332
TestCS2002(commandLineArgs, tempParentDir.
Path
, 1, formattedcs1504Str);
9340
TestCS2002(commandLineArgs, tempParentDir.
Path
, 1, (string[])null, parseDiags);
9347
TestCS2002(commandLineArgs, tempParentDir.
Path
, 1, (string[])null, parseDiags);
9351
var formattedcs1504 = String.Format(cs1504, PathUtilities.CombineAbsoluteAndRelativePaths(tempParentDir.
Path
, @":a.cs"), @"The given path's format is not supported.");
9352
TestCS2002(commandLineArgs, tempParentDir.
Path
, 1, formattedcs1504);
9355
System.IO.Directory.Delete(tempParentDir.
Path
, true);
9897
args = DefaultParse(new[] { "/additionalfile:web*.config", "a.cs" }, baseDir.
Path
);
9900
Assert.Equal(Path.Combine(baseDir.
Path
, "web1.config"), args.AdditionalFiles[0].Path);
9901
Assert.Equal(Path.Combine(baseDir.
Path
, "web2.config"), args.AdditionalFiles[1].Path);
9902
Assert.Equal(Path.Combine(baseDir.
Path
, "web3.config"), args.AdditionalFiles[2].Path);
10119
Directory.Delete(dir.
Path
, true);
10178
Directory.Delete(dir.
Path
, true);
10244
Directory.Delete(dir.
Path
, true);
10351
Directory.Delete(dir.
Path
, true);
10448
Directory.Delete(dir.
Path
, true);
10485
Directory.Delete(dir.
Path
, true);
10525
Directory.Delete(dir.
Path
, true);
10577
var csc = CreateCSharpCompiler(null, sourceDir.
Path
, args, analyzers: analyzers, generators: generators, driverCache: driverCache);
11615
var csc = CreateCSharpCompiler(null, dir.
Path
, args);
11619
var exePath = Path.Combine(dir.
Path
, "a.exe");
11631
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11638
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11639
AssertPdbEmit(dir, pdbPath, @"q:\a.pdb", $@"/pathmap:{dir.
Path
}=q:\");
11645
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11646
AssertPdbEmit(dir, pdbPath, @"q:\a.pdb", $@"/pathmap:{dir.
Path
}=q:\", "/deterministic");
11653
var pdbPath = Path.Combine(dir.
Path
, @"pdb\a.pdb");
11654
AssertPdbEmit(dir, pdbPath, @"q:\pdb\a.pdb", $@"/pathmap:{dir.
Path
}=q:\");
11660
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11667
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11668
AssertPdbEmit(dir, pdbPath, @"/a.pdb", $@"/pathmap:{dir.
Path
}=/");
11674
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11675
AssertPdbEmit(dir, pdbPath, "/goo/a.pdb", $"/pathmap:{dir.
Path
}=/goo,{dir.
Path
}{PathUtilities.DirectorySeparatorChar}=/bar");
11740
var output = ProcessUtilities.RunAndGetOutput(csc32exe.Path, $@"/nologo /debug:full /deterministic /out:Program.exe /pathmap:""{dir32.
Path
}""=X:\ ""{sourceFile.Path}""", expectedRetCode: 0, startFolder: dir32.
Path
);
11743
output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $@"/nologo /debug:full /deterministic /out:Program.exe /pathmap:""{dir64.
Path
}""=X:\ ""{sourceFile.Path}""", expectedRetCode: 0, startFolder: dir64.
Path
);
11793
var csc = CreateCSharpCompiler(null, dir.
Path
,
11799
var exe = Path.Combine(dir.
Path
, "a.exe");
11808
var doc = Path.Combine(dir.
Path
, "doc.xml");
11829
var output = ProcessUtilities.RunAndGetOutput(exe, startFolder: dir.
Path
);
11832
var refDll = Path.Combine(refDir.
Path
, "a.dll");
11844
CleanupAllGeneratedFiles(dir.
Path
);
11845
CleanupAllGeneratedFiles(refDir.
Path
);
11858
var csc = CreateCSharpCompiler(null, dir.
Path
,
11863
var dll = Path.Combine(dir.
Path
, "a.dll");
11866
var refDll = Path.Combine(dir.
Path
, Path.Combine("ref", "a.dll"));
11872
CleanupAllGeneratedFiles(dir.
Path
);
11909
var csc = CreateCSharpCompiler(null, dir.
Path
,
11915
var refDll = Path.Combine(dir.
Path
, "a.dll");
11926
var pdb = Path.Combine(dir.
Path
, "a.pdb");
11929
var doc = Path.Combine(dir.
Path
, "doc.xml");
11957
CleanupAllGeneratedFiles(dir.
Path
);
12018
var result = ProcessUtilities.Run(cscPath, arguments: "/nologo /t:library unknown.cs", workingDirectory: dir.
Path
);
12026
result = ProcessUtilities.Run(cscPath, arguments: "/nologo /t:library unknown.cs", workingDirectory: dir.
Path
);
12045
var result = ProcessUtilities.Run(s_CSharpCompilerExecutable, arguments: $"/nologo /t:library /analyzer:{analyzerFileName} {srcFileName}", workingDirectory: analyzerDir.
Path
);
12247
var cscCopy = Path.Combine(dir.
Path
, "csc.exe");
12255
workingDirectory: dir.
Path
,
12263
result = ProcessUtilities.Run(cscCopy, arguments, workingDirectory: dir.
Path
);
12270
workingDirectory: dir.
Path
,
12287
var csc = CreateCSharpCompiler(null, dir.
Path
, args);
12291
var exePath = Path.Combine(dir.
Path
, "a.exe");
12309
var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.
Path
, sdkDir: null, tempDir: tempDir.
Path
);
12324
var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.
Path
, sdkDir: null, tempDir: tempDir.
Path
);
12344
var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.
Path
, sdkDir: null, tempDir: tempDir.
Path
);
12365
var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.
Path
, sdkDir: null, tempDir: tempDir.
Path
);
13416
var cmd = CreateCSharpCompiler(null, dir.
Path
, arguments,
13478
string binaryPath = Path.Combine(dir.
Path
, "temp.dll");
13481
string pdbPath = Path.Combine(dir.
Path
, pdbName);
13484
string xmlDocFilePath = Path.Combine(dir.
Path
, docName);
13524
string binaryPath = Path.Combine(dir.
Path
, "temp.dll");
13527
string pdbPath = Path.Combine(dir.
Path
, pdbName);
13530
string xmlDocFilePath = Path.Combine(dir.
Path
, docName);
13574
string binaryPath = Path.Combine(dir.
Path
, "temp.dll");
13577
string pdbPath = Path.Combine(dir.
Path
, pdbName);
13580
string xmlDocFilePath = Path.Combine(dir.
Path
, docName);
13605
string binaryPath = Path.Combine(dir.
Path
, "temp.dll");
13661
var cmd = CreateCSharpCompiler(null, dir.
Path
, arguments,
13752
var cmd = CreateCSharpCompiler(null, dir.
Path
, args, analyzers: new[] { analyzer });
13789
var cmd = CreateCSharpCompiler(null, dir.
Path
, args, analyzers: new[] { analyzer });
13922
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.
Path
, generator);
13923
ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.
Path
, generatorPrefix, $"generatedSource.cs"), generatedSource } }, dir, true);
13927
Directory.Delete(dir.
Path
, true);
13963
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.
Path
, generator);
13964
ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.
Path
, generatorPrefix, "generatedSource.cs"), generatedSource } }, dir, true);
14002
var generator1Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.
Path
, generator);
14003
var generator2Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.
Path
, generator2);
14007
{ Path.Combine(dir.
Path
, generator1Prefix, source1Name), source1},
14008
{ Path.Combine(dir.
Path
, generator2Prefix, source2Name), source2},
14013
Directory.Delete(dir.
Path
, true);
14023
var genPath1 = Path.Combine(dir.
Path
, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint1.cs");
14024
var genPath2 = Path.Combine(dir.
Path
, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint2.cs");
14043
using (Stream peStream = File.OpenRead(Path.Combine(dir.
Path
, "checksum.exe")), pdbStream = File.OpenRead(Path.Combine(dir.
Path
, "checksum.pdb")))
14056
Directory.Delete(dir.
Path
, true);
14086
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null);
14088
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator);
14091
{ Path.Combine(generatedDir.
Path
, generatorPrefix, expectedDir), new() { { expectedFileName, generatedSource } } }
14096
Directory.Delete(dir.
Path
, true);
14112
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator1 }, analyzers: null);
14114
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator1);
14115
ValidateWrittenSources(new() { { Path.Combine(generatedDir.
Path
, generatorPrefix), new() { { "generatedSource.cs", generatedSource1 } } } });
14120
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator2 }, analyzers: null);
14122
ValidateWrittenSources(new() { { Path.Combine(generatedDir.
Path
, generatorPrefix), new() { { "generatedSource.cs", generatedSource2 } } } });
14126
Directory.Delete(dir.
Path
, true);
14147
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator, generator2 }, analyzers: null);
14149
var generator1Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator);
14150
var generator2Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator2);
14160
Directory.Delete(dir.
Path
, true);
14188
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null);
14190
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator);
14193
{ Path.Combine(generatedDir.
Path
, generatorPrefix, expectedDir), new() { { generatedFileName, generatedSource } } }
14198
Directory.Delete(dir.
Path
, true);
14207
var snk = Temp.CreateFile("TestKeyPair_", ".snk", dir.
Path
).WriteAllBytes(TestResources.General.snKey);
14209
var virtualSnProvider = new DesktopStrongNameProvider(ImmutableArray.Create(dir.
Path
));
14224
var path = Path.Combine(dir.
Path
, Guid.NewGuid().ToString() + ".dll");
14239
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/analyzer:" + gen1, "/analyzer:" + gen2 }.ToArray());
14246
{ Path.Combine(generatedDir.
Path
, "generator", "TestGenerator"), new() { { "generatedSource.cs", "//from version 2.0.0.0" } } }
14264
ValidateWrittenSources(new() { { generatedDir.
Path
, new() } });
14268
Directory.Delete(dir.
Path
, true);
14280
var generatedDirPath = Path.Combine(dir.
Path
, "noexist");
14289
Directory.Delete(dir.
Path
, true);
14305
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null);
14307
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator);
14308
ValidateWrittenSources(new() { { Path.Combine(generatedDir.
Path
, generatorPrefix), new() { { "generatedSource.cs", generatedSource } } } });
14312
Directory.Delete(dir.
Path
, true);
14381
Directory.Delete(dir.
Path
, true);
14397
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, $"/touchedfiles:{dir.
Path
}/touched", "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null);
14399
var touchedFiles = Directory.GetFiles(dir.
Path
, "touched*");
14402
string[] writtenText = File.ReadAllLines(Path.Combine(dir.
Path
, "touched.write"));
14409
Directory.Delete(dir.
Path
, true);
14477
Directory.Delete(dir.
Path
, true);
14536
$"/out:{objDir.
Path
}/embed.exe",
14546
Directory.Delete(dir.
Path
, true);
14602
pathMapArgument = pathMapArgument.Replace("DIRPATH", dir.
Path
).Replace("SRCDIRPATH", srcDir.
Path
).Replace("OBJDIRPATH", objDir.
Path
);
14608
"/generatedfilesout:" + objDir.
Path
,
14619
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(objDir.
Path
, generator);
14627
Directory.Delete(dir.
Path
, true);
14715
var cmd = CreateCSharpCompiler(null, dir.
Path
, args, generators: new[] { generator });
14775
var cmd = CreateCSharpCompiler(null, dir.
Path
,
14795
var cmd = CreateCSharpCompiler(null, dir.
Path
,
14820
var cmd = CreateCSharpCompiler(null, dir.
Path
,
14840
var cmd = CreateCSharpCompiler(null, dir.
Path
,
14880
Directory.Delete(dir.
Path
, true);
14946
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15027
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15241
CleanupAllGeneratedFiles(srcDirectory.
Path
);
15397
var generatorPath = Path.Combine(directory.
Path
, "generator.dll");
15433
Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.
Path
, additionalFilePath1)));
15434
Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.
Path
, additionalFilePath2)));
15440
string path2 = additionalFile2?.Path ?? Path.Combine(srcDirectory.
Path
, additionalFilePath2);
15457
CleanupAllGeneratedFiles(srcDirectory.
Path
);
15552
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15563
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15604
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15615
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15686
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15697
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15739
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15750
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15817
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15856
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15896
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)
1145
var analyzerConfigPath = PathUtilities.CombineAbsoluteAndRelativePaths(Temp.CreateDirectory().
Path
, ".editorconfig");
1390
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)
99
var dir1 = TempRoot.CreateDirectory().
Path
;
101
var dir2 = TempRoot.CreateDirectory().
Path
;
133
var dir1 = TempRoot.CreateDirectory().
Path
;
135
var dir2 = TempRoot.CreateDirectory().
Path
;
157
var dir = TempRoot.CreateDirectory().
Path
;
Microsoft.CodeAnalysis.Features.UnitTests (2)
EditAndContinue\EditAndContinueWorkspaceServiceTests.cs (2)
124
AddDocument(CreateDesignTimeOnlyDocument(projectPId, name: "dt1.cs", path: Path.Combine(dir.
Path
, "dt1.cs"))).
397
var designTimeOnlyFilePath = Path.Combine(dir.
Path
, designTimeOnlyFileName);
Microsoft.CodeAnalysis.LanguageServer.UnitTests (16)
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);
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 (18)
AnalyzerAssemblyLoaderTests.cs (1)
343
var analyzerPath = Path.Combine(tempDir.CreateDirectory("a").
Path
, "analyzer.dll");
Analyzers\AnalyzerFileReferenceAppDomainTests.cs (4)
49
var loadDomain = AppDomainUtils.Create("AnalyzerTestDomain", basePath: dir.
Path
);
54
var exception = remoteTest.LoadAnalyzer(dir.CreateDirectory("shadow").
Path
, analyzerFile.Path);
107
var loadDomain = AppDomainUtils.Create("AnalyzerTestDomain", basePath: dir.
Path
);
112
var exception = remoteTest.LoadAnalyzer(dir.CreateDirectory("shadow").
Path
, analyzerFile.Path);
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");
FileSystem\RelativePathResolverTests.cs (2)
171
ImmutableArray.Create(dir1.
Path
, dir2.
Path
),
InvokeUtil.cs (1)
145
AnalyzerTestKind.ShadowLoad => [.. 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.VisualBasic.CommandLine.UnitTests (212)
CommandLineIVTTests.vb (5)
34
dir.
Path
,
135
dir.
Path
,
236
dir.
Path
,
347
dir.
Path
,
465
dir.
Path
,
CommandLineTests.vb (199)
78
Dim cmd = New MockVisualBasicCompiler(Nothing, dir.
Path
, {
115
Dim cmd = New MockVisualBasicCompiler(Nothing, dir.
Path
, {
173
Dim cmd = New MockVisualBasicCompiler(Nothing, dir.
Path
, {
210
Dim cmd = New MockVisualBasicCompiler(Nothing, dir.
Path
, {
223
$"vbc : error BC37317: Multiple analyzer config files cannot be in the same directory ('{dir.
Path
}').",
240
Dim cmd = New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", "/errorlog:errorlog", $"/doc:{docName}", "/warnaserror", src.Path})
247
Dim exePath = Path.Combine(dir.
Path
, "temp.exe")
259
Dim cmd = New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", "/t:library", "/preferreduilang:en", $"/doc:{docName}", src.Path})
266
Dim xmlPath = Path.Combine(dir.
Path
, docName)
315
args = DefaultParse({"-debug+/debug:portable"}, folder.
Path
)
388
Dim cmd = New MockVisualBasicCompiler(dir.
Path
, {"/nologo", "a.vb", "/keyfile:key.snk"})
407
Dim cmd = New MockVisualBasicCompiler(dir.
Path
, {"/nologo", "a.vb", "/keycontainer:aaa"})
426
Dim cmd = New MockVisualBasicCompiler(dir.
Path
, {"/nologo", "a.vb", "/features:UseLegacyStrongNameProvider"})
649
Dim tempDir As String = Temp.CreateDirectory().
Path
689
Dim tempDir As String = Temp.CreateDirectory().
Path
741
Dim tempDir As String = Temp.CreateDirectory().
Path
2406
Dim exitCode As Integer = New MockVisualBasicCompiler(Nothing, folder.
Path
, {"/nologo", "/preferreduilang:en", "/t:library", "/recurse:.", "b.vb", "/out:abc.dll"}).Run(outWriter, Nothing)
2411
exitCode = New MockVisualBasicCompiler(Nothing, folder.
Path
, {"/nologo", "/preferreduilang:en", "/t:library", "/recurse:. ", "b.vb", "/out:abc.dll"}).Run(outWriter, Nothing)
2416
exitCode = New MockVisualBasicCompiler(Nothing, folder.
Path
, {"/nologo", "/preferreduilang:en", "/t:library", "/recurse: . ", "/out:abc.dll"}).Run(outWriter, Nothing)
2421
exitCode = New MockVisualBasicCompiler(Nothing, folder.
Path
, {"/nologo", "/preferreduilang:en", "/t:library", "/recurse:./.", "/out:abc.dll"}).Run(outWriter, Nothing)
2428
args = DefaultParse({"/recurse:*.cp*", "/recurse:b\*.v*", "/out:a.dll"}, folder.
Path
)
2431
AssertEx.Equal({folder.
Path
+ "\c.cpp", folder.
Path
+ "\b\B_e.vb"}, resolvedSourceFiles)
2433
args = DefaultParse({"/recurse:.\\\\\\*.vb", "/out:a.dll"}, folder.
Path
)
2438
args = DefaultParse({"/recurse:.////*.vb", "/out:a.dll"}, folder.
Path
)
2456
Dim exitCode = New MockVisualBasicCompiler(Nothing, folder.
Path
, {"/nologo", "/preferreduilang:en", "/t:exe", "/out:abc.exe"}).Run(outWriter, Nothing)
2589
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", "/preferreduilang:en", "/t:library", "/a:missing.dll", "a.vb"})
2606
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", "/preferreduilang:en", "/t:library", "/a:" + GetType(Object).Assembly.Location, "a.vb"})
2624
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.vb"})
2657
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.vb", "/ruleset:" + ruleSetFile.Path})
2687
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
,
2701
vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
,
2737
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
,
2752
vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
,
2791
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.vb", "/ruleset:" + ruleSetFile.Path})
3178
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", "/debug:embedded", "/sourcelink:sl.json", "a.vb"})
3182
Dim peStream = File.OpenRead(Path.Combine(dir.
Path
, "a.exe"))
3211
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", "/debug:portable", "/sourcelink:sl.json", "a.vb"})
3215
Dim pdbStream = File.OpenRead(Path.Combine(dir.
Path
, "a.pdb"))
3366
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", debugSwitch, embedSwitch, "embed.vb", "embed2.vb"})
3385
Using peReader As New PEReader(File.OpenRead(Path.Combine(dir.
Path
, "embed.exe")))
3392
MetadataReaderProvider.FromPortablePdbStream(File.OpenRead(Path.Combine(dir.
Path
, "embed.pdb"))))
3416
symReader = SymReaderFactory.CreateReader(File.OpenRead(Path.Combine(dir.
Path
, "embed.pdb")))
3560
Dim sdkPath = sdkDir.
Path
3562
Dim parser = VisualBasicCommandLineParser.Default.Parse({$"-sdkPath:{sdkPath}"}, parentDir.
Path
, Nothing)
3570
Dim parser = VisualBasicCommandLineParser.Default.Parse({"file.vb", "-sdkPath", $"-out:{parentDir.
Path
}"}, parentDir.
Path
, Nothing)
3581
Dim parser = VisualBasicCommandLineParser.Default.Parse({"file.vb", $"-out:{parentDir.
Path
}", "-sdkPath:path/to/sdk", "/noSdkPath"}, parentDir.
Path
, Nothing)
3590
Dim parser = VisualBasicCommandLineParser.Default.Parse({"file.vb", $"-out:{parentDir.
Path
}", "/noSdkPath", $"-sdkPath:{sdkDir.
Path
}"}, parentDir.
Path
, Nothing)
3591
AssertEx.Equal(ImmutableArray.Create(sdkDir.
Path
), parser.ReferencePaths)
3607
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", "/preferreduilang:en", "/nosdkpath", "/t:library", "a.vb"})
3632
Dim pdbPath = Path.Combine(dir.
Path
, "a.pdb")
3638
Dim vbc = New MockVisualBasicCompiler(dir.
Path
, args)
3642
Dim exePath = Path.Combine(dir.
Path
, "a.exe")
3653
Dim pePdbPath = Path.Combine(dir.
Path
, "a.pdb")
3660
assertPdbEmit(dir, pePdbPath, {$"/pathmap:{dir.
Path
}=q:\"})
3666
assertPdbEmit(dir, pePdbPath, {$"/pathmap:{dir.
Path
}=q:\", "/deterministic"})
3673
assertPdbEmit(subDir, pePdbPath, {$"/pathmap:{dir.
Path
}=q:\"})
3678
Dim pePdbPath = Path.Combine(dir.
Path
, "a.pdb")
3684
Dim pdbPath = Path.Combine(dir.
Path
, "a.pdb")
3685
assertPdbEmit(dir, "/a.pdb", {$"/pathmap:{dir.
Path
}=/"})
3690
Dim pdbPath = Path.Combine(dir.
Path
, "a.pdb")
3691
assertPdbEmit(dir, "/goo/a.pdb", {$"/pathmap:{dir.
Path
}=/goo,{dir.
Path
}{PathUtilities.DirectorySeparatorChar}=/bar"})
5210
Dim output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:l:\x /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.
Path
)
5216
output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /r:mscorlib.dll /vbruntime- /sdkpath:c:folder /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.
Path
)
5222
output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:" & dir.
Path
& " /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.
Path
)
5226
</text>, output.Replace(dir.
Path
, "{SDKPATH}"))
5232
output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:" & dir.
Path
& " /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.
Path
)
5236
</text>, output.Replace(dir.
Path
, "{SDKPATH}"))
5241
output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:" & dir.
Path
& " /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.
Path
)
5245
</text>, output.Replace(dir.
Path
, "{SDKPATH}"))
5252
output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /nostdlib /sdkpath:" & dir.
Path
& " /t:library /vbruntime* /r:" & Path.Combine(RuntimeEnvironment.GetRuntimeDirectory(), "System.dll") & " " & src.ToString(), startFolder:=dir.
Path
)
5253
AssertOutput(<text></text>, output.Replace(dir.
Path
, "{SDKPATH}")) ' SUCCESSFUL BUILD with 'mscorlib.dll' and embedded VbCore
5258
output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /nostdlib /sdkpath:" & dir.
Path
& " /t:library /vbruntime* /r:" & Path.Combine(RuntimeEnvironment.GetRuntimeDirectory(), "System.dll") & " " & src.ToString(), startFolder:=dir.
Path
)
5259
AssertOutput(<text></text>, output.Replace(dir.
Path
, "{SDKPATH}"))
5283
Dim sdkMultiPath = subFolder1.
Path
& "," & subFolder2.
Path
5290
output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, cmdNoStdLibNoRuntime, startFolder:=dir.
Path
, expectedRetCode:=1)
5291
AssertOutput(<text>vbc : error BC2017: could not find library 'mscorlib.dll'</text>, output.Replace(dir.
Path
, "{SDKPATH}"))
5298
output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, cmdNoStdLibNoRuntime, startFolder:=dir.
Path
)
5299
AssertOutput(<text></text>, output.Replace(dir.
Path
, "{SDKPATH}"))
5301
output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, cmd, startFolder:=dir.
Path
, expectedRetCode:=1)
5306
</text>, output.Replace(dir.
Path
, "{SDKPATH}"))
5323
Dim output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /t:library " & src.ToString(), startFolder:=dir.
Path
, expectedRetCode:=1)
5326
output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /nostdlib /define:_MYTYPE=\""Empty\"" /t:library " & src.ToString(), startFolder:=dir.
Path
)
5329
output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:x:\ /vbruntime- /define:_MYTYPE=\""Empty\"" /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.
Path
)
5754
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, commandLineArguments.Concat({inputName1, inputName2}).ToArray())
5761
Assert.Equal(1, Directory.EnumerateFiles(dir.
Path
, "*" & PathUtilities.GetExtension(expectedOutputName)).Count())
5762
Assert.Equal(1, Directory.EnumerateFiles(dir.
Path
, expectedOutputName).Count())
5894
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, commandLineArguments.Concat({fileName}).ToArray())
5946
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en"})
5999
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en", "-imports:System"})
6036
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en"})
6086
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en"})
6130
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en"})
6178
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en"})
6224
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en"})
6266
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en"})
6301
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/target:exe", "/preferreduilang:en", "/out:sub\a.exe"})
6305
Assert.Contains("error BC2012: can't open '" + dir.
Path
+ "\sub\a.exe' for writing", output.ToString(), StringComparison.Ordinal)
6333
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en", "/target:exe", "/out:sub\"})
6367
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en", "/target:exe", "/out:sub\ "})
6401
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en", "/target:exe", "/out:aaa:\a.exe"})
6433
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en", "/target:exe", "/out: "})
6456
Dim output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /t:library " & file.ToString(), startFolder:=dir.
Path
)
6459
output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /t:library /codepage:20127 " & file.ToString(), expectedRetCode:=1, startFolder:=dir.
Path
) ' 20127: US-ASCII
6820
vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
,
6828
vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
,
6838
Dim library As IntPtr = LoadLibraryEx(Path.Combine(dir.
Path
, outputFileName), IntPtr.Zero, 2)
7520
Dim output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /t:library /langversion:9 /preferreduilang:en " & src.ToString(), expectedRetCode:=1, startFolder:=dir.
Path
)
7603
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", "/preferreduilang:en", "/t:library", "a.vb"})
7621
" & Path.GetFullPath(Path.Combine(dir.
Path
, "..\b.vb")) & "(40) : error BC30451: 'Goo' is not declared. It may be inaccessible due to its protection level.
7624
" & Path.GetFullPath(Path.Combine(dir.
Path
, "..\b.vb")) & "(50) : error BC30451: 'Goo' is not declared. It may be inaccessible due to its protection level.
7790
args = DefaultParse({"/additionalfile:web*.config", "a.vb"}, baseDir.
Path
)
7793
Assert.Equal(Path.Combine(baseDir.
Path
, "web1.config"), args.AdditionalFiles(0).Path)
7794
Assert.Equal(Path.Combine(baseDir.
Path
, "web2.config"), args.AdditionalFiles(1).Path)
7795
Assert.Equal(Path.Combine(baseDir.
Path
, "web3.config"), args.AdditionalFiles(2).Path)
7936
Dim vbc = New MockVisualBasicCompiler(Nothing, sourceDir.
Path
, args, analyzers, generators)
8703
Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "A.vb"}, dir.
Path
)
8723
Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "A.vb"}, dir.
Path
)
8744
Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "A.vb"}, dir.
Path
)
8765
Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+:Test001", "A.vb"}, dir.
Path
)
8786
Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "/WarnAsError-", "A.vb"}, dir.
Path
)
8807
Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "/WarnAsError-:Test001", "A.vb"}, dir.
Path
)
8828
Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+:Test002", "/WarnAsError-:Test002", "A.vb"}, dir.
Path
)
8850
Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/NoWarn", "/WarnAsError+", "A.vb"}, dir.
Path
)
8871
Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "/NoWarn", "/WarnAsError-", "A.vb"}, dir.
Path
)
8894
Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/NoWarn", "A.vb"}, dir.
Path
)
8917
Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/NoWarn:Test001", "/WarnAsError+", "/WarnAsError-:Test001", "A.vb"}, dir.
Path
)
9141
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", "/target:exe", fileName})
9346
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
,
9352
Dim exe = Path.Combine(dir.
Path
, "a.exe")
9361
Dim doc = Path.Combine(dir.
Path
, "doc.xml")
9384
Dim output = ProcessUtilities.RunAndGetOutput(exe, startFolder:=dir.
Path
)
9387
Dim refDll = Path.Combine(refDir.
Path
, "a.dll")
9399
CleanupAllGeneratedFiles(dir.
Path
)
9400
CleanupAllGeneratedFiles(refDir.
Path
)
9417
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
,
9423
Dim vb = Path.Combine(dir.
Path
, "a.vb")
9425
Dim dll = Path.Combine(dir.
Path
, "a.dll")
9428
Dim refDll = Path.Combine(dir.
Path
, Path.Combine("ref", "a.dll"))
9439
CleanupAllGeneratedFiles(dir.
Path
)
9464
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
,
9470
Dim refDll = Path.Combine(dir.
Path
, "a.dll")
9481
Dim pdb = Path.Combine(dir.
Path
, "a.pdb")
9484
Dim doc = Path.Combine(dir.
Path
, "doc.xml")
9514
CleanupAllGeneratedFiles(dir.
Path
)
9557
Assert.Equal(0, New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, targetArg, outArg}).Run(output, Nothing))
9558
Assert.True(File.Exists(Path.Combine(dir.
Path
, expectedFile)), "Expected to find: " & expectedFile)
9559
Assert.False(File.Exists(Path.Combine(dir.
Path
, unexpectedFile)), "Didn't expect to find: " & unexpectedFile)
9566
Dim srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
)
9585
Dim srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
)
9605
Dim srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
)
9626
Dim srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
)
9671
Dim result = ProcessUtilities.Run(vbcPath, arguments:="/nologo /t:library unknown.vb", workingDirectory:=dir.
Path
)
9679
result = ProcessUtilities.Run(vbcPath, arguments:="/nologo /t:library unknown.vb", workingDirectory:=dir.
Path
)
9691
Dim src = MakeTrivialExe(directory:=dir.
Path
)
9695
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
, args)
9699
Dim exePath = Path.Combine(dir.
Path
, "a.exe")
9716
Dim vbc = New MockVisualBasicCompiler(Nothing, New BuildPaths("", workingDir.
Path
, Nothing, tempDir.
Path
),
10002
Dim binaryPath As String = Path.Combine(dir.
Path
, "temp.dll")
10005
Dim pdbPath As String = Path.Combine(dir.
Path
, "temp.pdb")
10008
Dim docPath As String = Path.Combine(dir.
Path
, docName)
10054
Dim binaryPath As String = Path.Combine(dir.
Path
, "temp.dll")
10057
Dim pdbPath As String = Path.Combine(dir.
Path
, "temp.pdb")
10060
Dim docPath As String = Path.Combine(dir.
Path
, docName)
10111
Dim binaryPath As String = Path.Combine(dir.
Path
, "temp.dll")
10114
Dim pdbPath As String = Path.Combine(dir.
Path
, "temp.pdb")
10117
Dim docPath As String = Path.Combine(dir.
Path
, docName)
10148
Dim binaryPath As String = Path.Combine(dir.
Path
, "temp.dll")
10175
Dim cmd = New MockVisualBasicCompiler(Nothing, dir.
Path
, args, analyzer)
10212
Dim cmd = New MockVisualBasicCompiler(Nothing, dir.
Path
, args, analyzer)
10420
CleanupAllGeneratedFiles(srcDirectory.
Path
)
10559
Dim generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(baseDirectory:=generatedDir.
Path
, generator)
10561
{{generatedDir.
Path
, New Dictionary(Of String, String)()}}
10565
Directory.Delete(dir.
Path
, True)
10575
Dim generatedDirPath = Path.Combine(dir.
Path
, "noexist")
10587
Directory.Delete(dir.
Path
, True)
10604
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference:=False, additionalFlags:={"/generatedfilesout:" + generatedDir.
Path
}, generators:={generator})
10606
Dim generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(baseDirectory:=generatedDir.
Path
, generator)
10608
{{Path.Combine(generatedDir.
Path
, generatorPrefix), New Dictionary(Of String, String)() From
10614
Directory.Delete(dir.
Path
, True)
10630
Directory.Delete(dir.
Path
, True)
10705
Directory.Delete(dir.
Path
, True)
10740
Dim cmd = New MockVisualBasicCompiler(Nothing, dir.
Path
, {
10783
Dim cmd = New MockVisualBasicCompiler(Nothing, dir.
Path
, {
10828
Dim cmd = New MockVisualBasicCompiler(Nothing, dir.
Path
, {
10876
Dim cmd = New MockVisualBasicCompiler(Nothing, dir.
Path
, {
10909
Dim generatorPath = Path.Combine(directory.
Path
, "generator.dll")
SarifErrorLoggerTests.vb (5)
50
Dim errorLogFile = Path.Combine(errorLogDir.
Path
, "ErrorLog.txt")
85
Dim errorLogFile = Path.Combine(errorLogDir.
Path
, "ErrorLog.txt")
126
Dim errorLogFile = Path.Combine(errorLogDir.
Path
, "ErrorLog.txt")
164
Dim errorLogFile = Path.Combine(outputDir.
Path
, "ErrorLog.txt")
165
Dim outputFilePath = Path.Combine(outputDir.
Path
, "test.dll")
TouchedFileLoggingTests.vb (3)
36
Dim touchedBase = Path.Combine(touchedDir.
Path
, "touched")
67
Dim touchedBase = Path.Combine(touchedDir.
Path
, "touched")
109
Dim touchedBase = Path.Combine(touchedDir.
Path
, "touched")
Microsoft.CodeAnalysis.VisualBasic.Emit.UnitTests (1)
Attributes\EmitTestStrongNameProvider.vb (1)
19
Dim testFileSystem = New TestStrongNameFileSystem(Temp.CreateDirectory().
Path
) With {
Microsoft.CodeAnalysis.Workspaces.MSBuild.UnitTests (6)
NetCoreTests.cs (4)
39
["NUGET_PACKAGES"] = _nugetCacheDir.
Path
46
workingDirectory: SolutionDirectory.
Path
,
54
var arguments = $@"msbuild ""{solutionOrProjectFileName}"" /t:restore /bl:{Path.Combine(SolutionDirectory.
Path
, "restore.binlog")}";
60
var arguments = $@"msbuild ""{solutionOrProjectFileName}"" /bl:{Path.Combine(SolutionDirectory.
Path
, "build.binlog")}";
NewlyCreatedProjectsFromDotNetNew.cs (1)
146
var projectDirectory = SolutionDirectory.
Path
;
WorkspaceTestBase.cs (1)
35
return Path.Combine(this.SolutionDirectory.
Path
, relativeFileName);
Microsoft.CodeAnalysis.Workspaces.UnitTests (2)
CommandLineProject\CommandLineProjectWorkspaceTests.cs (1)
28
var info = CommandLineProject.CreateProjectInfo("TestProject", LanguageNames.CSharp, commandLine, tempDirectory.
Path
, ws);
WorkspaceTests\AdhocWorkspaceTests.cs (1)
283
var analyzerConfigDocFilePath = PathUtilities.CombineAbsoluteAndRelativePaths(Temp.CreateDirectory().
Path
, ".editorconfig");
Microsoft.VisualStudio.LanguageServices.CSharp.UnitTests (10)
PersistentStorage\AbstractPersistentStorageTests.cs (4)
876
solution = solution.AddDocument(id, "file.cs", "class C { void M() }", filePath: Path.Combine(_persistentFolder.
Path
, "file.cs"));
896
solution = solution.AddDocument(id, "file.cs", "class C { void M() }", filePath: Path.Combine(_persistentFolder.
Path
, "file.cs"));
1012
var configuration = new MockPersistentStorageConfiguration(solution.Id, persistentFolder.
Path
, throwOnFailure);
1030
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)
67
Directory.Delete(dir.
Path
, recursive: true);
74
var outputs = new CompilationOutputFilesWithImplicitPdbPath(Path.Combine(dir.
Path
, "nonexistent.dll"));
89
var debugDirPdbPath = Path.Combine(dir.
Path
, "nonexistent.pdb");
106
Directory.Delete(dir.
Path
, recursive: true);
VBCSCompiler.UnitTests (45)
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 (20)
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
;