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