3 writes to Path
Microsoft.Build.UnitTests.Shared (3)
TestEnvironment.cs (3)
729
Path
= FileUtilities.GetTemporaryFile(null, null, extension, createFile);
735
Path
= FileUtilities.GetTemporaryFile(rootPath, null, extension, createFile);
740
Path
= System.IO.Path.Combine(rootPath, fileName);
545 references to Path
Microsoft.Build.BuildCheck.UnitTests (21)
EndToEndTests.cs (21)
54
string output = RunnerUtilities.ExecBootstrapedMSBuild($"{projectFile.
Path
} -check", out bool success, timeoutMilliseconds: timeoutInMilliseconds);
343
string output = RunnerUtilities.ExecBootstrapedMSBuild($"{projectFile.
Path
} -check", out bool success, timeoutMilliseconds: timeoutInMilliseconds);
502
string output = RunnerUtilities.ExecBootstrapedMSBuild($"{projectFile.
Path
}", out bool success, timeoutMilliseconds: timeoutInMilliseconds);
511
output = RunnerUtilities.ExecBootstrapedMSBuild($"{projectFile.
Path
} -check", out success, timeoutMilliseconds: timeoutInMilliseconds);
527
File.AppendAllText(editorconfigFile.
Path
, editorConfigChange);
530
output = RunnerUtilities.ExecBootstrapedMSBuild($"{projectFile.
Path
} -check", out success, timeoutMilliseconds: timeoutInMilliseconds);
540
output = RunnerUtilities.ExecBootstrapedMSBuild($"{projectFile.
Path
}", out success, timeoutMilliseconds: timeoutInMilliseconds);
559
$"{Path.GetFileName(projectFile.
Path
)} /m:1 -nr:False -restore" +
594
var projectDirectory = Path.GetDirectoryName(projectFile.
Path
);
595
string logFile = _env.ExpectFile(".binlog").
Path
;
598
$"{Path.GetFileName(projectFile.
Path
)} /m:1 -nr:False -restore {(checkRequested ? "-check" : string.Empty)} -bl:{logFile}",
649
$"{Path.GetFileName(projectFile.
Path
)} /m:1 -nr:False -restore -check",
708
string? projectDirectory = Path.GetDirectoryName(projectFile.
Path
);
709
string logFile = _env.ExpectFile(".binlog").
Path
;
712
$"{Path.GetFileName(projectFile.
Path
)} /m:1 -nr:False -restore -bl:{logFile}",
763
$"{Path.GetFileName(projectFile.
Path
)} /m:1 -nr:False -restore -check", out bool success, false, _env.Output, timeoutMilliseconds: timeoutInMilliseconds);
799
$"{Path.GetFileName(projectFile.
Path
)} /m:1 -nr:False -restore -check", out bool success, false, _env.Output, timeoutMilliseconds: timeoutInMilliseconds);
823
$"{Path.GetFileName(projectFile.
Path
)} /m:1 -nr:False -restore -check" +
946
$"{Path.GetFileName(projectFile.
Path
)} /m:1 -nr:False -t:restore -check",
1077
_env.SetCurrentDirectory(Path.GetDirectoryName(projectFile.
Path
));
1088
.Replace("TestFilePath", testFile.
Path
)
Microsoft.Build.CommandLine.UnitTests (61)
MSBuildMultithreaded_Tests.cs (1)
145
$"\"{projectFile.
Path
}\" {msbuildArgs}",
MSBuildServer_Tests.cs (25)
96
string output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
, out bool success, false, _output);
102
output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
, out success, false, _output);
111
string? dir = Path.GetDirectoryName(markerFile.
Path
);
115
_output.WriteLine($"The marker file {markerFile.
Path
} was created. The build task has been started. Ready to kill the server.");
120
watcher.Filter = Path.GetFileName(markerFile.
Path
);
124
TransientTestFile sleepProject = _env.CreateFile("napProject.proj", string.Format(sleepingTaskContentsFormat, markerFile.
Path
));
125
RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, sleepProject.
Path
, out _);
128
output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
, out success, false, _output);
146
string output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
, out bool success, false, _output);
155
output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
, out success, false, _output);
162
output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
, out success, false, _output);
183
TransientTestFile sleepProject = _env.CreateFile("napProject.proj", string.Format(sleepingTaskContentsFormat, markerFile.
Path
));
188
string output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
, out bool success, false, _output);
192
string? dir = Path.GetDirectoryName(markerFile.
Path
);
200
_output.WriteLine($"The marker file {markerFile.
Path
} was created. The build task has been started.");
203
watcher.Filter = Path.GetFileName(markerFile.
Path
);
207
RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, sleepProject.
Path
, out _, false, _output);
217
output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
, out success, false, _output);
223
output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
, out success, false, _output);
246
string output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
, out bool success, false, _output);
283
string output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
+ " /nodereuse:false", out bool success, false, _output);
296
string output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, project.
Path
+ " -interactive", out bool success, false, _output);
334
string output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, $"/t:DisplayMessages {project.
Path
}", out bool success, false, _output);
341
_env.SetCurrentDirectory(Path.GetDirectoryName(project.
Path
));
342
output = RunnerUtilities.ExecMSBuild(BuildEnvironmentHelper.Instance.CurrentMSBuildExePath, $"/t:DisplayMessages {project.
Path
}", out success, false, _output);
XMake_BinlogSwitch_Tests.cs (11)
42
var projectPath = directory.CreateFile("my.proj", content).
Path
;
61
var projectPath = directory.CreateFile("my.proj", content).
Path
;
82
var projectPath = directory.CreateFile("my.proj", content).
Path
;
108
var projectPath = directory.CreateFile("my.proj", content).
Path
;
135
var projectPath = directory.CreateFile("my.proj", content).
Path
;
159
var projectPath = directory.CreateFile("my.proj", content).
Path
;
179
var projectPath = directory.CreateFile("my.proj", content).
Path
;
198
var projectPath = directory.CreateFile("my.proj", content).
Path
;
218
var projectPath = directory.CreateFile("my.proj", content).
Path
;
234
var projectPath = directory.CreateFile("my.proj", content).
Path
;
284
var projectPath = directory.CreateFile("my.proj", content).
Path
;
XMake_Tests.cs (24)
781
string result = RunnerUtilities.ExecMSBuild($" {project.
Path
} -getProperty:Foo", out bool success);
848
string results = RunnerUtilities.ExecMSBuild($" {project.
Path
} {extraSwitch} {graph}", out bool success);
876
string results = RunnerUtilities.ExecMSBuild($" {project.
Path
} /p:someProperty:fdalse= ", out bool success);
902
string resultFile = env.GetTempFile(".tmp").
Path
;
903
string results = RunnerUtilities.ExecMSBuild($" {project.
Path
} {extraSwitch} -getResultOutputFile:{resultFile}", out bool success);
908
result = RunnerUtilities.ExecMSBuild($" {project.
Path
} {extraSwitch} -getResultOutputFile:", out success);
938
string results = RunnerUtilities.ExecMSBuild($" {project.
Path
} /t:GetCompileCommands {extraSwitch}", out bool success);
967
string result = RunnerUtilities.ExecMSBuild($" {project.
Path
} /restore {graph}", out bool success);
1395
var projectPath = directory.CreateFile("my.proj", content).
Path
;
1412
var projectPath = directory.CreateFile("my.proj", content).
Path
;
1433
var projectPath = directory.CreateFile("my.proj", content).
Path
;
1530
var projectPath = directory.CreateFile("my.proj", content).
Path
;
1549
var projectPath = directory.CreateFile("my.proj", content).
Path
;
1586
var projectPath = directory.CreateFile("my.proj", content).
Path
;
1608
var projectPath = directory.CreateFile("my.proj", content).
Path
;
2612
var parametersLoggerOptional = $"{logger} -verbosity:diagnostic \"{projectFile.
Path
}\"";
2629
var parametersLogger = $"{logger} -verbosity:diagnostic \"{projectFile.
Path
}\"";
2650
var parametersLogger = $"{loggerParam} -verbosity:diagnostic \"{projectFile.
Path
}\"";
2757
string output = RunnerUtilities.ExecMSBuild($"\"{testProject.
Path
}\" \"/bl:{binLogLocation}/output.binlog\"", out var success, _output);
2783
string output = RunnerUtilities.ExecMSBuild($"\"{testProject.
Path
}\" \"/bl:{binLog1}\" \"/bl:{binLog2}\" \"/bl:{binLog3}\"", out var success, _output);
2822
string output = RunnerUtilities.ExecMSBuild($"\"{testProject.
Path
}\" \"/bl:{binLog1}\" \"/bl:{binLog2}\" \"/bl:{binLog1}\"", out var success, _output);
2862
string output = RunnerUtilities.ExecMSBuild($"\"{testProject.
Path
}\" \"/bl:{binLog1}\" \"/bl:{binLog2};ProjectImports=None\"", out var success, _output);
2941
string output = RunnerUtilities.ExecMSBuild($"\"{testSolution.
Path
}\" /p:Configuration=Debug", out var success, _output);
3250
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)
3892
ProjectRootElement pre = ProjectRootElement.Create(env.CreateFile(".proj").
Path
);
3935
ProjectRootElement pre = ProjectRootElement.Create(env.CreateFile(".proj").
Path
);
3978
File.WriteAllText(importFile.
Path
, contents);
3979
ProjectRootElement pre = ProjectRootElement.Create(env.CreateFile(".proj").
Path
);
3982
var import = pre.AddImport(importFile.
Path
);
4001
eventArgs.ImportedProjectFile.ShouldBe(importFile.
Path
);
4025
File.WriteAllText(importFile.
Path
, contents);
4026
ProjectRootElement pre = ProjectRootElement.Create(env.CreateFile(".proj").
Path
);
4029
var import = pre.AddImport(importFile.
Path
);
4048
eventArgs.ImportedProjectFile.ShouldBe(importFile.
Path
);
4067
ProjectRootElement pre = ProjectRootElement.Create(env.CreateFile(".proj").
Path
);
4107
ProjectRootElement pre = ProjectRootElement.Create(env.CreateFile(".proj").
Path
);
4150
ProjectRootElement pre = ProjectRootElement.Create(env.CreateFile(".proj").
Path
);
4195
ProjectRootElement pre1 = ProjectRootElement.Create(env.CreateFile(".proj").
Path
);
4196
ProjectRootElement pre2 = ProjectRootElement.Create(env.CreateFile(".proj").
Path
);
NugetRestoreTests.cs (1)
62
RunnerUtilities.RunProcessAndGetOutput(Path.Combine(currentAssemblyDir, "nuget", "NuGet.exe"), "restore " + sln.
Path
+ " -MSBuildPath \"" + bootstrapMsBuildBinaryDir + "\"", out bool success, outputHelper: _output);
Microsoft.Build.Engine.UnitTests (294)
BackEnd\BuildManager_Tests.cs (55)
741
string tempProject = _env.CreateFile(".proj").
Path
;
990
var result = buildManagerSession.BuildProjectFile(_env.CreateFile("build.proj", contents).
Path
);
1878
string projectFile = _env.CreateFile(projectFolder, ".proj").
Path
;
2009
string p2pProject = _env.CreateFile(".Project2.proj").
Path
;
2095
string importedProjectPath = _env.CreateFile(".proj").
Path
;
2096
string rootProjectPath = _env.CreateFile(".proj").
Path
;
2196
string fileName = _env.CreateFile(".proj").
Path
;
2264
string fileName = _env.CreateFile(".proj").
Path
;
2315
string fileName = _env.CreateFile(".proj").
Path
;
2383
var projA = _env.CreateFile(".proj").
Path
;
2384
var projB = _env.CreateFile(".proj").
Path
;
2432
var projA = _env.CreateFile(".proj").
Path
;
2433
var projB = _env.CreateFile(".proj").
Path
;
2498
var projA = _env.CreateFile(".proj").
Path
;
2499
var projB = _env.CreateFile(".proj").
Path
;
2548
var projA = _env.CreateFile(".proj").
Path
;
2549
var projB = _env.CreateFile(".proj").
Path
;
2600
var projA = _env.CreateFile(".proj").
Path
;
2601
var projB = _env.CreateFile(".proj").
Path
;
2602
var projC = _env.CreateFile(".proj").
Path
;
2603
var projD = _env.CreateFile(".proj").
Path
;
2695
var projA = _env.CreateFile(".proj").
Path
;
2696
var projB = _env.CreateFile(".proj").
Path
;
2697
var projC = _env.CreateFile(".proj").
Path
;
2774
var projA = _env.CreateFile(".proj").
Path
;
2775
var projB = _env.CreateFile(".proj").
Path
;
2776
var projC = _env.CreateFile(".proj").
Path
;
2889
var projA = _env.CreateFile(".proj").
Path
;
2890
var projB = _env.CreateFile(".proj").
Path
;
2891
var projC = _env.CreateFile(".proj").
Path
;
2975
var projA = _env.CreateFile(".proj").
Path
;
2976
var projB = _env.CreateFile(".proj").
Path
;
2977
var projC = _env.CreateFile(".proj").
Path
;
3044
var projA = _env.CreateFile(".proj").
Path
;
3045
var projB = _env.CreateFile(".proj").
Path
;
3119
var projectPath1 = _env.CreateFile(".proj").
Path
;
3124
var projectPath2 = _env.CreateFile(".proj").
Path
;
3187
var projectPath1 = _env.CreateFile(".proj").
Path
;
3202
var projectPath2 = _env.CreateFile(".proj").
Path
;
3272
string projectPath1 = _env.CreateFile(".proj").
Path
;
3287
var projectPath2 = _env.CreateFile(".proj").
Path
;
3370
string fileName = _env.CreateFile(".proj").
Path
;
3509
_env.SetEnvironmentVariable(Constants.DotnetHostPathEnvVarName, tempFile.
Path
);
3631
var projectFilePath = _env.CreateFile().
Path
;
3644
project.FullPath = _env.CreateFile().
Path
;
4071
var entryFile = env.CreateFile(nameof(a), a).
Path
;
4227
string project1 = _env.CreateFile(".proj").
Path
;
4228
string project2 = _env.CreateFile(".proj").
Path
;
4268
string project1 = _env.CreateFile(".proj").
Path
;
4269
string project2 = _env.CreateFile(".proj").
Path
;
4270
string project3 = _env.CreateFile(".proj").
Path
;
4310
string project1 = _env.CreateFile(".proj").
Path
;
4311
string project2 = _env.CreateFile(".proj").
Path
;
4353
string project1 = _env.CreateFile(".proj").
Path
;
4354
string project2 = _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)
795
ObjectModelHelpers.BuildTempProjectFileExpectSuccess(projectFile.
Path
, logger);
827
ObjectModelHelpers.BuildTempProjectFileExpectSuccess(projectFile.
Path
, logger);
874
ObjectModelHelpers.BuildTempProjectFileExpectSuccess(projectFile.
Path
, logger);
BackEnd\SdkResolverLoader_Tests.cs (4)
224
var assemblyToLoad = env.CreateFile(".dll").
Path
;
249
var assemblyToLoad = env.CreateFile(".dll").
Path
;
276
var assemblyToLoad = env.CreateFile(".dll").
Path
;
317
var assemblyToLoad = env.GetTempFile(".dll").
Path
;
BackEnd\TaskBuilder_Tests.cs (2)
90
string results = RunnerUtilities.ExecMSBuild(projectFile.
Path
+ " /v:diag", out bool success);
157
project.FullPath = env.CreateFile().
Path
;
BackEnd\TaskHostFactory_Tests.cs (3)
72
ProjectInstance projectInstance = new(project.
Path
);
177
ProjectInstance projectInstance = new(project.
Path
);
389
ProjectInstance projectInstance = new(project.
Path
);
BinaryLogger_Tests.cs (11)
86
_logFile = _env.ExpectFile(".binlog").
Path
;
133
fileToReplay = _env.ExpectFile(".binlog").
Path
;
214
string replayedLogFile = _env.ExpectFile(".binlog").
Path
;
342
RunnerUtilities.ExecMSBuild($"{projectFile.
Path
} -bl:{_logFile}", out bool success);
402
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);
467
string emptyFile = testFolder.CreateFile(emptyFileName).
Path
;
470
Assert.True(NativeMethodsShared.MakeSymbolicLink(symlinkPath, testFile.
Path
, ref errorMessage), errorMessage);
612
string consoleOutput1 = RunnerUtilities.ExecMSBuild($"{projectFile1.
Path
} -bl:{_logFile} -verbosity:diag -nologo", out bool success1);
614
var expected1 = $"-bl:{_logFile} -nologo -verbosity:diag {projectFile1.
Path
}";
620
string consoleOutput2 = RunnerUtilities.ExecMSBuild($"{projectFile2.
Path
} -bl:{_logFile} -verbosity:{verbosity} -nologo", out bool success2);
622
var expected2 = $"-bl:{_logFile} -nologo -verbosity:{verbosity} {projectFile2.
Path
}";
ChangeWaves_Tests.cs (1)
64
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)
138
string solutionPath = convertToSlnx ? ConvertToSlnx(sln.
Path
) : sln.
Path
;
Construction\SolutionFile_OldParser_Tests.cs (2)
312
string rptprojPath = env.CreateFile(".rptproj").
Path
;
314
string dqprojPath = env.CreateFile(".dwproj").
Path
;
Construction\SolutionFilter_Tests.cs (23)
125
Directory.GetCurrentDirectory().ShouldNotBe(Path.GetDirectoryName(filterFile.
Path
));
131
ProjectGraphEntryPoint entryPoint = new(filterFile.
Path
, new Dictionary<string, string>());
137
graphFromSolution.ProjectNodes.Single().ProjectInstance.ProjectFileLocation.LocationString.ShouldBe(simpleProject.
Path
);
141
SolutionFile solution = SolutionFile.Parse(filterFile.
Path
);
215
TransientTestFile slnf = testEnvironment.CreateFile(folder, "Dev.slnf", slnfValue.Replace(@"C:\\notAPath\\MSBuild.Dev.sln", sln.
Path
.Replace("\\", "\\\\")));
216
InvalidProjectFileException e = Should.Throw<InvalidProjectFileException>(() => SolutionFile.Parse(slnf.
Path
));
244
Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""Microsoft.Build"", """ + Path.Combine("src", Path.GetFileName(microsoftBuild.
Path
)) + @""", ""{69BE05E2-CBDA-4D27-9733-44E12B0F5627}""
246
Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""MSBuild"", """ + Path.Combine("src", Path.GetFileName(msbuild.
Path
)) + @""", ""{6F92CA55-1D15-4F34-B1FE-56C0B7EB455E}""
248
Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""Microsoft.Build.CommandLine.UnitTests"", """ + Path.Combine("src", Path.GetFileName(commandLineUnitTests.
Path
)) + @""", ""{0ADDBC02-0076-4159-B351-2BF33FAA46B2}""
250
Project(""{9A19103F-16F7-4668-BE54-9A1E7A4F7556}"") = ""Microsoft.Build.Tasks.UnitTests"", """ + Path.Combine("src", Path.GetFileName(tasksUnitTests.
Path
)) + @""", ""{CF999BDE-02B3-431B-95E6-E88D621D9CBF}""
268
""path"": """ + (convertToSlnx ? ConvertToSlnx(sln.
Path
) : sln.
Path
).Replace("\\", "\\\\") + @""",
270
""" + Path.Combine("src", Path.GetFileName(microsoftBuild.
Path
)!).Replace("\\", "\\\\") + @""",
271
""" + Path.Combine("src", Path.GetFileName(tasksUnitTests.
Path
)!).Replace("\\", "\\\\") + @"""
275
SolutionFile sp = SolutionFile.Parse(slnf.
Path
);
276
sp.ProjectShouldBuild(Path.Combine("src", Path.GetFileName(microsoftBuild.
Path
)!)).ShouldBeTrue();
277
sp.ProjectShouldBuild(Path.Combine("src", Path.GetFileName(tasksUnitTests.
Path
)!)).ShouldBeTrue();
280
(sp.ProjectShouldBuild(Path.Combine("src", Path.GetFileName(commandLineUnitTests.
Path
)!))
281
|| sp.ProjectShouldBuild(Path.Combine("src", Path.GetFileName(msbuild.
Path
)!))
331
SolutionFile sp = SolutionFile.Parse(slnf.
Path
);
422
string slnPath = (convertToSlnx ? ConvertToSlnx(sln.
Path
) : sln.
Path
).Replace("\\", "\\\\");
435
SolutionFile solution = SolutionFile.Parse(slnf.
Path
);
Construction\SolutionProjectGenerator_Tests.cs (11)
78
ProjectInstance[] instances = SolutionProjectGenerator.Generate(SolutionFile.Parse(sln.
Path
), null, null, _buildEventContext, CreateMockLoggingService());
101
string solutionPath = convertToSlnx ? SolutionFile_NewParser_Tests.ConvertToSlnx(sln.
Path
) : sln.
Path
;
153
RunnerUtilities.ExecMSBuild(solutionFile.
Path
+ " /t:classlib", out bool success);
222
string output = RunnerUtilities.ExecMSBuild(solutionFile.
Path
+ " /t:Clean;Build;Custom", out bool success);
300
var output = RunnerUtilities.ExecMSBuild(solutionFile.
Path
+ " /m /t:Clean;Build;Custom", out bool success);
935
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "A", "{{proj1.
Path
}}", "{786E302A-96CE-43DC-B640-D6B6CC9BF6C0}"
937
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "B", "{{proj2.
Path
}}", "{881C1674-4ECA-451D-85B6-D7C59B7F16FA}"
942
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "C", "{{proj3.
Path
}}", "{4A727FF8-65F2-401E-95AD-7C8BBFBE3167}"
945
RunnerUtilities.ExecMSBuild("\"" + proj.
Path
+ "\"", out bool successfulExit);
2986
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)
4903
ProjectInstance projectInstance = new ProjectInstance(projectFile.
Path
);
4947
ProjectInstance projectInstance = new ProjectInstance(projectFile.
Path
);
4976
ProjectInstance projectInstance = new ProjectInstance(projectFile.
Path
);
5023
ProjectInstance projectInstance = new ProjectInstance(projectFile.
Path
);
5064
ProjectInstance projectInstance = new ProjectInstance(projectFile.
Path
);
5098
ProjectInstance projectInstance = new ProjectInstance(projectFile.
Path
);
5144
new ProjectInstance(projectFile.
Path
);
5185
new ProjectInstance(projectFile.
Path
);
5217
new ProjectInstance(projectFile.
Path
);
5283
.ExpandIntoStringLeaveEscaped($"$([MSBuild]::RegisterBuildCheck({dummyAssemblyFile.
Path
}))", ExpanderOptions.ExpandProperties, MockElementLocation.Instance);
EvaluationProfiler_Tests.cs (1)
305
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)
40
files[i] = _env.CreateFile(files[i], string.Empty).
Path
;
68
var solutionFile = _env.CreateFile("solutionReference.sln", string.Empty).
Path
;
82
var aggException = Should.Throw<AggregateException>(() => new ProjectGraph(root.
Path
));
230
{"1", _env.CreateFile("1.csproj", string.Empty).
Path
}
251
var solutionFile = _env.CreateFile("solution.sln", solutionContents).
Path
;
500
var solutionFile = _env.CreateFile("solution.sln", solutionContents).
Path
;
595
var graph = new ProjectGraph(_env.CreateFile("solution.sln", solutionContents).
Path
);
611
{"1", GraphTestingUtilities.CreateProjectFile(_env, 1, new[] {2}).
Path
},
612
{"2", GraphTestingUtilities.CreateProjectFile(_env, 2, extraContent: MultitargetingSpecificationPropertyGroup).
Path
},
613
{"3", GraphTestingUtilities.CreateProjectFile(_env, 3, new[] {4}, extraContent: MultitargetingSpecificationPropertyGroup).
Path
},
614
{"4", GraphTestingUtilities.CreateProjectFile(_env, 4).
Path
}
619
var graph = new ProjectGraph(_env.CreateFile("solution.sln", solutionContents).
Path
);
672
var solutionPath = _env.CreateFile("TheSolution.sln", solutionContents).
Path
;
Graph\IsolateProjects_Tests.cs (8)
287
defaultTargets: "UndeclaredReferenceTarget").
Path
;
302
defaultTargets: "DeclaredReferenceTarget").
Path
;
320
defaultTargets: "BuildDeclaredReference").
Path
;
515
var rootProjectFile = CreateTmpFile(_env).
Path
;
516
var declaredReferenceFile = CreateTmpFile(_env).
Path
;
517
var undeclaredReferenceFile = CreateTmpFile(_env).
Path
;
579
".Cleanup()).
Path
;
596
".Cleanup()).
Path
;
Graph\ProjectGraph_Tests.cs (78)
66
var projectGraph = new ProjectGraph(entryProject.
Path
);
68
projectGraph.ProjectNodes.First().ProjectInstance.FullPath.ShouldBe(entryProject.
Path
);
94
Should.Throw<CircularDependencyException>(() => new ProjectGraph(entryProject.
Path
));
107
entryProject.
Path
,
119
projectGraph.ProjectNodes.First().ProjectInstance.FullPath.ShouldBe(entryProject.
Path
);
209
entryProject.
Path
,
231
ProjectGraph graph = new ProjectGraph(entryProject.
Path
);
260
ProjectGraph graph = new ProjectGraph(entryProject.
Path
);
309
var projectsInCycle = new List<string> { entryProject.
Path
, proj3.
Path
, proj2.
Path
, entryProject.
Path
};
311
Should.Throw<CircularDependencyException>(() => new ProjectGraph(entryProject.
Path
)).Message.ShouldContain(expectedErrorMessage);
323
Should.Throw<CircularDependencyException>(() => new ProjectGraph(entryProject.
Path
));
343
var projectsInCycle = new List<string> { proj2.
Path
, proj3.
Path
, proj7.
Path
, proj6.
Path
, proj2.
Path
};
345
Should.Throw<CircularDependencyException>(() => new ProjectGraph(entryProject.
Path
)).Message.ShouldContain(errorMessage);
358
var entryPoint1 = new ProjectGraphEntryPoint(entryFile1.
Path
, new Dictionary<string, string> { ["B"] = "EntryPointB", ["C"] = "EntryPointC" });
359
var entryPoint2 = new ProjectGraphEntryPoint(entryFile2.
Path
, null);
404
ProjectGraph graph = new ProjectGraph(entryProject.
Path
);
431
ProjectGraph graph = new ProjectGraph(entryProject.
Path
);
462
ProjectGraph graph = new ProjectGraph(entryProject.
Path
);
497
entryProject.
Path
,
533
ProjectGraph graph = new ProjectGraph(entryProject.
Path
);
564
var aggException = Should.Throw<AggregateException>(() => new ProjectGraph(entryProject.
Path
));
579
var projectGraph = new ProjectGraph(new[] { entryProject1.
Path
, entryProject2.
Path
});
599
var entryPoint1 = new ProjectGraphEntryPoint(entryProject.
Path
, new Dictionary<string, string> { { "Platform", "x86" } });
600
var entryPoint2 = new ProjectGraphEntryPoint(entryProject.
Path
, new Dictionary<string, string> { { "Platform", "x64" } });
638
var entryPoint1 = new ProjectGraphEntryPoint(entryProject.
Path
, new Dictionary<string, string> { { "Platform", "x86" } });
639
var entryPoint2 = new ProjectGraphEntryPoint(entryProject.
Path
, new Dictionary<string, string> { { "Platform", "x64" } });
674
var projectGraph = new ProjectGraph(new[] { entryProject1.
Path
, entryProject2.
Path
, entryProject3.
Path
});
819
SolutionFile solutionFile = SolutionFile.Parse(slnFile.
Path
);
862
var projectGraph = new ProjectGraph(slnFile.
Path
);
925
var projectGraph = new ProjectGraph(entryProject.
Path
);
953
var projectGraph = new ProjectGraph(entryProject.
Path
);
984
var projectGraph = new ProjectGraph(entryProject.
Path
);
1006
var projectGraph = new ProjectGraph(entryProject.
Path
);
1024
var projectGraph = new ProjectGraph(entryProject.
Path
);
1047
var projectGraph = new ProjectGraph(entryProject.
Path
);
1070
var projectGraph = new ProjectGraph(entryProject.
Path
);
1087
var projectGraph = new ProjectGraph(entryProject.
Path
);
1107
.
Path
;
1141
.
Path
;
1176
extraContent: ProjectReferenceTargetsWithMultitargeting).
Path
;
1231
.
Path
;
1300
.
Path
;
1314
.
Path
;
1395
var projectGraph = new ProjectGraph(entryProject.
Path
);
1418
var projectGraph = new ProjectGraph(entryProject.
Path
);
1448
var projectGraph = new ProjectGraph(entryProject.
Path
);
1505
var projectGraph = new ProjectGraph(entryProjectFile: entryProject.
Path
);
1633
var graph = new ProjectGraph(new HashSet<string> { entryProject1.
Path
, entryProject2.
Path
});
1902
projectReferences: new[] { 2 }).
Path
;
1936
.
Path
;
1976
var root = CreateProjectFile(_env, 1, new[] { 2 }, null, null, multitargetingSpecification).
Path
;
1995
var root = CreateProjectFile(env: _env, projectNumber: 1, projectReferences: new[] { 2 }, projectReferenceTargets: null, defaultTargets: null, extraContent: MultitargetingSpecificationPropertyGroup).
Path
;
2022
extraContent: innerBuildViaLocalProperty).
Path
;
2042
var root = CreateProjectFile(env: _env, projectNumber: 1, projectReferences: new[] { 2 }, projectReferenceTargets: null, defaultTargets: null, extraContent: MultitargetingSpecificationPropertyGroup).
Path
;
2061
var root = CreateProjectFile(env: _env, projectNumber: 1, projectReferences: new[] { 2, 3 }, projectReferenceTargets: null, defaultTargets: null, extraContent: MultitargetingSpecificationPropertyGroup).
Path
;
2087
var root = CreateProjectFile(env: _env, projectNumber: 1, projectReferences: new[] { 2, 3 }, projectReferenceTargets: null, defaultTargets: null, extraContent: extraInnerBuildReferenceSpec).
Path
;
2130
CreateProjectFile(env: _env, projectNumber: 1, projectReferences: null, projectReferenceTargets: null, defaultTargets: null, extraContent: MultitargetingSpecificationPropertyGroup).
Path
,
2131
CreateProjectFile(env: _env, projectNumber: 2, projectReferences: null, projectReferenceTargets: null, defaultTargets: null, extraContent: referenceToInnerBuild).
Path
2161
var root = CreateProjectFile(env: _env, projectNumber: 1, projectReferences: null, projectReferenceTargets: null, defaultTargets: null, extraContent: referenceToInnerBuild).
Path
;
2201
.
Path
;
2847
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Project1", "{{project1File.
Path
}}", "{8761499A-7280-43C4-A32F-7F41C47CA6DF}"
2849
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Project2", "{{project2File.
Path
}}", "{2022C11A-1405-4983-BEC2-3A8B0233108F}"
2872
SolutionFile solutionFile = SolutionFile.Parse(slnFile.
Path
);
2874
ProjectGraph projectGraph = new(slnFile.
Path
);
2898
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Project1", "{{project1File.
Path
}}", "{8761499A-7280-43C4-A32F-7F41C47CA6DF}"
2917
SolutionFile solutionFile = SolutionFile.Parse(slnFile.
Path
);
2919
ProjectGraph projectGraph = new(slnFile.
Path
);
Graph\ResultCacheBasedBuilds_Tests.cs (8)
54
var project = CreateProjectFileWithBuildTargetAndItems(_env, 1).
Path
;
59
.ToArray())).
Path
;
81
var project = CreateProjectFileWithBuildTargetAndItems(_env, 1).
Path
;
126
var projectFile = CreateProjectFileWithBuildTargetAndItems(_env, 1, null, defaultTargets, explicitTargets).
Path
;
128
var outputCache = _env.DefaultTestDirectory.CreateFile("referenceCache").
Path
;
461
outputCaches[node] = env.DefaultTestDirectory.CreateFile($"OutputCache-{ProjectNumber(node)}").
Path
;
555
var project = CreateProjectFileWithBuildTargetAndItems(_env, 1).
Path
;
556
var existingFile = _env.CreateFile("FileExists", string.Empty).
Path
;
Instance\ProjectInstance_Internal_Tests.cs (3)
764
var file = env.CreateFile().
Path
;
896
projectRootElement.Save(testEnvironment.CreateFile().
Path
);
924
projectRootElement.Save(testEnvironment.CreateFile().
Path
);
ProjectCache\ProjectCacheTests.cs (6)
913
BuildResult buildResult = buildSession.BuildProjectFile(project1.
Path
);
1149
var buildResult = buildSession.BuildProjectFile(project.
Path
);
1365
GraphBuildResult graphResult = buildSession.BuildGraph(new ProjectGraph(project.
Path
));
1598
.Select(i => _env.CreateFile($"project{i}.proj", project).
Path
)
1698
var projectPath = directory.CreateFile("app.csproj", content).
Path
;
1743
FileUtilities.DeleteNoThrow(file1.
Path
);
Telemetry\Telemetry_Tests.cs (1)
279
var projectFile = testEnv.CreateFile("test.proj", testProject).
Path
;
TerminalLogger_Tests.cs (9)
915
string logFileWithTL = env.ExpectFile(".binlog").
Path
;
916
string logFileWithoutTL = env.ExpectFile(".binlog").
Path
;
919
RunnerUtilities.ExecMSBuild($"{projectFile.
Path
} /bl:{logFileWithTL} -flp:logfile={Path.Combine(logFolder.Path, "logFileWithTL.log")};verbosity=diagnostic -tl:on", out bool success, outputHelper: _outputHelper);
923
RunnerUtilities.ExecMSBuild($"{projectFile.
Path
} /bl:{logFileWithoutTL} -flp:logfile={Path.Combine(logFolder.Path, "logFileWithoutTL.log")};verbosity=diagnostic", out success, outputHelper: _outputHelper);
1059
<MSBuild Projects='{project1.
Path
};{project2.
Path
};{project3.
Path
}' BuildInParallel='true' />
1064
string binlogPath = env.ExpectFile(".binlog").
Path
;
1067
RunnerUtilities.ExecMSBuild($"{solutionFile.
Path
} /m:4 /bl:{binlogPath}", out bool success, outputHelper: _outputHelper);
TerminalLoggerConfiguration_Tests.cs (1)
39
_cmd = $"{projectFile.
Path
} -target:Hello -logger:{typeof(MockLogger).FullName},{typeof(MockLogger).Assembly.Location};ReportTelemetry";
Utilities_Tests.cs (3)
85
MSBuildApp.Execute([ @"c:\bin\msbuild.exe", '"' + inputFile.
Path
+ '"', '"' + (NativeMethodsShared.IsUnixLike ? "-pp:" : "/pp:") + outputFile.
Path
+ '"']));
88
foreach (string line in File.ReadLines(outputFile.
Path
))
Microsoft.Build.Tasks.UnitTests (137)
AddToWin32Manifest_Tests.cs (1)
104
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)
151
SourceFiles = new ITaskItem[] { new TaskItem(sourceFile.
Path
) },
177
SourceFiles = new ITaskItem[] { new TaskItem(sourceFile.
Path
) },
278
SourceFiles = new ITaskItem[] { new TaskItem(sourceFile.
Path
) },
354
SourceFiles = new ITaskItem[] { new TaskItem(sourceFile.
Path
) },
379
SourceFiles = new ITaskItem[] { new TaskItem(sourceFile.
Path
) },
404
SourceFiles = new ITaskItem[] { new TaskItem(sourceFile.
Path
) },
428
SourceFiles = new ITaskItem[] { new TaskItem(sourceFile.
Path
) },
454
SourceFiles = new ITaskItem[] { new TaskItem(sourceFile.
Path
) },
481
SourceFiles = new ITaskItem[] { new TaskItem(sourceFile.
Path
) },
2581
var source = env.DefaultTestDirectory.CreateFile("source.txt", "This is a source file").
Path
;
2582
var existing = env.DefaultTestDirectory.CreateFile("destination.txt", "This is an existing file.").
Path
;
3012
ITaskItem[] sourceFiles = { new TaskItem(sourceFile1.
Path
) };
3032
sourceFiles = new TaskItem[] { new TaskItem(sourceFile2.
Path
) };
3051
File.ReadAllText(sourceFile1.
Path
).ShouldBe("This is the first source temp file.");
3055
Path.Combine(Path.GetDirectoryName(sourceFile2.
Path
), ".", Path.GetFileName(sourceFile2.
Path
))) // sourceFile2.Path with a "." inserted before the file name
3069
File.Exists(sourceFile2.
Path
).ShouldBeTrue();
CreateCSharpManifestResourceName_Tests.cs (9)
389
ITaskItem i = new TaskItem(resXFile.
Path
);
424
env.SetCurrentDirectory(Path.GetDirectoryName(resourceFile.
Path
));
492
ITaskItem i = new TaskItem(Path.GetFileName(resXFile.
Path
));
498
env.SetCurrentDirectory(Path.GetDirectoryName(resXFile.
Path
));
527
ITaskItem i = new TaskItem(resXFile.
Path
);
557
ITaskItem i = new TaskItem(Path.GetFileName(resXFile.
Path
));
563
env.SetCurrentDirectory(Path.GetDirectoryName(resXFile.
Path
));
591
ITaskItem i = new TaskItem(resXFile.
Path
);
599
env.SetCurrentDirectory(Path.GetDirectoryName(resXFile.
Path
));
Exec_Tests.cs (1)
1061
var textFilePath = env.CreateFile("leading-whitespace.txt", lineWithLeadingWhitespace).
Path
;
GenerateBindingRedirects_Tests.cs (4)
270
string outputAppConfigFile = env.ExpectFile(".config").
Path
;
282
string outputAppConfigFile = _env.ExpectFile(".config").
Path
;
320
string outputAppConfig = string.IsNullOrEmpty(targetAppConfigFile) ? _env.ExpectFile(".config").
Path
: targetAppConfigFile;
354
string appConfigFile = _env.CreateFile(transientTestFolder ?? new TransientTestFolder(), ".config").
Path
;
HintPathResolver_Tests.cs (3)
35
bool result = ResolveHintPath(tempFile.
Path
);
55
bool result = ResolveHintPath(Environment.NewLine + tempFile.
Path
+ Environment.NewLine);
64
bool result = ResolveHintPath(" " + tempFile.
Path
+ " ");
MSBuildInternalMessage_Tests.cs (5)
45
var projectFile = env.CreateFile(env.CreateFolder(), "test.csproj", projectContent).
Path
;
88
var projectFile = env.CreateFile(env.CreateFolder(), "test.csproj", projectContent).
Path
;
143
var projectFile = env.CreateFile(env.CreateFolder(), "test.csproj", projectContent).
Path
;
218
var projectFile = env.CreateFile(env.CreateFolder(), fileName, projectContent).
Path
;
263
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)
323
string resxFileInput = Utilities.WriteTestResX(false, null, null, _env.CreateFile(folder, ".resx").
Path
);
326
t.StateFile = new TaskItem(_env.GetTempFile(".cache").
Path
);
369
string resxFileInput = Utilities.WriteTestResX(false, null, null, _env.CreateFile(folder, ".resx").
Path
);
372
t.StateFile = new TaskItem(_env.GetTempFile(".cache").
Path
);
464
+ " <value>" + linkedTextFile.
Path
+ ";System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>\xd\xa"
467
string resxFile = Utilities.WriteTestResX(false, null, linkedTextData, _env.CreateFile(folder, ".resx").
Path
, includeDefaultString: false);
468
string stateFile = _env.GetTempFile(".cache").
Path
;
485
File.WriteAllText(linkedTextFile.
Path
, "updated content");
486
File.SetLastWriteTime(linkedTextFile.
Path
, DateTime.Now.AddDays(1));
502
string resxFileInput = Utilities.WriteTestResX(false, null, null, _env.CreateFile(folder, ".resx").
Path
);
503
TaskItem stateFile = new TaskItem(_env.GetTempFile(".cache").
Path
);
724
var firstResx = Utilities.WriteTestResX(false, null, null, _env.CreateFile(folder, ".resx").
Path
);
725
var secondResx = Utilities.WriteTestResX(false, null, null, _env.CreateFile(folder, ".resx").
Path
);
726
var cache = _env.GetTempFile(folder, ".cache").
Path
;
2299
gr.Sources = new ITaskItem[] { new TaskItem(resource.
Path
) };
2347
t.StateFile = new TaskItem(env.GetTempFile(".cache").
Path
);
2350
var resourcesFile = env.CreateFile(inputExtension).
Path
;
2353
t.OutputResources = new ITaskItem[] { new TaskItem(env.GetTempFile(".resources").
Path
) };
3946
string resxFile = env.CreateFile("test.resx").
Path
;
4208
File.SetLastWriteTime(dll.
Path
, DateTime.Now - TimeSpan.FromDays(30));
4210
var referenceItem = new TaskItem(dll.
Path
);
4413
resgenFile = env.CreateFile(".resx", contents).
Path
;
ResourceHandling\MSBuildResXReader_Tests.cs (3)
167
File.WriteAllText(linkedTextFile.
Path
,
308
File.WriteAllText(linkedTextFile.
Path
,
314
<value>{linkedTextFile.
Path
};{typeNameInResx}</value>
RoslynCodeTaskFactory_Tests.cs (14)
84
string output = RunnerUtilities.ExecMSBuild(inlineTask.
Path
, out bool success);
128
string output = RunnerUtilities.ExecMSBuild(assemblyProj.
Path
+ $" /p:OutDir={Path.Combine(folder.Path, "subFolder")} /restore", out bool success);
153
output = RunnerUtilities.ExecMSBuild(inlineTask.
Path
, out success);
346
<Code Type=""Class"" Language=""cs"" Source=""{taskFile.
Path
}"" />
356
string output = RunnerUtilities.ExecMSBuild(projectFile.
Path
+ " /v:d", out bool success);
428
TryLoadTaskBodyAndExpectSuccess($"<Code Source=\"{file.
Path
}\"/>", expectedCodeType: RoslynCodeTaskFactoryCodeType.Class);
432
TryLoadTaskBodyAndExpectSuccess($"<Code Source=\"{file.
Path
}\" Type=\"{codeType}\">code</Code>", expectedCodeType: codeType);
525
$"<Code Source=\"{file.
Path
}\" />",
542
$"<Code Source=\"{file.
Path
}\" Type=\"Fragment\"/>",
558
$"<Code Source=\"{file.
Path
}\" Type=\"Method\"/>",
734
$"<Code Source=\"{file.
Path
}\"/>",
1146
projectFile.
Path
+ " /t:Build /mt /v:detailed",
1256
string buildArgs = $"{solutionFile.
Path
} /m /mt";
1327
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;
190
new FileInfo(file1.
Path
).IsReadOnly = true;
223
SourceFiles = new ITaskItem[] { new TaskItem(file.
Path
), },
478
string output = RunnerUtilities.RunProcessAndGetOutput($"/bin/sh", $"-c \"{command} {sourceFile.
Path
}\"", out bool success);
481
ExecuteCommand("chmod +x", sourceFile.
Path
);
482
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)
177
string file = testEnv.ExpectFile().
Path
;
350
File.Exists(file.
Path
).ShouldBeTrue();
351
File.ReadAllText(file.
Path
).ShouldNotBeEmpty();
358
File = new TaskItem(file.
Path
),
362
File.Exists(file.
Path
).ShouldBeTrue();
363
File.ReadAllText(file.
Path
).ShouldBeEmpty();
378
File.Exists(file.
Path
).ShouldBeFalse();
385
File = new TaskItem(file.
Path
),
389
File.Exists(file.
Path
).ShouldBeTrue();
390
File.ReadAllText(file.
Path
).ShouldBeEmpty();
412
var parallelProjectFile = testEnv.CreateFile("ParallelBuildProject.csproj", parallelProjectContent).
Path
;
472
var parallelProjectFile = testEnv.CreateFile("ParallelBuildProject.csproj", parallelProjectContent).
Path
;
541
var outputFile = testEnv.CreateFile("output.txt").
Path
;
553
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)
1783
nodes[parent] = (IsRoot(parent), file.
Path
);
1805
nodes[reference] = (false, file.
Path
);
TestEnvironment.cs (5)
742
File.WriteAllText(
Path
, contents ?? string.Empty);
753
Assert.True(FileSystems.Default.FileExists(
Path
), $"A file expected as an output does not exist: {
Path
}");
758
FileUtilities.DeleteNoThrow(
Path
);
764
File.Delete(
Path
);
Microsoft.Build.Utilities.UnitTests (4)
ToolTask_Tests.cs (4)
923
OutputPath = output.
Path
,
928
File.Exists(output.
Path
).ShouldBeTrue();
932
File.ReadAllText(output.
Path
).ShouldContain("łoł");
936
File.ReadAllText(output.
Path
).ShouldContain("lol");