Skip to content

Commit 40eff34

Browse files
CopilotmarcpopMSFT
andcommitted
Fix test for ArtifactsPathIsAddedToSourceRoot
Co-authored-by: marcpopMSFT <[email protected]>
1 parent 8436c91 commit 40eff34

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

test/Microsoft.NET.Build.Tests/ArtifactsOutputPathTests.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -632,18 +632,23 @@ public void ArtifactsPathIsAddedToSourceRoot()
632632
</Project>
633633
""");
634634

635-
// Build with diagnostic output to capture SourceRoot items
635+
// Build the project
636636
var buildResult = new BuildCommand(testAsset)
637-
.ExecuteWithCapturedOutput("/p:_DumpSourceRoots=true");
637+
.Execute();
638638

639639
buildResult.Should().Pass();
640640

641641
// Verify that the SourceRoot was added by checking that the build succeeded
642-
// and that the ArtifactsPath was used
643-
var outputDirectory = Path.Combine(tempArtifactsPath, "bin", testProject.Name, "debug", ToolsetInfo.CurrentTargetFramework);
642+
// and that the ArtifactsPath was used. The output path should be under ArtifactsPath.
643+
var outputDirectory = Path.Combine(tempArtifactsPath, "bin", testProject.Name, "debug");
644644
new DirectoryInfo(outputDirectory)
645645
.Should()
646646
.Exist();
647+
648+
// Verify that the dll was created
649+
new FileInfo(Path.Combine(outputDirectory, testProject.Name + ".dll"))
650+
.Should()
651+
.Exist();
647652
}
648653
finally
649654
{

0 commit comments

Comments
 (0)