Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion GoogleTestAdapter/Core/Settings/SettingsWrapper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,11 @@ public string GetBatchForTestTeardown(string solutionDirectory, string testDirec
=> ReplacePlaceholders(BatchForTestTeardown, solutionDirectory, testDirectory, threadId);

public string GetWorkingDir(string solutionDirectory, string testDirectory, int threadId)
=> ReplacePlaceholders(WorkingDir, solutionDirectory, testDirectory, threadId);
{
return string.IsNullOrWhiteSpace(WorkingDir)
? OptionWorkingDirDefaultValue
: ReplacePlaceholders(WorkingDir, solutionDirectory, testDirectory, threadId);
}


private string ReplacePlaceholders(string theString, string solutionDirectory, string testDirectory, int threadId)
Expand Down
6 changes: 4 additions & 2 deletions GoogleTestAdapter/Core/TestCases/TestCaseFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public IList<TestCase> CreateTestCases(Action<TestCase> reportTestCase = null)
{
var launcher = new ProcessLauncher(_logger, _settings.GetPathExtension(_executable), null);
int processExitCode;
standardOutput = launcher.GetOutputOfCommand("", null, _executable, GoogleTestConstants.ListTestsOption,
string workingDir = new FileInfo(_executable).DirectoryName;
standardOutput = launcher.GetOutputOfCommand(workingDir, null, _executable, GoogleTestConstants.ListTestsOption,
false, false, out processExitCode);

if (!CheckProcessExitCode(processExitCode, standardOutput))
Expand Down Expand Up @@ -129,6 +130,7 @@ private IList<TestCase> NewCreateTestcases(Action<TestCase> reportTestCase, List

try
{
string workingDir = new FileInfo(_executable).DirectoryName;
int processExitCode = ProcessExecutor.ExecutionFailed;
ProcessExecutor executor = null;
var listAndParseTestsTask = new Task(() =>
Expand All @@ -137,7 +139,7 @@ private IList<TestCase> NewCreateTestcases(Action<TestCase> reportTestCase, List
processExitCode = executor.ExecuteCommandBlocking(
_executable,
GoogleTestConstants.ListTestsOption,
"",
workingDir,
null,
_settings.GetPathExtension(_executable),
lineAction);
Expand Down