735 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 (16)
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"),
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 (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
);
1879
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/langversion:?" });
2253
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/debug:embedded", "/sourcelink:sl.json", "a.cs" });
2257
var peStream = File.OpenRead(Path.Combine(dir.
Path
, "a.exe"));
2285
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/debug:portable", "/sourcelink:sl.json", "a.cs" });
2289
var pdbStream = File.OpenRead(Path.Combine(dir.
Path
, "a.pdb"));
2314
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/debug:full", "/sourcelink:sl.json", "a.cs" });
2318
var pdbStream = File.OpenRead(Path.Combine(dir.
Path
, "a.pdb"));
2457
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", debugSwitch, embedSwitch, "embed.cs", "embed2.cs" });
2481
using (var peReader = new PEReader(File.OpenRead(Path.Combine(dir.
Path
, "embed.exe"))))
2488
MetadataReaderProvider.FromPortablePdbStream(File.OpenRead(Path.Combine(dir.
Path
, "embed.pdb"))))
2516
symReader = SymReaderFactory.CreateReader(File.OpenRead(Path.Combine(dir.
Path
, "embed.pdb")));
2788
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/a:missing.dll", "a.cs" });
2811
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + typeof(object).Assembly.Location, "a.cs" });
2928
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs" });
2964
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.cs", "/ruleset:" + ruleSetFile.Path });
2997
var csc = CreateCSharpCompiler(null, dir.
Path
,
3008
csc = CreateCSharpCompiler(null, dir.
Path
,
3044
dir.
Path
);
3076
dir.
Path
);
3109
dir.
Path
);
3142
dir.
Path
);
3176
dir.
Path
);
3210
dir.
Path
);
3244
dir.
Path
);
3278
dir.
Path
);
3313
dir.
Path
);
3348
dir.
Path
);
3372
dir.
Path
);
3405
dir.
Path
);
3438
dir.
Path
);
3472
dir.
Path
);
3516
var csc = CreateCSharpCompiler(null, dir.
Path
,
3527
csc = CreateCSharpCompiler(null, dir.
Path
,
3585
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", "a.cs" });
3595
" + Path.GetFullPath(Path.Combine(dir.
Path
, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Goo' does not exist in the current context
3596
" + Path.GetFullPath(Path.Combine(dir.
Path
, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Goo' does not exist in the current context
3613
csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/t:library", "/fullpaths", "a.cs" });
3618
" + Path.Combine(dir.
Path
, @"a.cs") + @"(8,13): error CS0103: The name 'Goo' does not exist in the current context
3622
" + Path.GetFullPath(Path.Combine(dir.
Path
, @"..\b.cs")) + @"(40,13): error CS0103: The name 'Goo' does not exist in the current context
3623
" + Path.GetFullPath(Path.Combine(dir.
Path
, @"..\b.cs")) + @"(50,13): error CS0103: The name 'Goo' does not exist in the current context
3630
" + Path.Combine(dir.
Path
, @"a.cs") + @"(32,13): error CS0103: The name 'Goo' does not exist in the current context
4494
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/modulename:hocusPocus ", "/out:" + exeName + " ", file1.Path });
4502
Assert.Equal(1, Directory.EnumerateFiles(dir.
Path
, exeName).Count());
4504
using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.
Path
, "aa.exe"))))
4681
var parsedArgs = DefaultParse(new[] { @"/lib:lib1", @"/libpath:lib2", @"/libpaths:lib3", "a.cs" }, dir.
Path
, sdkDirectory: sdkDirectory);
4685
lib1.
Path
,
4686
lib2.
Path
,
4687
lib3.
Path
6002
string tempDir = Temp.CreateDirectory().
Path
;
6038
string tempDir = Temp.CreateDirectory().
Path
;
6071
string tempDir = Temp.CreateDirectory().
Path
;
6105
string tempDir = Temp.CreateDirectory().
Path
;
6117
string tempDir = Temp.CreateDirectory().
Path
;
6955
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/target:exe", "a.cs" });
6977
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/target:exe", "a.cs" });
7001
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/target:library", "a.cs" });
7024
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/target:library", "/preferreduilang:en", "a.cs" });
7082
var csc = CreateCSharpCompiler(null, dir.
Path
, commandLineArguments.Concat(new[] { inputName1, inputName2 }).ToArray());
7090
Assert.Equal(1, Directory.EnumerateFiles(dir.
Path
, "*" + PathUtilities.GetExtension(expectedOutputName)).Count());
7091
Assert.Equal(1, Directory.EnumerateFiles(dir.
Path
, expectedOutputName).Count());
7093
using (var metadata = ModuleMetadata.CreateFromImage(File.ReadAllBytes(Path.Combine(dir.
Path
, expectedOutputName))))
7126
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "/preferreduilang:en", "/r:missing.dll", "a.cs" });
7202
var csc = CreateCSharpCompiler(null, dir.
Path
, commandLineArguments.Concat(new[] { fileName }).ToArray());
7225
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\a.exe" });
7229
Assert.Contains("error CS2012: Cannot open '" + dir.
Path
+ "\\sub\\a.exe' for writing", outWriter.ToString(), StringComparison.Ordinal);
7251
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\" });
7279
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:sub\\ " });
7307
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out:aaa:\\a.exe" });
7333
var csc = CreateCSharpCompiler(null, dir.
Path
, new[] { fileName, "/preferreduilang:en", "/target:exe", "/out: " });
7367
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "a.cs", "/keyfile:key.snk", });
7389
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "a.cs", "/keycontainer:bbb", });
7411
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "/nologo", "a.cs", "/keyFile:key.snk", "/features:UseLegacyStrongNameProvider" });
7431
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "a.cs", "/features:disable-length-based-switch" });
7435
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] { "a.cs" });
7526
var output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $"/nologo /t:library \"{file}\"", startFolder: dir.
Path
);
7529
output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $"/nologo /preferreduilang:en /t:library /codepage:20127 \"{file}\"", expectedRetCode: 1, startFolder: dir.
Path
); // 20127: US-ASCII
7807
csc = CreateCSharpCompiler(null, dir.
Path
, new[]
7817
csc = CreateCSharpCompiler(null, dir.
Path
, new[]
7831
IntPtr lib = LoadLibraryEx(Path.Combine(dir.
Path
, outputFileName), IntPtr.Zero, 0x00000002);
8425
csc = CreateCSharpCompiler(null, Temp.CreateDirectory().
Path
, new[] { source, "/preferreduilang:en" });
8452
csc = CreateCSharpCompiler(null, Temp.CreateDirectory().
Path
, new[] { source, "/preferreduilang:en", "/fullpaths" });
8783
int exitCode1 = CreateCSharpCompiler(null, dir.
Path
, new[] { "/debug:full", "/out:Program.exe", source1.Path }).Run(outWriter);
8789
int exitCode2 = CreateCSharpCompiler(null, dir.
Path
, new[] { "/debug:full", "/out:Program.exe", source2.Path }).Run(outWriter);
8800
int exitCode3 = CreateCSharpCompiler(null, dir.
Path
, new[] { "/debug:full", "/out:Program.exe", source3.Path }).Run(outWriter);
8845
int exitCode = CreateCSharpCompiler(null, dir.
Path
, new[] { "/target:library", "/debug:full", libSrc.Path }).Run(outWriter);
8862
AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.
Path
).Select(p => Path.GetFileName(p)).Order());
8919
AssertEx.Equal(new[] { "Lib.cs", "Lib.dll", "Lib.pdb" }, Directory.GetFiles(dir.
Path
).Select(p => Path.GetFileName(p)).Order());
8927
Directory.Delete(dir.
Path
, recursive: false);
8952
int exitCode = CreateCSharpCompiler(null, dir.
Path
, new[] { "/target:library", "/preferreduilang:en", libSrc.Path }).Run(outWriter);
8960
AssertEx.Equal(new[] { "Lib.cs", "Lib.dll" }, Directory.GetFiles(dir.
Path
).Select(p => Path.GetFileName(p)).Order());
8971
int exitCode = CreateCSharpCompiler(null, dir.
Path
, new[] { "/target:library", "/preferreduilang:en", libSrc.Path }).Run(outWriter);
8972
Assert.Contains($"error CS2012: Cannot open '{libDll.
Path
}' for writing", outWriter.ToString());
8993
var srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
);
9015
var srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
);
9038
var srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
);
9062
var srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
);
9296
TestCS2002(commandLineArgs, tempDir.
Path
, 0, aWrnString);
9302
TestCS2002(commandLineArgs, tempDir.
Path
, 0, warnings);
9308
TestCS2002(commandLineArgs, tempDir.
Path
, 0, AWrnString);
9314
TestCS2002(commandLineArgs, tempDir.
Path
, 0, String.Empty);
9320
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9325
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9330
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9335
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9339
TestCS2002(commandLineArgs, tempParentDir.
Path
, 0, tmpDiraString);
9345
var formattedcs1504Str = String.Format(cs1504, PathUtilities.CombineAbsoluteAndRelativePaths(tempParentDir.
Path
, "tmpDir\a.cs"), "Illegal characters in path.");
9346
TestCS2002(commandLineArgs, tempParentDir.
Path
, 1, formattedcs1504Str);
9354
TestCS2002(commandLineArgs, tempParentDir.
Path
, 1, (string[])null, parseDiags);
9361
TestCS2002(commandLineArgs, tempParentDir.
Path
, 1, (string[])null, parseDiags);
9365
var formattedcs1504 = String.Format(cs1504, PathUtilities.CombineAbsoluteAndRelativePaths(tempParentDir.
Path
, @":a.cs"), @"The given path's format is not supported.");
9366
TestCS2002(commandLineArgs, tempParentDir.
Path
, 1, formattedcs1504);
9369
System.IO.Directory.Delete(tempParentDir.
Path
, true);
9911
args = DefaultParse(new[] { "/additionalfile:web*.config", "a.cs" }, baseDir.
Path
);
9914
Assert.Equal(Path.Combine(baseDir.
Path
, "web1.config"), args.AdditionalFiles[0].Path);
9915
Assert.Equal(Path.Combine(baseDir.
Path
, "web2.config"), args.AdditionalFiles[1].Path);
9916
Assert.Equal(Path.Combine(baseDir.
Path
, "web3.config"), args.AdditionalFiles[2].Path);
10133
Directory.Delete(dir.
Path
, true);
10192
Directory.Delete(dir.
Path
, true);
10258
Directory.Delete(dir.
Path
, true);
10365
Directory.Delete(dir.
Path
, true);
10462
Directory.Delete(dir.
Path
, true);
10499
Directory.Delete(dir.
Path
, true);
10539
Directory.Delete(dir.
Path
, true);
10591
var csc = CreateCSharpCompiler(null, sourceDir.
Path
, args, analyzers: analyzers, generators: generators, driverCache: driverCache);
11629
var csc = CreateCSharpCompiler(null, dir.
Path
, args);
11633
var exePath = Path.Combine(dir.
Path
, "a.exe");
11645
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11652
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11653
AssertPdbEmit(dir, pdbPath, @"q:\a.pdb", $@"/pathmap:{dir.
Path
}=q:\");
11659
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11660
AssertPdbEmit(dir, pdbPath, @"q:\a.pdb", $@"/pathmap:{dir.
Path
}=q:\", "/deterministic");
11667
var pdbPath = Path.Combine(dir.
Path
, @"pdb\a.pdb");
11668
AssertPdbEmit(dir, pdbPath, @"q:\pdb\a.pdb", $@"/pathmap:{dir.
Path
}=q:\");
11674
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11681
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11682
AssertPdbEmit(dir, pdbPath, @"/a.pdb", $@"/pathmap:{dir.
Path
}=/");
11688
var pdbPath = Path.Combine(dir.
Path
, "a.pdb");
11689
AssertPdbEmit(dir, pdbPath, "/goo/a.pdb", $"/pathmap:{dir.
Path
}=/goo,{dir.
Path
}{PathUtilities.DirectorySeparatorChar}=/bar");
11754
var output = ProcessUtilities.RunAndGetOutput(csc32exe.Path, $@"/nologo /debug:full /deterministic /out:Program.exe /pathmap:""{dir32.
Path
}""=X:\ ""{sourceFile.Path}""", expectedRetCode: 0, startFolder: dir32.
Path
);
11757
output = ProcessUtilities.RunAndGetOutput(s_CSharpCompilerExecutable, $@"/nologo /debug:full /deterministic /out:Program.exe /pathmap:""{dir64.
Path
}""=X:\ ""{sourceFile.Path}""", expectedRetCode: 0, startFolder: dir64.
Path
);
11807
var csc = CreateCSharpCompiler(null, dir.
Path
,
11813
var exe = Path.Combine(dir.
Path
, "a.exe");
11822
var doc = Path.Combine(dir.
Path
, "doc.xml");
11843
var output = ProcessUtilities.RunAndGetOutput(exe, startFolder: dir.
Path
);
11846
var refDll = Path.Combine(refDir.
Path
, "a.dll");
11858
CleanupAllGeneratedFiles(dir.
Path
);
11859
CleanupAllGeneratedFiles(refDir.
Path
);
11872
var csc = CreateCSharpCompiler(null, dir.
Path
,
11877
var dll = Path.Combine(dir.
Path
, "a.dll");
11880
var refDll = Path.Combine(dir.
Path
, Path.Combine("ref", "a.dll"));
11886
CleanupAllGeneratedFiles(dir.
Path
);
11923
var csc = CreateCSharpCompiler(null, dir.
Path
,
11929
var refDll = Path.Combine(dir.
Path
, "a.dll");
11940
var pdb = Path.Combine(dir.
Path
, "a.pdb");
11943
var doc = Path.Combine(dir.
Path
, "doc.xml");
11971
CleanupAllGeneratedFiles(dir.
Path
);
12032
var result = ProcessUtilities.Run(cscPath, arguments: "/nologo /t:library unknown.cs", workingDirectory: dir.
Path
);
12040
result = ProcessUtilities.Run(cscPath, arguments: "/nologo /t:library unknown.cs", workingDirectory: dir.
Path
);
12260
var cscCopy = Path.Combine(dir.
Path
, "csc.exe");
12268
workingDirectory: dir.
Path
,
12276
result = ProcessUtilities.Run(cscCopy, arguments, workingDirectory: dir.
Path
);
12283
workingDirectory: dir.
Path
,
12300
var csc = CreateCSharpCompiler(null, dir.
Path
, args);
12304
var exePath = Path.Combine(dir.
Path
, "a.exe");
12322
var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.
Path
, sdkDir: null, tempDir: tempDir.
Path
);
12337
var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.
Path
, sdkDir: null, tempDir: tempDir.
Path
);
12357
var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.
Path
, sdkDir: null, tempDir: tempDir.
Path
);
12378
var buildPaths = new BuildPaths(clientDir: "", workingDir: workingDir.
Path
, sdkDir: null, tempDir: tempDir.
Path
);
13429
var cmd = CreateCSharpCompiler(null, dir.
Path
, arguments,
13491
string binaryPath = Path.Combine(dir.
Path
, "temp.dll");
13494
string pdbPath = Path.Combine(dir.
Path
, pdbName);
13497
string xmlDocFilePath = Path.Combine(dir.
Path
, docName);
13537
string binaryPath = Path.Combine(dir.
Path
, "temp.dll");
13540
string pdbPath = Path.Combine(dir.
Path
, pdbName);
13543
string xmlDocFilePath = Path.Combine(dir.
Path
, docName);
13587
string binaryPath = Path.Combine(dir.
Path
, "temp.dll");
13590
string pdbPath = Path.Combine(dir.
Path
, pdbName);
13593
string xmlDocFilePath = Path.Combine(dir.
Path
, docName);
13618
string binaryPath = Path.Combine(dir.
Path
, "temp.dll");
13674
var cmd = CreateCSharpCompiler(null, dir.
Path
, arguments,
13765
var cmd = CreateCSharpCompiler(null, dir.
Path
, args, analyzers: new[] { analyzer });
13802
var cmd = CreateCSharpCompiler(null, dir.
Path
, args, analyzers: new[] { analyzer });
13935
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.
Path
, generator);
13936
ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.
Path
, generatorPrefix, $"generatedSource.cs"), generatedSource } }, dir, true);
13940
Directory.Delete(dir.
Path
, true);
13976
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.
Path
, generator);
13977
ValidateEmbeddedSources_Portable(new Dictionary<string, string> { { Path.Combine(dir.
Path
, generatorPrefix, "generatedSource.cs"), generatedSource } }, dir, true);
14015
var generator1Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.
Path
, generator);
14016
var generator2Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(dir.
Path
, generator2);
14020
{ Path.Combine(dir.
Path
, generator1Prefix, source1Name), source1},
14021
{ Path.Combine(dir.
Path
, generator2Prefix, source2Name), source2},
14026
Directory.Delete(dir.
Path
, true);
14036
var genPath1 = Path.Combine(dir.
Path
, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint1.cs");
14037
var genPath2 = Path.Combine(dir.
Path
, "Microsoft.CodeAnalysis.Test.Utilities", "Roslyn.Test.Utilities.TestGenerators.TestSourceGenerator", "hint2.cs");
14056
using (Stream peStream = File.OpenRead(Path.Combine(dir.
Path
, "checksum.exe")), pdbStream = File.OpenRead(Path.Combine(dir.
Path
, "checksum.pdb")))
14069
Directory.Delete(dir.
Path
, true);
14099
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null);
14101
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator);
14104
{ Path.Combine(generatedDir.
Path
, generatorPrefix, expectedDir), new() { { expectedFileName, generatedSource } } }
14109
Directory.Delete(dir.
Path
, true);
14125
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator1 }, analyzers: null);
14127
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator1);
14128
ValidateWrittenSources(new() { { Path.Combine(generatedDir.
Path
, generatorPrefix), new() { { "generatedSource.cs", generatedSource1 } } } });
14133
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator2 }, analyzers: null);
14135
ValidateWrittenSources(new() { { Path.Combine(generatedDir.
Path
, generatorPrefix), new() { { "generatedSource.cs", generatedSource2 } } } });
14139
Directory.Delete(dir.
Path
, true);
14160
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator, generator2 }, analyzers: null);
14162
var generator1Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator);
14163
var generator2Prefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator2);
14173
Directory.Delete(dir.
Path
, true);
14201
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null);
14203
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator);
14206
{ Path.Combine(generatedDir.
Path
, generatorPrefix, expectedDir), new() { { generatedFileName, generatedSource } } }
14211
Directory.Delete(dir.
Path
, true);
14220
var snk = Temp.CreateFile("TestKeyPair_", ".snk", dir.
Path
).WriteAllBytes(TestResources.General.snKey);
14222
var virtualSnProvider = new DesktopStrongNameProvider(ImmutableArray.Create(dir.
Path
));
14237
var path = Path.Combine(dir.
Path
, Guid.NewGuid().ToString() + ".dll");
14252
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/analyzer:" + gen1, "/analyzer:" + gen2 }.ToArray());
14259
{ Path.Combine(generatedDir.
Path
, "generator", "TestGenerator"), new() { { "generatedSource.cs", "//from version 2.0.0.0" } } }
14277
ValidateWrittenSources(new() { { generatedDir.
Path
, new() } });
14281
Directory.Delete(dir.
Path
, true);
14293
var generatedDirPath = Path.Combine(dir.
Path
, "noexist");
14302
Directory.Delete(dir.
Path
, true);
14318
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null);
14320
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(generatedDir.
Path
, generator);
14321
ValidateWrittenSources(new() { { Path.Combine(generatedDir.
Path
, generatorPrefix), new() { { "generatedSource.cs", generatedSource } } } });
14325
Directory.Delete(dir.
Path
, true);
14394
Directory.Delete(dir.
Path
, true);
14410
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference: false, additionalFlags: new[] { "/generatedfilesout:" + generatedDir.
Path
, $"/touchedfiles:{dir.
Path
}/touched", "/langversion:preview", "/out:embed.exe" }, generators: new[] { generator }, analyzers: null);
14412
var touchedFiles = Directory.GetFiles(dir.
Path
, "touched*");
14415
string[] writtenText = File.ReadAllLines(Path.Combine(dir.
Path
, "touched.write"));
14422
Directory.Delete(dir.
Path
, true);
14490
Directory.Delete(dir.
Path
, true);
14549
$"/out:{objDir.
Path
}/embed.exe",
14559
Directory.Delete(dir.
Path
, true);
14615
pathMapArgument = pathMapArgument.Replace("DIRPATH", dir.
Path
).Replace("SRCDIRPATH", srcDir.
Path
).Replace("OBJDIRPATH", objDir.
Path
);
14621
"/generatedfilesout:" + objDir.
Path
,
14632
var generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(objDir.
Path
, generator);
14640
Directory.Delete(dir.
Path
, true);
14728
var cmd = CreateCSharpCompiler(null, dir.
Path
, args, generators: new[] { generator });
14788
var cmd = CreateCSharpCompiler(null, dir.
Path
,
14808
var cmd = CreateCSharpCompiler(null, dir.
Path
,
14833
var cmd = CreateCSharpCompiler(null, dir.
Path
,
14853
var cmd = CreateCSharpCompiler(null, dir.
Path
,
14893
Directory.Delete(dir.
Path
, true);
14959
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15040
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15254
CleanupAllGeneratedFiles(srcDirectory.
Path
);
15410
var generatorPath = Path.Combine(directory.
Path
, "generator.dll");
15446
Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.
Path
, additionalFilePath1)));
15447
Directory.CreateDirectory(Path.GetDirectoryName(Path.Combine(srcDirectory.
Path
, additionalFilePath2)));
15453
string path2 = additionalFile2?.Path ?? Path.Combine(srcDirectory.
Path
, additionalFilePath2);
15470
CleanupAllGeneratedFiles(srcDirectory.
Path
);
15565
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15576
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15617
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15628
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15699
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15710
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15752
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15763
cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15830
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15869
var cmd = CreateCSharpCompiler(null, dir.
Path
, new[] {
15909
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)
385
workingDirectory: dir.
Path
);
488
var scriptPath = PathUtilities.CombinePathsUnchecked(PathUtilities.GetFileName(directory.
Path
), scriptName);
489
var workingDirectory = PathUtilities.GetDirectoryName(directory.
Path
);
543
var runner = CreateRunner([$"/loadpath:{dir1.
Path
}", $"/loadpaths:{dir2.
Path
};{dir3.
Path
}", main.Path]);
580
var runner = CreateRunner(["/r:4.dll", $"/lib:{dir1.
Path
}", $"/libpath:{dir2.
Path
}", $"/libpaths:{dir3.
Path
};{dir4.
Path
}", main.Path]);
601
SourcePaths.Add(@""{dir.
Path
}"")
616
> SourcePaths.Add(@""{dir.
Path
}"")
637
ReferencePaths.Add(@""{dir.
Path
}"")
652
> ReferencePaths.Add(@""{dir.
Path
}"")
InteractiveSessionReferencesTests.cs (1)
145
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)
48
LoggerFactory, includeDevKitComponents: false, MefCacheDirectory.
Path
, extensionPaths: null);
153
var content = await projectProvider.GetVirtualProjectContentAsync(Path.Combine(tempDir.
Path
, "BAD"), 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)
31
new RelativePathResolver(ImmutableArray.Create(directory.
Path
), directory.
Path
),
51
searchPaths: ImmutableArray.Create(directory.
Path
),
52
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
2421
Dim exitCode As Integer = New MockVisualBasicCompiler(Nothing, folder.
Path
, {"/nologo", "/preferreduilang:en", "/t:library", "/recurse:.", "b.vb", "/out:abc.dll"}).Run(outWriter, Nothing)
2426
exitCode = New MockVisualBasicCompiler(Nothing, folder.
Path
, {"/nologo", "/preferreduilang:en", "/t:library", "/recurse:. ", "b.vb", "/out:abc.dll"}).Run(outWriter, Nothing)
2431
exitCode = New MockVisualBasicCompiler(Nothing, folder.
Path
, {"/nologo", "/preferreduilang:en", "/t:library", "/recurse: . ", "/out:abc.dll"}).Run(outWriter, Nothing)
2436
exitCode = New MockVisualBasicCompiler(Nothing, folder.
Path
, {"/nologo", "/preferreduilang:en", "/t:library", "/recurse:./.", "/out:abc.dll"}).Run(outWriter, Nothing)
2443
args = DefaultParse({"/recurse:*.cp*", "/recurse:b\*.v*", "/out:a.dll"}, folder.
Path
)
2446
AssertEx.Equal({folder.
Path
+ "\c.cpp", folder.
Path
+ "\b\B_e.vb"}, resolvedSourceFiles)
2448
args = DefaultParse({"/recurse:.\\\\\\*.vb", "/out:a.dll"}, folder.
Path
)
2453
args = DefaultParse({"/recurse:.////*.vb", "/out:a.dll"}, folder.
Path
)
2471
Dim exitCode = New MockVisualBasicCompiler(Nothing, folder.
Path
, {"/nologo", "/preferreduilang:en", "/t:exe", "/out:abc.exe"}).Run(outWriter, Nothing)
2604
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", "/preferreduilang:en", "/t:library", "/a:missing.dll", "a.vb"})
2621
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", "/preferreduilang:en", "/t:library", "/a:" + GetType(Object).Assembly.Location, "a.vb"})
2639
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", "/preferreduilang:en", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.vb"})
2672
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.vb", "/ruleset:" + ruleSetFile.Path})
2702
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
,
2716
vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
,
2752
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
,
2767
vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
,
2806
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", "/t:library", "/a:" + Assembly.GetExecutingAssembly().Location, "a.vb", "/ruleset:" + ruleSetFile.Path})
3193
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", "/debug:embedded", "/sourcelink:sl.json", "a.vb"})
3197
Dim peStream = File.OpenRead(Path.Combine(dir.
Path
, "a.exe"))
3226
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", "/debug:portable", "/sourcelink:sl.json", "a.vb"})
3230
Dim pdbStream = File.OpenRead(Path.Combine(dir.
Path
, "a.pdb"))
3381
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", debugSwitch, embedSwitch, "embed.vb", "embed2.vb"})
3400
Using peReader As New PEReader(File.OpenRead(Path.Combine(dir.
Path
, "embed.exe")))
3407
MetadataReaderProvider.FromPortablePdbStream(File.OpenRead(Path.Combine(dir.
Path
, "embed.pdb"))))
3431
symReader = SymReaderFactory.CreateReader(File.OpenRead(Path.Combine(dir.
Path
, "embed.pdb")))
3575
Dim sdkPath = sdkDir.
Path
3577
Dim parser = VisualBasicCommandLineParser.Default.Parse({$"-sdkPath:{sdkPath}"}, parentDir.
Path
, Nothing)
3585
Dim parser = VisualBasicCommandLineParser.Default.Parse({"file.vb", "-sdkPath", $"-out:{parentDir.
Path
}"}, parentDir.
Path
, Nothing)
3596
Dim parser = VisualBasicCommandLineParser.Default.Parse({"file.vb", $"-out:{parentDir.
Path
}", "-sdkPath:path/to/sdk", "/noSdkPath"}, parentDir.
Path
, Nothing)
3605
Dim parser = VisualBasicCommandLineParser.Default.Parse({"file.vb", $"-out:{parentDir.
Path
}", "/noSdkPath", $"-sdkPath:{sdkDir.
Path
}"}, parentDir.
Path
, Nothing)
3606
AssertEx.Equal(ImmutableArray.Create(sdkDir.
Path
), parser.ReferencePaths)
3622
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", "/preferreduilang:en", "/nosdkpath", "/t:library", "a.vb"})
3647
Dim pdbPath = Path.Combine(dir.
Path
, "a.pdb")
3653
Dim vbc = New MockVisualBasicCompiler(dir.
Path
, args)
3657
Dim exePath = Path.Combine(dir.
Path
, "a.exe")
3668
Dim pePdbPath = Path.Combine(dir.
Path
, "a.pdb")
3675
assertPdbEmit(dir, pePdbPath, {$"/pathmap:{dir.
Path
}=q:\"})
3681
assertPdbEmit(dir, pePdbPath, {$"/pathmap:{dir.
Path
}=q:\", "/deterministic"})
3688
assertPdbEmit(subDir, pePdbPath, {$"/pathmap:{dir.
Path
}=q:\"})
3693
Dim pePdbPath = Path.Combine(dir.
Path
, "a.pdb")
3699
Dim pdbPath = Path.Combine(dir.
Path
, "a.pdb")
3700
assertPdbEmit(dir, "/a.pdb", {$"/pathmap:{dir.
Path
}=/"})
3705
Dim pdbPath = Path.Combine(dir.
Path
, "a.pdb")
3706
assertPdbEmit(dir, "/goo/a.pdb", {$"/pathmap:{dir.
Path
}=/goo,{dir.
Path
}{PathUtilities.DirectorySeparatorChar}=/bar"})
5225
Dim output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:l:\x /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.
Path
)
5231
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
)
5237
output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:" & dir.
Path
& " /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.
Path
)
5241
</text>, output.Replace(dir.
Path
, "{SDKPATH}"))
5247
output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:" & dir.
Path
& " /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.
Path
)
5251
</text>, output.Replace(dir.
Path
, "{SDKPATH}"))
5256
output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:" & dir.
Path
& " /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.
Path
)
5260
</text>, output.Replace(dir.
Path
, "{SDKPATH}"))
5267
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
)
5268
AssertOutput(<text></text>, output.Replace(dir.
Path
, "{SDKPATH}")) ' SUCCESSFUL BUILD with 'mscorlib.dll' and embedded VbCore
5273
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
)
5274
AssertOutput(<text></text>, output.Replace(dir.
Path
, "{SDKPATH}"))
5298
Dim sdkMultiPath = subFolder1.
Path
& "," & subFolder2.
Path
5305
output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, cmdNoStdLibNoRuntime, startFolder:=dir.
Path
, expectedRetCode:=1)
5306
AssertOutput(<text>vbc : error BC2017: could not find library 'mscorlib.dll'</text>, output.Replace(dir.
Path
, "{SDKPATH}"))
5313
output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, cmdNoStdLibNoRuntime, startFolder:=dir.
Path
)
5314
AssertOutput(<text></text>, output.Replace(dir.
Path
, "{SDKPATH}"))
5316
output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, cmd, startFolder:=dir.
Path
, expectedRetCode:=1)
5321
</text>, output.Replace(dir.
Path
, "{SDKPATH}"))
5338
Dim output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /t:library " & src.ToString(), startFolder:=dir.
Path
, expectedRetCode:=1)
5341
output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /nostdlib /define:_MYTYPE=\""Empty\"" /t:library " & src.ToString(), startFolder:=dir.
Path
)
5344
output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /nostdlib /sdkpath:x:\ /vbruntime- /define:_MYTYPE=\""Empty\"" /t:library " & src.ToString(), expectedRetCode:=1, startFolder:=dir.
Path
)
5769
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, commandLineArguments.Concat({inputName1, inputName2}).ToArray())
5776
Assert.Equal(1, Directory.EnumerateFiles(dir.
Path
, "*" & PathUtilities.GetExtension(expectedOutputName)).Count())
5777
Assert.Equal(1, Directory.EnumerateFiles(dir.
Path
, expectedOutputName).Count())
5909
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, commandLineArguments.Concat({fileName}).ToArray())
5961
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en"})
6014
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en", "-imports:System"})
6051
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en"})
6101
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en"})
6145
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en"})
6193
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en"})
6239
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en"})
6281
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en"})
6316
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/target:exe", "/preferreduilang:en", "/out:sub\a.exe"})
6320
Assert.Contains("error BC2012: can't open '" + dir.
Path
+ "\sub\a.exe' for writing", output.ToString(), StringComparison.Ordinal)
6348
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en", "/target:exe", "/out:sub\"})
6382
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en", "/target:exe", "/out:sub\ "})
6416
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en", "/target:exe", "/out:aaa:\a.exe"})
6448
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, "/preferreduilang:en", "/target:exe", "/out: "})
6471
Dim output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /t:library " & file.ToString(), startFolder:=dir.
Path
)
6474
output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /preferreduilang:en /t:library /codepage:20127 " & file.ToString(), expectedRetCode:=1, startFolder:=dir.
Path
) ' 20127: US-ASCII
6835
vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
,
6843
vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
,
6853
Dim library As IntPtr = LoadLibraryEx(Path.Combine(dir.
Path
, outputFileName), IntPtr.Zero, 2)
7535
Dim output = ProcessUtilities.RunAndGetOutput(s_basicCompilerExecutable, "/nologo /t:library /langversion:9 /preferreduilang:en " & src.ToString(), expectedRetCode:=1, startFolder:=dir.
Path
)
7618
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", "/preferreduilang:en", "/t:library", "a.vb"})
7636
" & Path.GetFullPath(Path.Combine(dir.
Path
, "..\b.vb")) & "(40) : error BC30451: 'Goo' is not declared. It may be inaccessible due to its protection level.
7639
" & Path.GetFullPath(Path.Combine(dir.
Path
, "..\b.vb")) & "(50) : error BC30451: 'Goo' is not declared. It may be inaccessible due to its protection level.
7805
args = DefaultParse({"/additionalfile:web*.config", "a.vb"}, baseDir.
Path
)
7808
Assert.Equal(Path.Combine(baseDir.
Path
, "web1.config"), args.AdditionalFiles(0).Path)
7809
Assert.Equal(Path.Combine(baseDir.
Path
, "web2.config"), args.AdditionalFiles(1).Path)
7810
Assert.Equal(Path.Combine(baseDir.
Path
, "web3.config"), args.AdditionalFiles(2).Path)
7951
Dim vbc = New MockVisualBasicCompiler(Nothing, sourceDir.
Path
, args, analyzers, generators)
8718
Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "A.vb"}, dir.
Path
)
8738
Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "A.vb"}, dir.
Path
)
8759
Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "A.vb"}, dir.
Path
)
8780
Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+:Test001", "A.vb"}, dir.
Path
)
8801
Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "/WarnAsError-", "A.vb"}, dir.
Path
)
8822
Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "/WarnAsError-:Test001", "A.vb"}, dir.
Path
)
8843
Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+:Test002", "/WarnAsError-:Test002", "A.vb"}, dir.
Path
)
8865
Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/NoWarn", "/WarnAsError+", "A.vb"}, dir.
Path
)
8886
Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/WarnAsError+", "/NoWarn", "/WarnAsError-", "A.vb"}, dir.
Path
)
8909
Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/NoWarn", "A.vb"}, dir.
Path
)
8932
Dim arguments = DefaultParse({"/ruleset:Rules.RuleSet", "/NoWarn:Test001", "/WarnAsError+", "/WarnAsError-:Test001", "A.vb"}, dir.
Path
)
9156
Dim vbc As New MockVisualBasicCompiler(Nothing, dir.
Path
, {"/nologo", "/target:exe", fileName})
9361
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
,
9367
Dim exe = Path.Combine(dir.
Path
, "a.exe")
9376
Dim doc = Path.Combine(dir.
Path
, "doc.xml")
9399
Dim output = ProcessUtilities.RunAndGetOutput(exe, startFolder:=dir.
Path
)
9402
Dim refDll = Path.Combine(refDir.
Path
, "a.dll")
9414
CleanupAllGeneratedFiles(dir.
Path
)
9415
CleanupAllGeneratedFiles(refDir.
Path
)
9432
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
,
9438
Dim vb = Path.Combine(dir.
Path
, "a.vb")
9440
Dim dll = Path.Combine(dir.
Path
, "a.dll")
9443
Dim refDll = Path.Combine(dir.
Path
, Path.Combine("ref", "a.dll"))
9454
CleanupAllGeneratedFiles(dir.
Path
)
9479
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
,
9485
Dim refDll = Path.Combine(dir.
Path
, "a.dll")
9496
Dim pdb = Path.Combine(dir.
Path
, "a.pdb")
9499
Dim doc = Path.Combine(dir.
Path
, "doc.xml")
9529
CleanupAllGeneratedFiles(dir.
Path
)
9572
Assert.Equal(0, New MockVisualBasicCompiler(Nothing, dir.
Path
, {fileName, targetArg, outArg}).Run(output, Nothing))
9573
Assert.True(File.Exists(Path.Combine(dir.
Path
, expectedFile)), "Expected to find: " & expectedFile)
9574
Assert.False(File.Exists(Path.Combine(dir.
Path
, unexpectedFile)), "Didn't expect to find: " & unexpectedFile)
9581
Dim srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
)
9600
Dim srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
)
9620
Dim srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
)
9641
Dim srcPath = MakeTrivialExe(Temp.CreateDirectory().
Path
)
9686
Dim result = ProcessUtilities.Run(vbcPath, arguments:="/nologo /t:library unknown.vb", workingDirectory:=dir.
Path
)
9694
result = ProcessUtilities.Run(vbcPath, arguments:="/nologo /t:library unknown.vb", workingDirectory:=dir.
Path
)
9706
Dim src = MakeTrivialExe(directory:=dir.
Path
)
9710
Dim vbc = New MockVisualBasicCompiler(Nothing, dir.
Path
, args)
9714
Dim exePath = Path.Combine(dir.
Path
, "a.exe")
9731
Dim vbc = New MockVisualBasicCompiler(Nothing, New BuildPaths("", workingDir.
Path
, Nothing, tempDir.
Path
),
10017
Dim binaryPath As String = Path.Combine(dir.
Path
, "temp.dll")
10020
Dim pdbPath As String = Path.Combine(dir.
Path
, "temp.pdb")
10023
Dim docPath As String = Path.Combine(dir.
Path
, docName)
10069
Dim binaryPath As String = Path.Combine(dir.
Path
, "temp.dll")
10072
Dim pdbPath As String = Path.Combine(dir.
Path
, "temp.pdb")
10075
Dim docPath As String = Path.Combine(dir.
Path
, docName)
10126
Dim binaryPath As String = Path.Combine(dir.
Path
, "temp.dll")
10129
Dim pdbPath As String = Path.Combine(dir.
Path
, "temp.pdb")
10132
Dim docPath As String = Path.Combine(dir.
Path
, docName)
10163
Dim binaryPath As String = Path.Combine(dir.
Path
, "temp.dll")
10190
Dim cmd = New MockVisualBasicCompiler(Nothing, dir.
Path
, args, analyzer)
10227
Dim cmd = New MockVisualBasicCompiler(Nothing, dir.
Path
, args, analyzer)
10435
CleanupAllGeneratedFiles(srcDirectory.
Path
)
10574
Dim generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(baseDirectory:=generatedDir.
Path
, generator)
10576
{{generatedDir.
Path
, New Dictionary(Of String, String)()}}
10580
Directory.Delete(dir.
Path
, True)
10590
Dim generatedDirPath = Path.Combine(dir.
Path
, "noexist")
10602
Directory.Delete(dir.
Path
, True)
10619
VerifyOutput(dir, src, includeCurrentAssemblyAsAnalyzerReference:=False, additionalFlags:={"/generatedfilesout:" + generatedDir.
Path
}, generators:={generator})
10621
Dim generatorPrefix = GeneratorDriver.GetFilePathPrefixForGenerator(baseDirectory:=generatedDir.
Path
, generator)
10623
{{Path.Combine(generatedDir.
Path
, generatorPrefix), New Dictionary(Of String, String)() From
10629
Directory.Delete(dir.
Path
, True)
10645
Directory.Delete(dir.
Path
, True)
10720
Directory.Delete(dir.
Path
, True)
10755
Dim cmd = New MockVisualBasicCompiler(Nothing, dir.
Path
, {
10798
Dim cmd = New MockVisualBasicCompiler(Nothing, dir.
Path
, {
10843
Dim cmd = New MockVisualBasicCompiler(Nothing, dir.
Path
, {
10891
Dim cmd = New MockVisualBasicCompiler(Nothing, dir.
Path
, {
10924
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)
36
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 (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
;