Skip to content

Commit d94f0ff

Browse files
committed
[utbot-rider]
fixes CLI arguments and process working dir
1 parent 28e6636 commit d94f0ff

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

utbot-rider/src/dotnet/UtBot/UtBot/ProcessWithRdServer.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class ProcessWithRdServer
2626
private Process _process;
2727
private ILogger _logger = Logger.GetLogger<ProcessWithRdServer>();
2828

29-
public ProcessWithRdServer(string name, int port, string exePath, IShellLocks shellLocks, Lifetime? parent = null)
29+
public ProcessWithRdServer(string name, string workingDir, int port, string exePath, IShellLocks shellLocks, Lifetime? parent = null)
3030
{
3131
using var blockingCollection = new BlockingCollection<String>(2);
3232
shellLocks.AssertNonMainThread();
@@ -41,7 +41,9 @@ public ProcessWithRdServer(string name, int port, string exePath, IShellLocks sh
4141
var wire = new SocketWire.Server(Lifetime, scheduler, socket);
4242
var serializers = new Serializers();
4343
var identities = new Identities(IdKind.Server);
44-
var startInfo = new ProcessStartInfo("dotnet", $"{exePath} {port}");
44+
var startInfo = new ProcessStartInfo("dotnet", $"\"{exePath}\" {port}");
45+
46+
startInfo.WorkingDirectory = workingDir;
4547
Protocol = new Protocol(name, serializers, identities, scheduler, wire, Lifetime);
4648
scheduler.Queue(() =>
4749
{

utbot-rider/src/dotnet/UtBot/UtBot/UnitTestBuilder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ private void Generate(IBackgroundProgressIndicator progressIndicator, IProject p
119119
_logger.Catch(() =>
120120
{
121121
var port = NetworkUtil.GetFreePort();
122-
var proc = new ProcessWithRdServer(VSharpMain.VSharpProcessName, port, vsharpRunner.FullPath,
122+
var proc = new ProcessWithRdServer(VSharpMain.VSharpProcessName, project.ProjectFileLocation.Parent.FullPath, port, vsharpRunner.FullPath,
123123
project.Locks,
124124
_lifetime);
125125
var projectCsprojPath = project.ProjectFileLocation.FullPath;

0 commit comments

Comments
 (0)