diff --git a/GoogleTestAdapter/Core/TestCases/TestCaseFactory.cs b/GoogleTestAdapter/Core/TestCases/TestCaseFactory.cs index 92f49cb43..6da8cb3ea 100644 --- a/GoogleTestAdapter/Core/TestCases/TestCaseFactory.cs +++ b/GoogleTestAdapter/Core/TestCases/TestCaseFactory.cs @@ -1,5 +1,7 @@ using System.Collections.Generic; +using System.IO; using System.Linq; +using System.Runtime.Remoting.Messaging; using System.Text.RegularExpressions; using GoogleTestAdapter.DiaResolver; using GoogleTestAdapter.Helpers; @@ -26,9 +28,24 @@ public TestCaseFactory(string executable, TestEnvironment testEnvironment, IDiaR public IList CreateTestCases() { var launcher = new ProcessLauncher(_testEnvironment, _testEnvironment.Options.PathExtension); - List consoleOutput = launcher.GetOutputOfCommand("", _executable, GoogleTestConstants.ListTestsOption.Trim(), false, false); - IList testCaseDescriptors = new ListTestsParser(_testEnvironment).ParseListTestsOutput(consoleOutput); + int processReturnCode; + List consoleOutput = launcher.GetOutputOfCommand("", _executable, GoogleTestConstants.ListTestsOption.Trim(), false, false, out processReturnCode); + if (processReturnCode != 0) + { + string messsage = + $"Could not list test cases of executable '{_executable}': executing process failed with return code {processReturnCode}"; + messsage += $"\nCommand executed: '{_executable} {GoogleTestConstants.ListTestsOption.Trim()}', working directory: '{Path.GetDirectoryName(_executable)}'"; + if (consoleOutput.Count(s => !string.IsNullOrEmpty(s)) > 0) + messsage += $"\nOutput of command:\n{string.Join("\n", consoleOutput)}"; + else + messsage += "\nCommand produced no output"; + + _testEnvironment.LogWarning(messsage); + return new List(); + } + + IList testCaseDescriptors = new ListTestsParser(_testEnvironment).ParseListTestsOutput(consoleOutput); if (_testEnvironment.Options.ParseSymbolInformation) { List testCaseLocations = GetTestCaseLocations(testCaseDescriptors, _testEnvironment.Options.PathExtension); diff --git a/GoogleTestAdapter/VsPackage/Resources/ReleaseNotes/0.8.0.md b/GoogleTestAdapter/VsPackage/Resources/ReleaseNotes/0.8.0.md new file mode 100644 index 000000000..a203e8863 --- /dev/null +++ b/GoogleTestAdapter/VsPackage/Resources/ReleaseNotes/0.8.0.md @@ -0,0 +1,4 @@ +* enhancement: settings are now printed to test output if GTA is running in debug mode ([#60](https://github.com/csoltenborn/GoogleTestAdapter/issues/60)) +* enhancement: cleaned up log output a bit ([#62](https://github.com/csoltenborn/GoogleTestAdapter/issues/62)) +* bugfix: if listing of tests failed, GTA produces a warning now, and no further efforts are taken to parse SourceFileLocations ([#63](https://github.com/csoltenborn/GoogleTestAdapter/issues/63), thanks to [Sergey Gomon](https://github.com/gomons) for example solution) +* bugfix: if a test crashed, but produced output immediately before the crash, that output would not end up in the test explorer ([#58](https://github.com/csoltenborn/GoogleTestAdapter/issues/58) \ No newline at end of file