Skip to content

Commit 0da34c5

Browse files
committed
fix project configuration and Path
1 parent f4c76be commit 0da34c5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

test/coverlet.MTP.validation.tests/CollectCoverageTests.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@ private TestProject CreateTestProject(
247247
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>
248248
<TestingPlatformDotnetTestSupport>true</TestingPlatformDotnetTestSupport>
249249
<OutputType>Exe</OutputType>
250+
<ManagePackageVersionsCentrally>false</ManagePackageVersionsCentrally>
251+
<UseArtifactsOutput>true</UseArtifactsOutput>
252+
<ArtifactsPath>$(MSBuildThisFileDirectory)</ArtifactsPath>
250253
</PropertyGroup>
251254
<ItemGroup>
252255
<PackageReference Include=""xunit.v3"" Version=""3.2.1"" />
@@ -466,7 +469,8 @@ private async Task<int> BuildProject(string projectPath)
466469
RedirectStandardOutput = true,
467470
RedirectStandardError = true,
468471
UseShellExecute = false,
469-
CreateNoWindow = true
472+
CreateNoWindow = true,
473+
WorkingDirectory = Path.GetDirectoryName(projectPath)
470474
};
471475

472476
using var process = Process.Start(processStartInfo);
@@ -490,7 +494,7 @@ private async Task<TestResult> RunTestsWithCoverage(string projectPath, string a
490494
// For MTP, we need to run the test executable directly, not through dotnet test
491495
string projectDir = Path.GetDirectoryName(projectPath)!;
492496
string projectName = Path.GetFileNameWithoutExtension(projectPath);
493-
string testExecutable = Path.Combine(projectDir, "bin", _buildConfiguration, _buildTargetFramework, $"{projectName}.dll");
497+
string testExecutable = Path.Combine(projectDir, "bin", projectName, _buildConfiguration.ToLower(), $"{projectName}.dll");
494498

495499
if (!File.Exists(testExecutable))
496500
{

0 commit comments

Comments
 (0)