3 writes to Path
Microsoft.Build.UnitTests.Shared (3)
TestEnvironment.cs (3)
738
Path
= FileUtilities.GetTemporaryFile(null, null, extension, createFile);
744
Path
= FileUtilities.GetTemporaryFile(rootPath, null, extension, createFile);
749
Path
= System.IO.Path.Combine(rootPath, fileName);
550 references to Path
Microsoft.Build.BuildCheck.UnitTests (21)
EndToEndTests.cs (21)
53
string output = RunnerUtilities.ExecBootstrapedMSBuild($"{projectFile.
Path
} -check", out bool success, timeoutMilliseconds: timeoutInMilliseconds);
342
string output = RunnerUtilities.ExecBootstrapedMSBuild($"{projectFile.
Path
} -check", out bool success, timeoutMilliseconds: timeoutInMilliseconds);
501
string output = RunnerUtilities.ExecBootstrapedMSBuild($"{projectFile.
Path
}", out bool success, timeoutMilliseconds: timeoutInMilliseconds);
510
output = RunnerUtilities.ExecBootstrapedMSBuild($"{projectFile.
Path
} -check", out success, timeoutMilliseconds: timeoutInMilliseconds);
526
File.AppendAllText(editorconfigFile.
Path
, editorConfigChange);
529
output = RunnerUtilities.ExecBootstrapedMSBuild($"{projectFile.
Path
} -check", out success, timeoutMilliseconds: timeoutInMilliseconds);
539
output = RunnerUtilities.ExecBootstrapedMSBuild($"{projectFile.
Path
}", out success, timeoutMilliseconds: timeoutInMilliseconds);
558
$"{Path.GetFileName(projectFile.
Path
)} /m:1 -nr:False -restore" +
593
var projectDirectory = Path.GetDirectoryName(projectFile.
Path
);
594
string logFile = _env.ExpectFile(".binlog").
Path
;
597
$"{Path.GetFileName(projectFile.
Path
)} /m:1 -nr:False -restore {(checkRequested ? "-check" : string.Empty)} -bl:{logFile}",
648
$"{Path.GetFileName(projectFile.
Path
)} /m:1 -nr:False -restore -check",
707
string? projectDirectory = Path.GetDirectoryName(projectFile.
Path
);
708
string logFile = _env.ExpectFile(".binlog").
Path
;
711
$"{Path.GetFileName(projectFile.
Path
)} /m:1 -nr:False -restore -bl:{logFile}",
762
$"{Path.GetFileName(projectFile.
Path
)} /m:1 -nr:False -restore -check", out bool success, false, _env.Output, timeoutMilliseconds: timeoutInMilliseconds);
798
$"{Path.GetFileName(projectFile.
Path
)} /m:1 -nr:False -restore -check", out bool success, false, _env.Output, timeoutMilliseconds: timeoutInMilliseconds);
822
$"{Path.GetFileName(projectFile.
Path
)} /m:1 -nr:False -restore -check" +
945
$"{Path.GetFileName(projectFile.
Path
)} /m:1 -nr:False -t:restore -check",
1076
_env.SetCurrentDirectory(Path.GetDirectoryName(projectFile.
Path
));
1087
.Replace("TestFilePath", testFile.
Path
)
Microsoft.Build.CommandLine.UnitTests (61)
MSBuildMultithreaded_Tests.cs (1)
144
$"\"{projectFile.
Path
}\" {msbuildArgs}",
MSBuildServer_Tests.cs (25)
95
string output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
, out bool success, false, _output);
101
output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
, out success, false, _output);
110
string? dir = Path.GetDirectoryName(markerFile.
Path
);
114
_output.WriteLine($"The marker file {markerFile.
Path
} was created. The build task has been started. Ready to kill the server.");
119
watcher.Filter = Path.GetFileName(markerFile.
Path
);
123
TransientTestFile sleepProject = _env.CreateFile("napProject.proj", string.Format(sleepingTaskContentsFormat, markerFile.
Path
));
124
RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, sleepProject.
Path
, out _);
127
output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
, out success, false, _output);
145
string output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
, out bool success, false, _output);
154
output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
, out success, false, _output);
161
output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
, out success, false, _output);
182
TransientTestFile sleepProject = _env.CreateFile("napProject.proj", string.Format(sleepingTaskContentsFormat, markerFile.
Path
));
187
string output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
, out bool success, false, _output);
191
string? dir = Path.GetDirectoryName(markerFile.
Path
);
199
_output.WriteLine($"The marker file {markerFile.
Path
} was created. The build task has been started.");
202
watcher.Filter = Path.GetFileName(markerFile.
Path
);
206
RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, sleepProject.
Path
, out _, false, _output);
216
output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
, out success, false, _output);
222
output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
, out success, false, _output);
245
string output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
, out bool success, false, _output);
282
string output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
+ " /nodereuse:false", out bool success, false, _output);
295
string output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
+ " -interactive", out bool success, false, _output);
333
string output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, $"/t:DisplayMessages {project.
Path
}", out bool success, false, _output);
340
_env.SetCurrentDirectory(Path.GetDirectoryName(project.
Path
));
341
output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, $"/t:DisplayMessages {project.
Path
}", out success, false, _output);
XMake_BinlogSwitch_Tests.cs (11)
41
var projectPath = directory.CreateFile("my.proj", content).
Path
;
60
var projectPath = directory.CreateFile("my.proj", content).
Path
;
81
var projectPath = directory.CreateFile("my.proj", content).
Path
;
107
var projectPath = directory.CreateFile("my.proj", content).
Path
;
134
var projectPath = directory.CreateFile("my.proj", content).
Path
;
158
var projectPath = directory.CreateFile("my.proj", content).
Path
;
178
var projectPath = directory.CreateFile("my.proj", content).
Path
;
197
var projectPath = directory.CreateFile("my.proj", content).
Path
;
217
var projectPath = directory.CreateFile("my.proj", content).
Path
;
233
var projectPath = directory.CreateFile("my.proj", content).
Path
;
283
var projectPath = directory.CreateFile("my.proj", content).
Path
;
XMake_Tests.cs (24)
779
string result = RunnerUtilities.ExecMSBuild($" {project.
Path
} -getProperty:Foo", out bool success);
846
string results = RunnerUtilities.ExecMSBuild($" {project.
Path
} {extraSwitch} {graph}", out bool success);
874
string results = RunnerUtilities.ExecMSBuild($" {project.
Path
} /p:someProperty:fdalse= ", out bool success);
900
string resultFile = env.GetTempFile(".tmp").
Path
;
901
string results = RunnerUtilities.ExecMSBuild($" {project.
Path
} {extraSwitch} -getResultOutputFile:{resultFile}", out bool success);
906
result = RunnerUtilities.ExecMSBuild($" {project.
Path
} {extraSwitch} -getResultOutputFile:", out success);
936
string results = RunnerUtilities.ExecMSBuild($" {project.
Path
} /t:GetCompileCommands {extraSwitch}", out bool success);
965
string result = RunnerUtilities.ExecMSBuild($" {project.
Path
} /restore {graph}", out bool success);
1393
var projectPath = directory.CreateFile("my.proj", content).
Path
;
1410
var projectPath = directory.CreateFile("my.proj", content).
Path
;
1431
var projectPath = directory.CreateFile("my.proj", content).
Path
;
1528
var projectPath = directory.CreateFile("my.proj", content).
Path
;
1547
var projectPath = directory.CreateFile("my.proj", content).
Path
;
1584
var projectPath = directory.CreateFile("my.proj", content).
Path
;
1606
var projectPath = directory.CreateFile("my.proj", content).
Path
;
2610
var parametersLoggerOptional = $"{logger} -verbosity:diagnostic \"{projectFile.
Path
}\"";
2627
var parametersLogger = $"{logger} -verbosity:diagnostic \"{projectFile.
Path
}\"";
2648
var parametersLogger = $"{loggerParam} -verbosity:diagnostic \"{projectFile.
Path
}\"";
2755
string output = RunnerUtilities.ExecMSBuild($"\"{testProject.
Path
}\" \"/bl:{binLogLocation}/output.binlog\"", out var success, _output);
2781
string output = RunnerUtilities.ExecMSBuild($"\"{testProject.
Path
}\" \"/bl:{binLog1}\" \"/bl:{binLog2}\" \"/bl:{binLog3}\"", out var success, _output);
2820
string output = RunnerUtilities.ExecMSBuild($"\"{testProject.
Path
}\" \"/bl:{binLog1}\" \"/bl:{binLog2}\" \"/bl:{binLog1}\"", out var success, _output);
2860
string output = RunnerUtilities.ExecMSBuild($"\"{testProject.
Path
}\" \"/bl:{binLog1}\" \"/bl:{binLog2};ProjectImports=None\"", out var success, _output);
2939
string output = RunnerUtilities.ExecMSBuild($"\"{testSolution.
Path
}\" /p:Configuration=Debug", out var success, _output);
3248
return (projectFile.
Path
, tempLoggerProjDir);
Microsoft.Build.Engine.OM.UnitTests (21)
Construction\ProjectRootElement_Tests.cs (2)
1741
initialLocation = env.CreateFile().
Path
;
1757
reloadLocation = env.CreateFile().
Path
;
Construction\ProjectTargetElement_Tests.cs (1)
359
collection.LoadProject(file.
Path
).Build().ShouldBeTrue();
Construction\SolutionFile_Tests.cs (2)
718
string solutionPath = convertToSlnx ? ConvertToSlnx(sln.
Path
) : sln.
Path
;
Definition\Project_Tests.cs (15)
3891
ProjectRootElement pre = ProjectRootElement.Create(env.CreateFile(".proj").
Path
);
3934
ProjectRootElement pre = ProjectRootElement.Create(env.CreateFile(".proj").
Path
);
3977
File.WriteAllText(importFile.
Path
, contents);
3978
ProjectRootElement pre = ProjectRootElement.Create(env.CreateFile(".proj").
Path
);
3981
var import = pre.AddImport(importFile.
Path
);
4000
eventArgs.ImportedProjectFile.ShouldBe(importFile.
Path
);
4024
File.WriteAllText(importFile.
Path
, contents);
4025
ProjectRootElement pre = ProjectRootElement.Create(env.CreateFile(".proj").
Path
);
4028
var import = pre.AddImport(importFile.
Path
);
4047
eventArgs.ImportedProjectFile.ShouldBe(importFile.
Path
);
4066
ProjectRootElement pre = ProjectRootElement.Create(env.CreateFile(".proj").
Path
);
4106
ProjectRootElement pre = ProjectRootElement.Create(env.CreateFile(".proj").
Path
);
4149
ProjectRootElement pre = ProjectRootElement.Create(env.CreateFile(".proj").
Path
);
4194
ProjectRootElement pre1 = ProjectRootElement.Create(env.CreateFile(".proj").
Path
);
4195
ProjectRootElement pre2 = ProjectRootElement.Create(env.CreateFile(".proj").
Path
);
NugetRestoreTests.cs (1)
61
RunnerUtilities.RunProcessAndGetOutput(Path.Combine(currentAssemblyDir, "nuget", "NuGet.exe"), "restore " + sln.
Path
+ " -MSBuildPath \"" + bootstrapMsBuildBinaryDir + "\"", out bool success, outputHelper: _output);
Microsoft.Build.Engine.UnitTests (299)
BackEnd\BuildManager_Tests.cs (60)
740
string tempProject = _env.CreateFile(".proj").
Path
;
989
var result = buildManagerSession.BuildProjectFile(_env.CreateFile("build.proj", contents).
Path
);
1877
string projectFile = _env.CreateFile(projectFolder, ".proj").
Path
;
2008
string p2pProject = _env.CreateFile(".Project2.proj").
Path
;
2094
string importedProjectPath = _env.CreateFile(".proj").
Path
;
2095
string rootProjectPath = _env.CreateFile(".proj").
Path
;
2195
string fileName = _env.CreateFile(".proj").
Path
;
2263
string fileName = _env.CreateFile(".proj").
Path
;
2314
string fileName = _env.CreateFile(".proj").
Path
;
2382
var projA = _env.CreateFile(".proj").
Path
;
2383
var projB = _env.CreateFile(".proj").
Path
;
2431
var projA = _env.CreateFile(".proj").
Path
;
2432
var projB = _env.CreateFile(".proj").
Path
;
2497
var projA = _env.CreateFile(".proj").
Path
;
2498
var projB = _env.CreateFile(".proj").
Path
;
2547
var projA = _env.CreateFile(".proj").
Path
;
2548
var projB = _env.CreateFile(".proj").
Path
;
2599
var projA = _env.CreateFile(".proj").
Path
;
2600
var projB = _env.CreateFile(".proj").
Path
;
2601
var projC = _env.CreateFile(".proj").
Path
;
2602
var projD = _env.CreateFile(".proj").
Path
;
2694
var projA = _env.CreateFile(".proj").
Path
;
2695
var projB = _env.CreateFile(".proj").
Path
;
2696
var projC = _env.CreateFile(".proj").
Path
;
2773
var projA = _env.CreateFile(".proj").
Path
;
2774
var projB = _env.CreateFile(".proj").
Path
;
2775
var projC = _env.CreateFile(".proj").
Path
;
2888
var projA = _env.CreateFile(".proj").
Path
;
2889
var projB = _env.CreateFile(".proj").
Path
;
2890
var projC = _env.CreateFile(".proj").
Path
;
2974
var projA = _env.CreateFile(".proj").
Path
;
2975
var projB = _env.CreateFile(".proj").
Path
;
2976
var projC = _env.CreateFile(".proj").
Path
;
3043
var projA = _env.CreateFile(".proj").
Path
;
3044
var projB = _env.CreateFile(".proj").
Path
;
3118
var projectPath1 = _env.CreateFile(".proj").
Path
;
3123
var projectPath2 = _env.CreateFile(".proj").
Path
;
3186
var projectPath1 = _env.CreateFile(".proj").
Path
;
3201
var projectPath2 = _env.CreateFile(".proj").
Path
;
3271
string projectPath1 = _env.CreateFile(".proj").
Path
;
3286
var projectPath2 = _env.CreateFile(".proj").
Path
;
3369
string fileName = _env.CreateFile(".proj").
Path
;
3508
_env.SetEnvironmentVariable(Constants.DotnetHostPathEnvVarName, tempFile.
Path
);
3630
var projectFilePath = _env.CreateFile().
Path
;
3643
project.FullPath = _env.CreateFile().
Path
;
4070
var entryFile = env.CreateFile(nameof(a), a).
Path
;
4226
string project1 = _env.CreateFile(".proj").
Path
;
4227
string project2 = _env.CreateFile(".proj").
Path
;
4267
string project1 = _env.CreateFile(".proj").
Path
;
4268
string project2 = _env.CreateFile(".proj").
Path
;
4269
string project3 = _env.CreateFile(".proj").
Path
;
4309
string project1 = _env.CreateFile(".proj").
Path
;
4310
string project2 = _env.CreateFile(".proj").
Path
;
4352
string project1 = _env.CreateFile(".proj").
Path
;
4353
string project2 = _env.CreateFile(".proj").
Path
;
4513
var sharedDep = _env.CreateFile(".proj").
Path
;
4514
var projRoot = _env.CreateFile(".proj").
Path
;
4522
childProjects[i] = _env.CreateFile(".proj").
Path
;
4662
childPaths[i] = _env.CreateFile(".proj").
Path
;
4675
string rootPath = _env.CreateFile(".proj").
Path
;
BackEnd\GenerateTemporaryTargetAssembly_Tests.cs (1)
31
<FailingBuilderTask CurrentProject=""{otherproj.
Path
}"" />
BackEnd\IntrinsicTask_Tests.cs (2)
2527
var file1 = env.CreateFile(projectDirectory).
Path
;
2528
var file2 = env.CreateFile(projectDirectory).
Path
;
BackEnd\MSBuild_Tests.cs (3)
796
ObjectModelHelpers.BuildTempProjectFileExpectSuccess(projectFile.
Path
, logger);
828
ObjectModelHelpers.BuildTempProjectFileExpectSuccess(projectFile.
Path
, logger);
875
ObjectModelHelpers.BuildTempProjectFileExpectSuccess(projectFile.
Path
, logger);
BackEnd\SdkResolverLoader_Tests.cs (4)
223
var assemblyToLoad = env.CreateFile(".dll").
Path
;
248
var assemblyToLoad = env.CreateFile(".dll").
Path
;
275
var assemblyToLoad = env.CreateFile(".dll").
Path
;
316
var assemblyToLoad = env.GetTempFile(".dll").
Path
;
BackEnd\TaskBuilder_Tests.cs (2)
89
string results = RunnerUtilities.ExecMSBuild(projectFile.
Path
+ " /v:diag", out bool success);
156
project.FullPath = env.CreateFile().
Path
;
BackEnd\TaskHostFactory_Tests.cs (3)
73
ProjectInstance projectInstance = new(project.
Path
);
178
ProjectInstance projectInstance = new(project.
Path
);
390
ProjectInstance projectInstance = new(project.
Path
);
BinaryLogger_Tests.cs (11)
85
_logFile = _env.ExpectFile(".binlog").
Path
;
143
fileToReplay = _env.ExpectFile(".binlog").
Path
;
224
string replayedLogFile = _env.ExpectFile(".binlog").
Path
;
352
RunnerUtilities.ExecMSBuild($"{projectFile.
Path
} -bl:{_logFile}", out bool success);
412
RunnerUtilities.ExecMSBuild($"{projectFile.
Path
} -nr:False -bl:{_logFile} -flp1:logfile={Path.Combine(logFolder.Path, "logFile.log")};verbosity=diagnostic -flp2:logfile={Path.Combine(logFolder.Path, "logFile2.log")};verbosity=normal", out bool success);
477
string emptyFile = testFolder.CreateFile(emptyFileName).
Path
;
480
Assert.True(NativeMethodsShared.MakeSymbolicLink(symlinkPath, testFile.
Path
, ref errorMessage), errorMessage);
655
string consoleOutput1 = RunnerUtilities.ExecMSBuild($"{projectFile1.
Path
} -bl:{_logFile} -verbosity:diag -nologo", out bool success1);
657
var expected1 = $"-bl:{_logFile} -nologo -verbosity:diag {projectFile1.
Path
}";
663
string consoleOutput2 = RunnerUtilities.ExecMSBuild($"{projectFile2.
Path
} -bl:{_logFile} -verbosity:{verbosity} -nologo", out bool success2);
665
var expected2 = $"-bl:{_logFile} -nologo -verbosity:{verbosity} {projectFile2.
Path
}";
ChangeWaves_Tests.cs (1)
63
Project p = collection.LoadProject(file.
Path
);
Construction\ProjectImportElement_Tests.cs (3)
28
ProjectRootElement rootElement = ProjectRootElement.Open(projectFile.
Path
);
65
ProjectRootElement rootElement = ProjectRootElement.Open(projectFile.
Path
);
124
rootElement.Save(env.GetTempFile(".csproj").
Path
);
Construction\SolutionFile_NewParser_Tests.cs (2)
137
string solutionPath = convertToSlnx ? ConvertToSlnx(sln.
Path
) : sln.
Path
;
Construction\SolutionFile_OldParser_Tests.cs (2)
311
string rptprojPath = env.CreateFile(".rptproj").
Path
;
313
string dqprojPath = env.CreateFile(".dwproj").
Path
;
Construction\SolutionFilter_Tests.cs (23)
124
Directory.GetCurrentDirectory().ShouldNotBe(Path.GetDirectoryName(filterFile.
Path
));
130
ProjectGraphEntryPoint entryPoint = new(filterFile.
Path
, new Dictionary<string, string>());
136
graphFromSolution.ProjectNodes.Single().ProjectInstance.ProjectFileLocation.LocationString.ShouldBe(simpleProject.
Path
);
140
SolutionFile solution = SolutionFile.Parse(filterFile.
Path
);
214
TransientTestFile slnf = testEnvironment.CreateFile(folder, "Dev.slnf", slnfValue.Replace(@"C:\\notAPath\\MSBuild.Dev.sln", sln.
Path
.Replace("\\", "\\\\")));
215
InvalidProjectFileException e = Should.Throw<InvalidProjectFileException>(() => SolutionFile.Parse(slnf.
Path
));
243
Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""Microsoft.Build"", """ + Path.Combine("src", Path.GetFileName(microsoftBuild.
Path
)) + @""", ""{69BE05E2-CBDA-4D27-9733-44E12B0F5627}""
245
Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""MSBuild"", """ + Path.Combine("src", Path.GetFileName(msbuild.
Path
)) + @""", ""{6F92CA55-1D15-4F34-B1FE-56C0B7EB455E}""
247
Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""Microsoft.Build.CommandLine.UnitTests"", """ + Path.Combine("src", Path.GetFileName(commandLineUnitTests.
Path
)) + @""", ""{0ADDBC02-0076-4159-B351-2BF33FAA46B2}""
249
Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""Microsoft.Build.Tasks.UnitTests"", """ + Path.Combine("src", Path.GetFileName(tasksUnitTests.
Path
)) + @""", ""{CF999BDE-02B3-431B-95E6-E88D621D9CBF}""
267
""path"": """ + (convertToSlnx ? ConvertToSlnx(sln.
Path
) : sln.
Path
).Replace("\\", "\\\\") + @""",
269
""" + Path.Combine("src", Path.GetFileName(microsoftBuild.
Path
)!).Replace("\\", "\\\\") + @""",
270
""" + Path.Combine("src", Path.GetFileName(tasksUnitTests.
Path
)!).Replace("\\", "\\\\") + @"""
274
SolutionFile sp = SolutionFile.Parse(slnf.
Path
);
275
sp.ProjectShouldBuild(Path.Combine("src", Path.GetFileName(microsoftBuild.
Path
)!)).ShouldBeTrue();
276
sp.ProjectShouldBuild(Path.Combine("src", Path.GetFileName(tasksUnitTests.
Path
)!)).ShouldBeTrue();
279
(sp.ProjectShouldBuild(Path.Combine("src", Path.GetFileName(commandLineUnitTests.
Path
)!))
280
|| sp.ProjectShouldBuild(Path.Combine("src", Path.GetFileName(msbuild.
Path
)!))
330
SolutionFile sp = SolutionFile.Parse(slnf.
Path
);
421
string slnPath = (convertToSlnx ? ConvertToSlnx(sln.
Path
) : sln.
Path
).Replace("\\", "\\\\");
434
SolutionFile solution = SolutionFile.Parse(slnf.
Path
);
Construction\SolutionProjectGenerator_Tests.cs (11)
77
ProjectInstance[] instances = SolutionProjectGenerator.Generate(SolutionFile.Parse(sln.
Path
), null, null, _buildEventContext, CreateMockLoggingService());
100
string solutionPath = convertToSlnx ? SolutionFile_NewParser_Tests.ConvertToSlnx(sln.
Path
) : sln.
Path
;
152
RunnerUtilities.ExecMSBuild(solutionFile.
Path
+ " /t:classlib", out bool success);
221
string output = RunnerUtilities.ExecMSBuild(solutionFile.
Path
+ " /t:Clean;Build;Custom", out bool success);
299
var output = RunnerUtilities.ExecMSBuild(solutionFile.
Path
+ " /m /t:Clean;Build;Custom", out bool success);
934
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "A", "{{proj1.
Path
}}", "{786E302A-96CE-43DC-B640-D6B6CC9BF6C0}"
936
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "B", "{{proj2.
Path
}}", "{881C1674-4ECA-451D-85B6-D7C59B7F16FA}"
941
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "C", "{{proj3.
Path
}}", "{4A727FF8-65F2-401E-95AD-7C8BBFBE3167}"
944
RunnerUtilities.ExecMSBuild("\"" + proj.
Path
+ "\"", out bool successfulExit);
2985
return SolutionFile.Parse(sln.
Path
);
Definition\Project_Internal_Tests.cs (3)
276
projectRootElement.Save(testEnvironment.CreateFile().
Path
);
304
projectRootElement.Save(testEnvironment.CreateFile().
Path
);
332
projectRootElement.Save(testEnvironment.CreateFile().
Path
);
Definition\ProjectEvaluationContext_Tests.cs (6)
100
_env.CreateFile("1.proj", @"<Project> <PropertyGroup Condition=`Exists('1.file')`></PropertyGroup> </Project>".Cleanup()).
Path
,
101
_env.CreateFile("2.proj", @"<Project> <PropertyGroup Condition=`Exists('2.file')`></PropertyGroup> </Project>".Cleanup()).
Path
144
var projectFile = _env.CreateFile("1.proj", @"<Project> <Import Project='1.file' Condition=`Exists('1.file')`/> <ItemGroup><Compile Include='*.cs'/></ItemGroup> </Project>".Cleanup()).
Path
;
932
searchedPath.EvaluatedValue.ShouldBe(subdirectoryFile.
Path
);
938
? subdirectoryFile.
Path
939
: rootFile.
Path
);
Evaluation\EvaluationLogging_Tests.cs (2)
77
var importFile = env.CreateFile().
Path
;
82
var projectFile = env.CreateFile().
Path
;
Evaluation\Evaluator_Tests.cs (5)
66
Assert.Throws<InvalidProjectFileException>(() => collection.LoadProject(projectFile.
Path
));
90
Project project = new(projectFile.
Path
);
125
Project project = new(projectFile.
Path
);
5048
Project project = pc.LoadProject(tempPath.
Path
);
5052
loggerEvaluatorAction?.Invoke(logger, tempPath.
Path
);
Evaluation\Expander_Tests.cs (10)
4909
ProjectInstance projectInstance = new ProjectInstance(projectFile.
Path
);
4953
ProjectInstance projectInstance = new ProjectInstance(projectFile.
Path
);
4982
ProjectInstance projectInstance = new ProjectInstance(projectFile.
Path
);
5029
ProjectInstance projectInstance = new ProjectInstance(projectFile.
Path
);
5070
ProjectInstance projectInstance = new ProjectInstance(projectFile.
Path
);
5104
ProjectInstance projectInstance = new ProjectInstance(projectFile.
Path
);
5151
new ProjectInstance(projectFile.
Path
);
5192
new ProjectInstance(projectFile.
Path
);
5224
new ProjectInstance(projectFile.
Path
);
5290
.ExpandIntoStringLeaveEscaped($"$([MSBuild]::RegisterBuildCheck({dummyAssemblyFile.
Path
}))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance);
EvaluationProfiler_Tests.cs (1)
304
project.FullPath = _env.CreateFile().
Path
;
FileLogger_Tests.cs (3)
359
var logFile = env.CreateFile(".log").
Path
;
401
fileLogger.Parameters = "logfile=" + logFile.
Path
;
412
string log = File.ReadAllText(logFile.
Path
);
Graph\GetCompatiblePlatformGraph_Tests.cs (11)
48
ProjectGraph graph = new ProjectGraph(entryProject.
Path
);
88
ProjectGraph graph = new ProjectGraph(entryProject.
Path
);
130
ProjectGraph graph = new ProjectGraph(entryProject.
Path
);
170
ProjectGraph graph = new ProjectGraph(entryProject.
Path
);
199
ProjectGraph graph = new ProjectGraph(entryProject.
Path
);
227
ProjectGraph graph = new ProjectGraph(entryProject.
Path
);
254
ProjectGraph graph = new ProjectGraph(entryProject.
Path
);
282
ProjectGraph graph = new ProjectGraph(entryProject.
Path
);
309
ProjectGraph graph = new ProjectGraph(entryProject.
Path
);
339
ProjectGraph graph = new ProjectGraph(entryProject.
Path
);
431
ProjectGraphEntryPoint entryPoint = new(solutionFile.
Path
, new Dictionary<string, string>());
Graph\GraphLoadedFromSolution_tests.cs (13)
39
files[i] = _env.CreateFile(files[i], string.Empty).
Path
;
67
var solutionFile = _env.CreateFile("solutionReference.sln", string.Empty).
Path
;
81
var aggException = Should.Throw<AggregateException>(() => new ProjectGraph(root.
Path
));
229
{"1", _env.CreateFile("1.csproj", string.Empty).
Path
}
250
var solutionFile = _env.CreateFile("solution.sln", solutionContents).
Path
;
499
var solutionFile = _env.CreateFile("solution.sln", solutionContents).
Path
;
594
var graph = new ProjectGraph(_env.CreateFile("solution.sln", solutionContents).
Path
);
610
{"1", GraphTestingUtilities.CreateProjectFile(_env, 1, new[] {2}).
Path
},
611
{"2", GraphTestingUtilities.CreateProjectFile(_env, 2, extraContent: MultitargetingSpecificationPropertyGroup).
Path
},
612
{"3", GraphTestingUtilities.CreateProjectFile(_env, 3, new[] {4}, extraContent: MultitargetingSpecificationPropertyGroup).
Path
},
613
{"4", GraphTestingUtilities.CreateProjectFile(_env, 4).
Path
}
618
var graph = new ProjectGraph(_env.CreateFile("solution.sln", solutionContents).
Path
);
671
var solutionPath = _env.CreateFile("TheSolution.sln", solutionContents).
Path
;
Graph\IsolateProjects_Tests.cs (8)
286
defaultTargets: "UndeclaredReferenceTarget").
Path
;
301
defaultTargets: "DeclaredReferenceTarget").
Path
;
319
defaultTargets: "BuildDeclaredReference").
Path
;
514
var rootProjectFile = CreateTmpFile(_env).
Path
;
515
var declaredReferenceFile = CreateTmpFile(_env).
Path
;
516
var undeclaredReferenceFile = CreateTmpFile(_env).
Path
;
578
".Cleanup()).
Path
;
595
".Cleanup()).
Path
;
Graph\ProjectGraph_Tests.cs (78)
65
var projectGraph = new ProjectGraph(entryProject.
Path
);
67
projectGraph.ProjectNodes.First().ProjectInstance.FullPath.ShouldBe(entryProject.
Path
);
93
Should.Throw<CircularDependencyException>(() => new ProjectGraph(entryProject.
Path
));
106
entryProject.
Path
,
118
projectGraph.ProjectNodes.First().ProjectInstance.FullPath.ShouldBe(entryProject.
Path
);
208
entryProject.
Path
,
230
ProjectGraph graph = new ProjectGraph(entryProject.
Path
);
259
ProjectGraph graph = new ProjectGraph(entryProject.
Path
);
308
var projectsInCycle = new List<string> { entryProject.
Path
, proj3.
Path
, proj2.
Path
, entryProject.
Path
};
310
Should.Throw<CircularDependencyException>(() => new ProjectGraph(entryProject.
Path
)).Message.ShouldContain(expectedErrorMessage);
322
Should.Throw<CircularDependencyException>(() => new ProjectGraph(entryProject.
Path
));
342
var projectsInCycle = new List<string> { proj2.
Path
, proj3.
Path
, proj7.
Path
, proj6.
Path
, proj2.
Path
};
344
Should.Throw<CircularDependencyException>(() => new ProjectGraph(entryProject.
Path
)).Message.ShouldContain(errorMessage);
357
var entryPoint1 = new ProjectGraphEntryPoint(entryFile1.
Path
, new Dictionary<string, string> { ["B"] = "EntryPointB", ["C"] = "EntryPointC" });
358
var entryPoint2 = new ProjectGraphEntryPoint(entryFile2.
Path
, null);
403
ProjectGraph graph = new ProjectGraph(entryProject.
Path
);
430
ProjectGraph graph = new ProjectGraph(entryProject.
Path
);
461
ProjectGraph graph = new ProjectGraph(entryProject.
Path
);
496
entryProject.
Path
,
532
ProjectGraph graph = new ProjectGraph(entryProject.
Path
);
563
var aggException = Should.Throw<AggregateException>(() => new ProjectGraph(entryProject.
Path
));
578
var projectGraph = new ProjectGraph(new[] { entryProject1.
Path
, entryProject2.
Path
});
598
var entryPoint1 = new ProjectGraphEntryPoint(entryProject.
Path
, new Dictionary<string, string> { { "Platform", "x86" } });
599
var entryPoint2 = new ProjectGraphEntryPoint(entryProject.
Path
, new Dictionary<string, string> { { "Platform", "x64" } });
637
var entryPoint1 = new ProjectGraphEntryPoint(entryProject.
Path
, new Dictionary<string, string> { { "Platform", "x86" } });
638
var entryPoint2 = new ProjectGraphEntryPoint(entryProject.
Path
, new Dictionary<string, string> { { "Platform", "x64" } });
673
var projectGraph = new ProjectGraph(new[] { entryProject1.
Path
, entryProject2.
Path
, entryProject3.
Path
});
818
SolutionFile solutionFile = SolutionFile.Parse(slnFile.
Path
);
861
var projectGraph = new ProjectGraph(slnFile.
Path
);
924
var projectGraph = new ProjectGraph(entryProject.
Path
);
952
var projectGraph = new ProjectGraph(entryProject.
Path
);
983
var projectGraph = new ProjectGraph(entryProject.
Path
);
1005
var projectGraph = new ProjectGraph(entryProject.
Path
);
1023
var projectGraph = new ProjectGraph(entryProject.
Path
);
1046
var projectGraph = new ProjectGraph(entryProject.
Path
);
1069
var projectGraph = new ProjectGraph(entryProject.
Path
);
1086
var projectGraph = new ProjectGraph(entryProject.
Path
);
1106
.
Path
;
1140
.
Path
;
1175
extraContent: ProjectReferenceTargetsWithMultitargeting).
Path
;
1230
.
Path
;
1299
.
Path
;
1313
.
Path
;
1394
var projectGraph = new ProjectGraph(entryProject.
Path
);
1417
var projectGraph = new ProjectGraph(entryProject.
Path
);
1447
var projectGraph = new ProjectGraph(entryProject.
Path
);
1504
var projectGraph = new ProjectGraph(entryProjectFile: entryProject.
Path
);
1632
var graph = new ProjectGraph(new HashSet<string> { entryProject1.
Path
, entryProject2.
Path
});
1901
projectReferences: new[] { 2 }).
Path
;
1935
.
Path
;
1975
var root = CreateProjectFile(_env, 1, new[] { 2 }, null, null, multitargetingSpecification).
Path
;
1994
var root = CreateProjectFile(env: _env, projectNumber: 1, projectReferences: new[] { 2 }, projectReferenceTargets: null, defaultTargets: null, extraContent: MultitargetingSpecificationPropertyGroup).
Path
;
2021
extraContent: innerBuildViaLocalProperty).
Path
;
2041
var root = CreateProjectFile(env: _env, projectNumber: 1, projectReferences: new[] { 2 }, projectReferenceTargets: null, defaultTargets: null, extraContent: MultitargetingSpecificationPropertyGroup).
Path
;
2060
var root = CreateProjectFile(env: _env, projectNumber: 1, projectReferences: new[] { 2, 3 }, projectReferenceTargets: null, defaultTargets: null, extraContent: MultitargetingSpecificationPropertyGroup).
Path
;
2086
var root = CreateProjectFile(env: _env, projectNumber: 1, projectReferences: new[] { 2, 3 }, projectReferenceTargets: null, defaultTargets: null, extraContent: extraInnerBuildReferenceSpec).
Path
;
2129
CreateProjectFile(env: _env, projectNumber: 1, projectReferences: null, projectReferenceTargets: null, defaultTargets: null, extraContent: MultitargetingSpecificationPropertyGroup).
Path
,
2130
CreateProjectFile(env: _env, projectNumber: 2, projectReferences: null, projectReferenceTargets: null, defaultTargets: null, extraContent: referenceToInnerBuild).
Path
2160
var root = CreateProjectFile(env: _env, projectNumber: 1, projectReferences: null, projectReferenceTargets: null, defaultTargets: null, extraContent: referenceToInnerBuild).
Path
;
2200
.
Path
;
2846
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Project1", "{{project1File.
Path
}}", "{8761499A-7280-43C4-A32F-7F41C47CA6DF}"
2848
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Project2", "{{project2File.
Path
}}", "{2022C11A-1405-4983-BEC2-3A8B0233108F}"
2871
SolutionFile solutionFile = SolutionFile.Parse(slnFile.
Path
);
2873
ProjectGraph projectGraph = new(slnFile.
Path
);
2897
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Project1", "{{project1File.
Path
}}", "{8761499A-7280-43C4-A32F-7F41C47CA6DF}"
2916
SolutionFile solutionFile = SolutionFile.Parse(slnFile.
Path
);
2918
ProjectGraph projectGraph = new(slnFile.
Path
);
Graph\ResultCacheBasedBuilds_Tests.cs (8)
53
var project = CreateProjectFileWithBuildTargetAndItems(_env, 1).
Path
;
58
.ToArray())).
Path
;
80
var project = CreateProjectFileWithBuildTargetAndItems(_env, 1).
Path
;
125
var projectFile = CreateProjectFileWithBuildTargetAndItems(_env, 1, null, defaultTargets, explicitTargets).
Path
;
127
var outputCache = _env.DefaultTestDirectory.CreateFile("referenceCache").
Path
;
460
outputCaches[node] = env.DefaultTestDirectory.CreateFile($"OutputCache-{ProjectNumber(node)}").
Path
;
554
var project = CreateProjectFileWithBuildTargetAndItems(_env, 1).
Path
;
555
var existingFile = _env.CreateFile("FileExists", string.Empty).
Path
;
Instance\ProjectInstance_Internal_Tests.cs (3)
763
var file = env.CreateFile().
Path
;
895
projectRootElement.Save(testEnvironment.CreateFile().
Path
);
923
projectRootElement.Save(testEnvironment.CreateFile().
Path
);
ProjectCache\ProjectCacheTests.cs (6)
912
BuildResult buildResult = buildSession.BuildProjectFile(project1.
Path
);
1148
var buildResult = buildSession.BuildProjectFile(project.
Path
);
1364
GraphBuildResult graphResult = buildSession.BuildGraph(new ProjectGraph(project.
Path
));
1597
.Select(i => _env.CreateFile($"project{i}.proj", project).
Path
)
1697
var projectPath = directory.CreateFile("app.csproj", content).
Path
;
1742
FileUtilities.DeleteNoThrow(file1.
Path
);
Telemetry\Telemetry_Tests.cs (1)
281
var projectFile = testEnv.CreateFile("test.proj", testProject).
Path
;
TerminalLogger_Tests.cs (9)
913
string logFileWithTL = env.ExpectFile(".binlog").
Path
;
914
string logFileWithoutTL = env.ExpectFile(".binlog").
Path
;
917
RunnerUtilities.ExecMSBuild($"{projectFile.
Path
} /bl:{logFileWithTL} -flp:logfile={Path.Combine(logFolder.Path, "logFileWithTL.log")};verbosity=diagnostic -tl:on", out bool success, outputHelper: _outputHelper);
921
RunnerUtilities.ExecMSBuild($"{projectFile.
Path
} /bl:{logFileWithoutTL} -flp:logfile={Path.Combine(logFolder.Path, "logFileWithoutTL.log")};verbosity=diagnostic", out success, outputHelper: _outputHelper);
1057
<MSBuild Projects='{project1.
Path
};{project2.
Path
};{project3.
Path
}' BuildInParallel='true' />
1062
string binlogPath = env.ExpectFile(".binlog").
Path
;
1065
RunnerUtilities.ExecMSBuild($"{solutionFile.
Path
} /m:4 /bl:{binlogPath}", out bool success, outputHelper: _outputHelper);
TerminalLoggerConfiguration_Tests.cs (1)
38
_cmd = $"{projectFile.
Path
} -target:Hello -logger:{typeof(MockLogger).FullName},{typeof(MockLogger).Assembly.Location};ReportTelemetry";
Utilities_Tests.cs (3)
84
MSBuildApp.Execute([ @"c:\bin\msbuild.exe", '"' + inputFile.
Path
+ '"', '"' + (NativeMethodsShared.IsUnixLike ? "-pp:" : "/pp:") + outputFile.
Path
+ '"']));
87
foreach (string line in File.ReadLines(outputFile.
Path
))
Microsoft.Build.Tasks.UnitTests (137)
AddToWin32Manifest_Tests.cs (1)
103
var projectFile = env.CreateFile(projectFolder, "test.csproj", projectContent).
Path
;
AssemblyDependency\ResolveAssemblyReferenceCacheSerialization.cs (6)
126
sysState.SerializeCache(file.
Path
, null);
127
sysState2 = StateFileBase.DeserializeCache<SystemState>(file.
Path
, null);
162
sysState.SerializeCache(file.
Path
, null);
163
sysState2 = StateFileBase.DeserializeCache<SystemState>(file.
Path
, null);
188
sysState.SerializeCache(file.
Path
, null);
189
sysState2 = StateFileBase.DeserializeCache<SystemState>(file.
Path
, null);
CodeTaskFactoryEmbeddedFileInBinlogTestHelper.cs (5)
41
<Code Type="Class" Language="cs" Source="{sourceClass.
Path
}">
57
Parameters = $"LogFile={binlog.
Path
}",
65
string projectImportsZipPath = Path.ChangeExtension(binlog.
Path
, ".ProjectImports.zip");
109
Parameters = $"LogFile={binlog.
Path
}",
117
string projectImportsZipPath = Path.ChangeExtension(binlog.
Path
, ".ProjectImports.zip");
Copy_Tests.cs (17)
146
SourceFiles = new ITaskItem[] { new TaskItem(sourceFile.
Path
) },
172
SourceFiles = new ITaskItem[] { new TaskItem(sourceFile.
Path
) },
273
SourceFiles = new ITaskItem[] { new TaskItem(sourceFile.
Path
) },
349
SourceFiles = new ITaskItem[] { new TaskItem(sourceFile.
Path
) },
374
SourceFiles = new ITaskItem[] { new TaskItem(sourceFile.
Path
) },
399
SourceFiles = new ITaskItem[] { new TaskItem(sourceFile.
Path
) },
423
SourceFiles = new ITaskItem[] { new TaskItem(sourceFile.
Path
) },
449
SourceFiles = new ITaskItem[] { new TaskItem(sourceFile.
Path
) },
476
SourceFiles = new ITaskItem[] { new TaskItem(sourceFile.
Path
) },
2574
var source = env.DefaultTestDirectory.CreateFile("source.txt", "This is a source file").
Path
;
2575
var existing = env.DefaultTestDirectory.CreateFile("destination.txt", "This is an existing file.").
Path
;
3005
ITaskItem[] sourceFiles = { new TaskItem(sourceFile1.
Path
) };
3025
sourceFiles = new TaskItem[] { new TaskItem(sourceFile2.
Path
) };
3044
File.ReadAllText(sourceFile1.
Path
).ShouldBe("This is the first source temp file.");
3048
Path.Combine(Path.GetDirectoryName(sourceFile2.
Path
), ".", Path.GetFileName(sourceFile2.
Path
))) // sourceFile2.Path with a "." inserted before the file name
3062
File.Exists(sourceFile2.
Path
).ShouldBeTrue();
CreateCSharpManifestResourceName_Tests.cs (9)
388
ITaskItem i = new TaskItem(resXFile.
Path
);
423
env.SetCurrentDirectory(Path.GetDirectoryName(resourceFile.
Path
));
491
ITaskItem i = new TaskItem(Path.GetFileName(resXFile.
Path
));
497
env.SetCurrentDirectory(Path.GetDirectoryName(resXFile.
Path
));
526
ITaskItem i = new TaskItem(resXFile.
Path
);
556
ITaskItem i = new TaskItem(Path.GetFileName(resXFile.
Path
));
562
env.SetCurrentDirectory(Path.GetDirectoryName(resXFile.
Path
));
590
ITaskItem i = new TaskItem(resXFile.
Path
);
598
env.SetCurrentDirectory(Path.GetDirectoryName(resXFile.
Path
));
Exec_Tests.cs (1)
1060
var textFilePath = env.CreateFile("leading-whitespace.txt", lineWithLeadingWhitespace).
Path
;
GenerateBindingRedirects_Tests.cs (4)
269
string outputAppConfigFile = env.ExpectFile(".config").
Path
;
281
string outputAppConfigFile = _env.ExpectFile(".config").
Path
;
319
string outputAppConfig = string.IsNullOrEmpty(targetAppConfigFile) ? _env.ExpectFile(".config").
Path
: targetAppConfigFile;
353
string appConfigFile = _env.CreateFile(transientTestFolder ?? new TransientTestFolder(), ".config").
Path
;
HintPathResolver_Tests.cs (3)
34
bool result = ResolveHintPath(tempFile.
Path
);
54
bool result = ResolveHintPath(Environment.NewLine + tempFile.
Path
+ Environment.NewLine);
63
bool result = ResolveHintPath(" " + tempFile.
Path
+ " ");
MSBuildInternalMessage_Tests.cs (5)
44
var projectFile = env.CreateFile(env.CreateFolder(), "test.csproj", projectContent).
Path
;
87
var projectFile = env.CreateFile(env.CreateFolder(), "test.csproj", projectContent).
Path
;
142
var projectFile = env.CreateFile(env.CreateFolder(), "test.csproj", projectContent).
Path
;
217
var projectFile = env.CreateFile(env.CreateFolder(), fileName, projectContent).
Path
;
262
var projectFile = env.CreateFile(env.CreateFolder(), "test.csproj", projectContent).
Path
;
RARPrecomputedCache_Tests.cs (19)
31
{ Path.Combine(standardCache.
Path
, "assembly1"), new SystemState.FileState(now) },
32
{ Path.Combine(standardCache.
Path
, "assembly2"), new SystemState.FileState(now) { Assembly = new Shared.AssemblyNameExtension("hi") } } };
37
t.StateFile = standardCache.
Path
;
39
int standardLen = File.ReadAllText(standardCache.
Path
).Length;
40
File.Delete(standardCache.
Path
);
43
string precomputedPath = standardCache.
Path
+ ".cache";
47
File.Exists(standardCache.
Path
).ShouldBeFalse();
69
rarWriterTask.StateFile = standardCache.
Path
;
75
string dllName = Path.Combine(Path.GetDirectoryName(standardCache.
Path
), "randomFolder", "dll.dll");
84
string precomputedCachePath = standardCache.
Path
+ ".cache";
91
rarReaderTask.StateFile = standardCache.
Path
;
116
string dllName = Path.Combine(Path.GetDirectoryName(precomputedCache.
Path
), "randomFolder", "dll.dll");
118
{ Path.Combine(precomputedCache.
Path
, "..", "assembly1", "assembly1"), new SystemState.FileState(DateTime.Now) },
119
{ Path.Combine(precomputedCache.
Path
, "assembly2"), new SystemState.FileState(DateTime.Now) { Assembly = new Shared.AssemblyNameExtension("hi") } },
126
rarWriterTask.AssemblyInformationCacheOutputPath = precomputedCache.
Path
;
131
File.Delete(precomputedCache.
Path
);
135
rarReaderTask.StateFile = precomputedCache.
Path
.Substring(0, precomputedCache.
Path
.Length - 6); // Not a real path; should not be used.
138
new TaskItem(precomputedCache.
Path
)
ResourceHandling\GenerateResource_Tests.cs (22)
322
string resxFileInput = Utilities.WriteTestResX(false, null, null, _env.CreateFile(folder, ".resx").
Path
);
325
t.StateFile = new TaskItem(_env.GetTempFile(".cache").
Path
);
368
string resxFileInput = Utilities.WriteTestResX(false, null, null, _env.CreateFile(folder, ".resx").
Path
);
371
t.StateFile = new TaskItem(_env.GetTempFile(".cache").
Path
);
463
+ " <value>" + linkedTextFile.
Path
+ ";System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>\xd\xa"
466
string resxFile = Utilities.WriteTestResX(false, null, linkedTextData, _env.CreateFile(folder, ".resx").
Path
, includeDefaultString: false);
467
string stateFile = _env.GetTempFile(".cache").
Path
;
484
File.WriteAllText(linkedTextFile.
Path
, "updated content");
485
File.SetLastWriteTime(linkedTextFile.
Path
, DateTime.Now.AddDays(1));
501
string resxFileInput = Utilities.WriteTestResX(false, null, null, _env.CreateFile(folder, ".resx").
Path
);
502
TaskItem stateFile = new TaskItem(_env.GetTempFile(".cache").
Path
);
723
var firstResx = Utilities.WriteTestResX(false, null, null, _env.CreateFile(folder, ".resx").
Path
);
724
var secondResx = Utilities.WriteTestResX(false, null, null, _env.CreateFile(folder, ".resx").
Path
);
725
var cache = _env.GetTempFile(folder, ".cache").
Path
;
2298
gr.Sources = new ITaskItem[] { new TaskItem(resource.
Path
) };
2346
t.StateFile = new TaskItem(env.GetTempFile(".cache").
Path
);
2349
var resourcesFile = env.CreateFile(inputExtension).
Path
;
2352
t.OutputResources = new ITaskItem[] { new TaskItem(env.GetTempFile(".resources").
Path
) };
3945
string resxFile = env.CreateFile("test.resx").
Path
;
4207
File.SetLastWriteTime(dll.
Path
, DateTime.Now - TimeSpan.FromDays(30));
4209
var referenceItem = new TaskItem(dll.
Path
);
4412
resgenFile = env.CreateFile(".resx", contents).
Path
;
ResourceHandling\MSBuildResXReader_Tests.cs (3)
166
File.WriteAllText(linkedTextFile.
Path
,
307
File.WriteAllText(linkedTextFile.
Path
,
313
<value>{linkedTextFile.
Path
};{typeNameInResx}</value>
RoslynCodeTaskFactory_Tests.cs (14)
86
string output = RunnerUtilities.ExecMSBuild(inlineTask.
Path
, out bool success);
130
string output = RunnerUtilities.ExecMSBuild(assemblyProj.
Path
+ $" /p:OutDir={Path.Combine(folder.Path, "subFolder")} /restore", out bool success);
155
output = RunnerUtilities.ExecMSBuild(inlineTask.
Path
, out success);
348
<Code Type=""Class"" Language=""cs"" Source=""{taskFile.
Path
}"" />
358
string output = RunnerUtilities.ExecMSBuild(projectFile.
Path
+ " /v:d", out bool success);
430
TryLoadTaskBodyAndExpectSuccess($"<Code Source=\"{file.
Path
}\"/>", expectedCodeType: RoslynCodeTaskFactoryCodeType.Class);
434
TryLoadTaskBodyAndExpectSuccess($"<Code Source=\"{file.
Path
}\" Type=\"{codeType}\">code</Code>", expectedCodeType: codeType);
527
$"<Code Source=\"{file.
Path
}\" />",
544
$"<Code Source=\"{file.
Path
}\" Type=\"Fragment\"/>",
560
$"<Code Source=\"{file.
Path
}\" Type=\"Method\"/>",
736
$"<Code Source=\"{file.
Path
}\"/>",
1191
projectFile.
Path
+ " /t:Build /mt /v:detailed",
1301
string buildArgs = $"{solutionFile.
Path
} /m /mt";
1372
string absolutePath = codeFile.
Path
;
TaskFactoryUtilities_Tests.cs (2)
41
string manifestPath = TaskFactoryUtilities.CreateLoadManifest(tempAssemblyFile.
Path
, directories);
44
manifestPath.ShouldBe(tempAssemblyFile.
Path
+ TaskFactoryUtilities.InlineTaskLoadManifestSuffix);
Unzip_Tests.cs (6)
31
new FileInfo(file1.
Path
).IsReadOnly = true;
195
new FileInfo(file1.
Path
).IsReadOnly = true;
228
SourceFiles = new ITaskItem[] { new TaskItem(file.
Path
), },
483
string output = RunnerUtilities.RunProcessAndGetOutput($"/bin/sh", $"-c \"{command} {sourceFile.
Path
}\"", out bool success);
486
ExecuteCommand("chmod +x", sourceFile.
Path
);
487
var permissions = ExecuteCommand("ls -l", sourceFile.
Path
).Substring(0, 10);
WriteCodeFragment_Tests.cs (2)
159
string fileName = Path.GetFileName(file.
Path
);
166
Assert.True(File.Exists(file.
Path
));
WriteLinesToFile_Tests.cs (14)
176
string file = testEnv.ExpectFile().
Path
;
349
File.Exists(file.
Path
).ShouldBeTrue();
350
File.ReadAllText(file.
Path
).ShouldNotBeEmpty();
357
File = new TaskItem(file.
Path
),
361
File.Exists(file.
Path
).ShouldBeTrue();
362
File.ReadAllText(file.
Path
).ShouldBeEmpty();
377
File.Exists(file.
Path
).ShouldBeFalse();
384
File = new TaskItem(file.
Path
),
388
File.Exists(file.
Path
).ShouldBeTrue();
389
File.ReadAllText(file.
Path
).ShouldBeEmpty();
411
var parallelProjectFile = testEnv.CreateFile("ParallelBuildProject.csproj", parallelProjectContent).
Path
;
471
var parallelProjectFile = testEnv.CreateFile("ParallelBuildProject.csproj", parallelProjectContent).
Path
;
540
var outputFile = testEnv.CreateFile("output.txt").
Path
;
552
var parallelProjectFile = testEnv.CreateFile("ParallelBuildProject.csproj", parallelProjectContent).
Path
;
ZipDirectory_Tests.cs (4)
111
DestinationFile = new TaskItem(file.
Path
),
120
_mockEngine.Log.ShouldContain(file.
Path
, customMessage: _mockEngine.Log);
122
using (FileStream stream = new FileStream(file.
Path
, FileMode.Open, FileAccess.Read, FileShare.Read))
150
DestinationFile = new TaskItem(file.
Path
),
Microsoft.Build.UnitTests.Shared (7)
ObjectModelHelpers.cs (2)
1782
nodes[parent] = (IsRoot(parent), file.
Path
);
1804
nodes[reference] = (false, file.
Path
);
TestEnvironment.cs (5)
751
File.WriteAllText(
Path
, contents ?? string.Empty);
762
Assert.True(FileSystems.Default.FileExists(
Path
), $"A file expected as an output does not exist: {
Path
}");
767
FileUtilities.DeleteNoThrow(
Path
);
773
File.Delete(
Path
);
Microsoft.Build.Utilities.UnitTests (4)
ToolTask_Tests.cs (4)
925
OutputPath = output.
Path
,
930
File.Exists(output.
Path
).ShouldBeTrue();
934
File.ReadAllText(output.
Path
).ShouldContain("łoł");
938
File.ReadAllText(output.
Path
).ShouldContain("lol");