diff --git a/IDE/src/IDEApp.bf b/IDE/src/IDEApp.bf index 6b3846e2..57204412 100644 --- a/IDE/src/IDEApp.bf +++ b/IDE/src/IDEApp.bf @@ -8880,7 +8880,13 @@ namespace IDE { targetType = .BeefTest; if (mTestManager != null) - mTestManager.AddProject(project); + { + String workingDirRel = scope String(); + ResolveConfigString(mPlatformName, workspaceOptions, project, options, "$(WorkingDir)", "debug working directory", workingDirRel); + var workingDir = scope String(); + Path.GetAbsolutePath(workingDirRel, project.mProjectDir, workingDir); + mTestManager.AddProject(project, workingDir); + } } else { diff --git a/IDE/src/TestManager.bf b/IDE/src/TestManager.bf index e3c4bdb2..a9541a64 100644 --- a/IDE/src/TestManager.bf +++ b/IDE/src/TestManager.bf @@ -16,6 +16,7 @@ namespace IDE public int32 mExecutedCount; public int32 mSkipCount; public int32 mFailedCount; + public String mWorkingDir ~ delete _; } public class TestEntry @@ -78,10 +79,11 @@ namespace IDE return true; } - public void AddProject(Project project) + public void AddProject(Project project, StringView workingDir) { var projectInfo = new ProjectInfo(); projectInfo.mProject = project; + projectInfo.mWorkingDir = new String(workingDir); mProjectInfos.Add(projectInfo); } @@ -141,7 +143,7 @@ namespace IDE startInfo.CreateNoWindow = !gApp.mTestEnableConsole; startInfo.SetFileName(curProjectInfo.mTestExePath); startInfo.SetArguments(testInstance.mArgs); - startInfo.SetWorkingDirectory(testInstance.mWorkingDir); + startInfo.SetWorkingDirectory(curProjectInfo.mWorkingDir); mTestInstance.mProcess = new SpawnedProcess(); if (testInstance.mProcess.Start(startInfo) case .Err) { @@ -591,7 +593,7 @@ namespace IDE //mTestInstance.mWorkingDir = new String(); //Path.GetDirectoryName(curProjectInfo.mTestExePath, mTestInstance.mWorkingDir); - mTestInstance.mWorkingDir = new String(gApp.mInstallDir); + mTestInstance.mWorkingDir = new String(curProjectInfo.mWorkingDir); mTestInstance.mPipeServer = new NamedPipe(); if (mTestInstance.mPipeServer.Create(".", mTestInstance.mPipeName, .AllowTimeouts) case .Err)