Skip to content

Commit 1cccc07

Browse files
authored
Rider: cli and pwd (#1747)
[utbot-rider] fixes CLI arguments and process working dir
1 parent 5eac028 commit 1cccc07

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
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: 2 additions & 2 deletions
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.FullPath, port, vsharpRunner.FullPath,
123123
project.Locks,
124124
_lifetime);
125125
var projectCsprojPath = project.ProjectFileLocation.FullPath;
@@ -192,4 +192,4 @@ private static string calculateTestProjectTarget(TargetFrameworkId tfm)
192192

193193
return "net6.0";
194194
}
195-
}
195+
}

0 commit comments

Comments
 (0)