-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System.Collections.Generic; | ||
using System.Diagnostics; | ||
using System.Reflection; | ||
using JetBrains.Annotations; | ||
using JetBrains.Collections.Viewable; | ||
using JetBrains.ReSharper.Feature.Services.Protocol; | ||
using JetBrains.ReSharper.UnitTestFramework.Execution.TestRunner; | ||
using JetBrains.Rider.Model.Godot.FrontendBackend; | ||
using JetBrains.Util; | ||
|
||
namespace JetBrains.ReSharper.Plugins.Godot.UnitTesting | ||
{ | ||
public class GodotGdUnitTestRunnerHost : DefaultTestRunnerHost | ||
{ | ||
[NotNull] public new static readonly ITestRunnerHost Instance = new GodotGdUnitTestRunnerHost(); | ||
private const string godotPathEnvVarName = "GODOT_BIN"; | ||
|
||
public override IPreparedProcess StartProcess(ProcessStartInfo startInfo, ITestRunnerContext context) | ||
{ | ||
var solution = context.RuntimeEnvironment.Project.GetSolution(); | ||
var model = solution.GetProtocolSolution().GetGodotFrontendBackendModel(); | ||
if (model.GodotPath.HasValue()) | ||
startInfo.EnvironmentVariables.Add(godotPathEnvVarName, model.GodotPath.Value); | ||
|
||
return base.StartProcess(startInfo, context); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters