From f5b511cb9ce199f491b43ab54b53e60a5139bd3f Mon Sep 17 00:00:00 2001 From: Rashid Sarwar Date: Mon, 26 Jun 2017 10:24:28 -0700 Subject: [PATCH 1/7] Moving strings to resource .resx file --- .../Common.Dynamic.TAfGT.csproj | 11 + .../Resources.Designer.cs | 99 ++ .../Common.Dynamic.TAfGT/Resources.resx | 132 +++ .../Common.Dynamic.TAfGT/Strings.cs | 8 +- .../Core.Tests/GoogleTestDiscovererTests.cs | 2 +- GoogleTestAdapter/Core/Core.csproj | 10 + .../Core/GoogleTestDiscoverer.cs | 27 +- GoogleTestAdapter/Core/GoogleTestExecutor.cs | 10 +- .../Core/Helpers/ProcessExecutor.cs | 4 +- .../Core/Helpers/ProcessLauncher.cs | 11 +- .../Core/Helpers/RegexTraitParser.cs | 4 +- .../Core/Helpers/TestProcessLauncher.cs | 10 +- GoogleTestAdapter/Core/Helpers/Utils.cs | 4 +- GoogleTestAdapter/Core/Resources.Designer.cs | 855 ++++++++++++++++++ GoogleTestAdapter/Core/Resources.resx | 456 ++++++++++ .../Core/Runners/CommandLineGenerator.cs | 7 +- .../Core/Runners/ParallelTestRunner.cs | 15 +- .../Core/Runners/PreparingTestRunner.cs | 39 +- .../Core/Runners/SequentialTestRunner.cs | 31 +- .../Core/Runners/TestResultCollector.cs | 12 +- .../Core/Scheduling/SchedulingAnalyzer.cs | 22 +- .../Core/Scheduling/TestDurationSerializer.cs | 4 +- .../Core/Settings/SettingsWrapper.cs | 16 +- .../Core/TestCases/MethodSignatureCreator.cs | 6 +- .../Core/TestCases/NewTestCaseResolver.cs | 8 +- .../Core/TestCases/TestCaseFactory.cs | 20 +- .../Core/TestCases/TestCaseResolver.cs | 6 +- .../StandardOutputTestResultParser.cs | 8 +- ...StreamingStandardOutputTestResultParser.cs | 6 +- .../Core/TestResults/XmlTestResultParser.cs | 14 +- .../DiaResolver.Tests/DiaResolverTests.cs | 6 +- GoogleTestAdapter/DiaResolver/DiaFactory.cs | 2 +- GoogleTestAdapter/DiaResolver/DiaResolver.cs | 16 +- .../DiaResolver/DiaResolver.csproj | 11 + GoogleTestAdapter/DiaResolver/PeParser.cs | 6 +- .../DiaResolver/Resources.Designer.cs | 144 +++ GoogleTestAdapter/DiaResolver/Resources.resx | 152 ++++ .../TestAdapter.Tests/TestDiscovererTests.cs | 8 +- .../TestExecutorTestsBase.cs | 25 +- .../TestAdapter/CommonFunctions.cs | 15 +- .../TestAdapter/DataConversionExtensions.cs | 6 +- .../Framework/MessageBasedDebuggerAttacher.cs | 10 +- .../Framework/VsTestFrameworkLogger.cs | 10 +- .../TestAdapter/Framework/VsVersion.cs | 10 +- .../TestAdapter/Helpers/TestCaseFilter.cs | 16 +- .../TestAdapter/Resources.Designer.cs | 369 ++++++++ GoogleTestAdapter/TestAdapter/Resources.resx | 245 +++++ .../Settings/RunSettingsContainer.cs | 4 +- .../TestAdapter/TestAdapter.csproj | 9 + .../TestAdapter/TestDiscoverer.cs | 19 +- GoogleTestAdapter/TestAdapter/TestExecutor.cs | 20 +- 51 files changed, 2742 insertions(+), 218 deletions(-) create mode 100644 GoogleTestAdapter/Common.Dynamic.TAfGT/Resources.Designer.cs create mode 100644 GoogleTestAdapter/Common.Dynamic.TAfGT/Resources.resx create mode 100644 GoogleTestAdapter/Core/Resources.Designer.cs create mode 100644 GoogleTestAdapter/Core/Resources.resx create mode 100644 GoogleTestAdapter/DiaResolver/Resources.Designer.cs create mode 100644 GoogleTestAdapter/DiaResolver/Resources.resx create mode 100644 GoogleTestAdapter/TestAdapter/Resources.Designer.cs create mode 100644 GoogleTestAdapter/TestAdapter/Resources.resx diff --git a/GoogleTestAdapter/Common.Dynamic.TAfGT/Common.Dynamic.TAfGT.csproj b/GoogleTestAdapter/Common.Dynamic.TAfGT/Common.Dynamic.TAfGT.csproj index f203e790d..9ccec6262 100644 --- a/GoogleTestAdapter/Common.Dynamic.TAfGT/Common.Dynamic.TAfGT.csproj +++ b/GoogleTestAdapter/Common.Dynamic.TAfGT/Common.Dynamic.TAfGT.csproj @@ -50,6 +50,11 @@ + + True + True + Resources.resx + @@ -61,6 +66,12 @@ Common + + + ResXFileCodeGenerator + Resources.Designer.cs + + diff --git a/GoogleTestAdapter/Common.Dynamic.TAfGT/Resources.Designer.cs b/GoogleTestAdapter/Common.Dynamic.TAfGT/Resources.Designer.cs new file mode 100644 index 000000000..228fb555e --- /dev/null +++ b/GoogleTestAdapter/Common.Dynamic.TAfGT/Resources.Designer.cs @@ -0,0 +1,99 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace GoogleTestAdapter.Common { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GoogleTestAdapter.Common.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Test Adapter for Google Test. + /// + internal static string ExtensionName { + get { + return ResourceManager.GetString("ExtensionName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test Adapter for Google Test: Test discovery starting.... + /// + internal static string TestDiscoveryStarting { + get { + return ResourceManager.GetString("TestDiscoveryStarting", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test Adapter for Google Test: Test execution starting.... + /// + internal static string TestExecutionStarting { + get { + return ResourceManager.GetString("TestExecutionStarting", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Check out Test Adapter for Google Test's trouble shooting section at https://go.microsoft.com/fwlink/?linkid=848168. + /// + internal static string TroubleShootingLink { + get { + return ResourceManager.GetString("TroubleShootingLink", resourceCulture); + } + } + } +} diff --git a/GoogleTestAdapter/Common.Dynamic.TAfGT/Resources.resx b/GoogleTestAdapter/Common.Dynamic.TAfGT/Resources.resx new file mode 100644 index 000000000..950c13d80 --- /dev/null +++ b/GoogleTestAdapter/Common.Dynamic.TAfGT/Resources.resx @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Test Adapter for Google Test + + + Test Adapter for Google Test: Test discovery starting... + + + Test Adapter for Google Test: Test execution starting... + + + Check out Test Adapter for Google Test's trouble shooting section at https://go.microsoft.com/fwlink/?linkid=848168 + + \ No newline at end of file diff --git a/GoogleTestAdapter/Common.Dynamic.TAfGT/Strings.cs b/GoogleTestAdapter/Common.Dynamic.TAfGT/Strings.cs index 339711d38..6908f7ea9 100644 --- a/GoogleTestAdapter/Common.Dynamic.TAfGT/Strings.cs +++ b/GoogleTestAdapter/Common.Dynamic.TAfGT/Strings.cs @@ -5,9 +5,9 @@ namespace GoogleTestAdapter.Common { public class Strings : IStrings { - public string ExtensionName => "Test Adapter for Google Test"; - public string TroubleShootingLink => "Check out Test Adapter for Google Test's trouble shooting section at https://go.microsoft.com/fwlink/?linkid=848168"; - public string TestDiscoveryStarting => "Test Adapter for Google Test: Test discovery starting..."; - public string TestExecutionStarting => "Test Adapter for Google Test: Test execution starting..."; + public string ExtensionName => Resources.ExtensionName; + public string TroubleShootingLink => Resources.TroubleShootingLink; + public string TestDiscoveryStarting => Resources.TestDiscoveryStarting; + public string TestExecutionStarting => Resources.TestExecutionStarting; } } diff --git a/GoogleTestAdapter/Core.Tests/GoogleTestDiscovererTests.cs b/GoogleTestAdapter/Core.Tests/GoogleTestDiscovererTests.cs index c5911754f..33ebc278b 100644 --- a/GoogleTestAdapter/Core.Tests/GoogleTestDiscovererTests.cs +++ b/GoogleTestAdapter/Core.Tests/GoogleTestDiscovererTests.cs @@ -163,7 +163,7 @@ public void GetTestsFromExecutable_WithoutPathExtension_ProducesWarning() IList testCases = discoverer.GetTestsFromExecutable(targetExe); testCases.Count.Should().Be(0); - MockLogger.Verify(l => l.LogError(It.Is(s => s.StartsWith("Could not list test cases of executable")))); + MockLogger.Verify(l => l.LogError(It.Is(s => s.StartsWith("Could not list test cases for executable")))); } finally { diff --git a/GoogleTestAdapter/Core/Core.csproj b/GoogleTestAdapter/Core/Core.csproj index 9669590d8..784f6c73a 100644 --- a/GoogleTestAdapter/Core/Core.csproj +++ b/GoogleTestAdapter/Core/Core.csproj @@ -67,6 +67,11 @@ + + True + True + Resources.resx + @@ -108,6 +113,11 @@ Designer GtaTestDurations.xsd + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + diff --git a/GoogleTestAdapter/Core/GoogleTestDiscoverer.cs b/GoogleTestAdapter/Core/GoogleTestDiscoverer.cs index 589800837..5c5783717 100644 --- a/GoogleTestAdapter/Core/GoogleTestDiscoverer.cs +++ b/GoogleTestAdapter/Core/GoogleTestDiscoverer.cs @@ -1,4 +1,4 @@ -// This file has been modified by Microsoft on 7/2017. +// This file has been modified by Microsoft on 8/2017. using GoogleTestAdapter.Common; using GoogleTestAdapter.DiaResolver; @@ -70,12 +70,12 @@ private static void DiscoverTests(string executable, ITestFrameworkReporter repo Action reportTestCases = tc => { reporter.ReportTestsFound(tc.Yield()); - logger.DebugInfo("Added testcase " + tc.DisplayName); + logger.DebugInfo(String.Format(Resources.AddedTestCase, tc.DisplayName)); nrOfTestCases++; }; var factory = new TestCaseFactory(executable, logger, settings, diaResolverFactory); factory.CreateTestCases(reportTestCases); - logger.LogInfo("Found " + nrOfTestCases + " tests in executable " + executable); + logger.LogInfo(String.Format(Resources.NumberOfTestsMessage, nrOfTestCases, executable)); }, logger); } @@ -86,9 +86,9 @@ public IList GetTestsFromExecutable(string executable) foreach (TestCase testCase in testCases) { - _logger.DebugInfo("Added testcase " + testCase.DisplayName); + _logger.DebugInfo(String.Format(Resources.AddedTestCase, testCase.DisplayName)); } - _logger.LogInfo("Found " + testCases.Count + " tests in executable " + executable); + _logger.LogInfo(String.Format(Resources.NumberOfTestsMessage, testCases.Count, executable)); return testCases; } @@ -98,27 +98,26 @@ public bool IsGoogleTestExecutable(string executable, string customRegex = "") string googleTestIndicatorFile = $"{executable}{GoogleTestIndicator}"; if (File.Exists(googleTestIndicatorFile)) { - _logger.DebugInfo($"Google Test indicator file found for executable {executable}"); + _logger.DebugInfo(String.Format(Resources.FileFound, executable)); return true; } - _logger.DebugInfo($"No Google Test indicator file found for executable {executable}"); + _logger.DebugInfo(String.Format(Resources.FileNotFound, executable)); bool matches; string regexSource, regex; if (string.IsNullOrWhiteSpace(customRegex)) { - regexSource = "default"; + regexSource = Resources.Default; regex = SettingsWrapper.TestFinderRegex; matches = CompiledTestFinderRegex.IsMatch(executable); } else { - regexSource = "custom"; + regexSource = Resources.Custom; regex = customRegex; matches = SafeMatches(executable, customRegex); } - _logger.DebugInfo( - $"'{executable}' {(matches ? "matches" : "does not match")} {regexSource} regex '{regex}'"); + _logger.DebugInfo(String.Format(matches ? Resources.Matches : Resources.DontMatch, executable, regexSource, regex)); return matches; } @@ -146,11 +145,11 @@ private bool SafeMatches(string executable, string regex) } catch (ArgumentException e) { - _logger.LogError($"Regex '{regex}' can not be parsed: {e.Message}"); + _logger.LogError(String.Format(Resources.RegexParseError, regex, e.Message)); } catch (RegexMatchTimeoutException e) { - _logger.LogError($"Regex '{regex}' timed out: {e.Message}"); + _logger.LogError(String.Format(Resources.RegexTimedOut, regex, e.Message)); } return matches; } @@ -160,7 +159,7 @@ private static bool VerifyExecutableTrust(string executable, ILogger logger) var zone = Zone.CreateFromUrl(executable); if (zone.SecurityZone != System.Security.SecurityZone.MyComputer) { - logger.LogError("Executable " + executable + " came from another computer and was blocked to help protect this computer."); + logger.LogError(String.Format(Resources.ExecutableError, executable)); return false; } return true; diff --git a/GoogleTestAdapter/Core/GoogleTestExecutor.cs b/GoogleTestAdapter/Core/GoogleTestExecutor.cs index 54146b140..2480f7b73 100644 --- a/GoogleTestAdapter/Core/GoogleTestExecutor.cs +++ b/GoogleTestAdapter/Core/GoogleTestExecutor.cs @@ -1,4 +1,7 @@ -using System.Linq; +// This file has been modified by Microsoft on 8/2017. + +using System; +using System.Linq; using System.Collections.Generic; using GoogleTestAdapter.Common; using GoogleTestAdapter.Model; @@ -31,7 +34,7 @@ public GoogleTestExecutor(ILogger logger, SettingsWrapper settings) public void RunTests(IEnumerable testCasesToRun, ITestFrameworkReporter reporter, IDebuggedProcessLauncher launcher, bool isBeingDebugged, string solutionDirectory, IProcessExecutor executor) { TestCase[] testCasesToRunAsArray = testCasesToRun as TestCase[] ?? testCasesToRun.ToArray(); - _logger.LogInfo("Running " + testCasesToRunAsArray.Length + " tests..."); + _logger.LogInfo(String.Format(Resources.NumberOfTestsRunningMessage, testCasesToRunAsArray.Length)); lock (this) { @@ -68,8 +71,7 @@ private void ComputeTestRunner(ITestFrameworkReporter reporter, bool isBeingDebu _runner = new PreparingTestRunner(solutionDirectory, reporter, _logger, _settings, _schedulingAnalyzer); if (_settings.ParallelTestExecution && isBeingDebugged) { - _logger.DebugInfo( - "Parallel execution is selected in options, but tests are executed sequentially because debugger is attached."); + _logger.DebugInfo(Resources.ParallelExecution); } } } diff --git a/GoogleTestAdapter/Core/Helpers/ProcessExecutor.cs b/GoogleTestAdapter/Core/Helpers/ProcessExecutor.cs index ebdb6baff..4a4bb2515 100644 --- a/GoogleTestAdapter/Core/Helpers/ProcessExecutor.cs +++ b/GoogleTestAdapter/Core/Helpers/ProcessExecutor.cs @@ -1,4 +1,6 @@ -using System; +// This file has been modified by Microsoft on 8/2017. + +using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; diff --git a/GoogleTestAdapter/Core/Helpers/ProcessLauncher.cs b/GoogleTestAdapter/Core/Helpers/ProcessLauncher.cs index ea0f21eef..4917df397 100644 --- a/GoogleTestAdapter/Core/Helpers/ProcessLauncher.cs +++ b/GoogleTestAdapter/Core/Helpers/ProcessLauncher.cs @@ -1,4 +1,6 @@ -using System; +// This file has been modified by Microsoft on 8/2017. + +using System; using System.Collections.Generic; using System.Diagnostics; using System.Text; @@ -70,13 +72,12 @@ private int LaunchProcess(string workingDirectory, string command, string param, var waiter = new ProcessWaiter(process); if (printTestOutput) { - _logger.LogInfo( - ">>>>>>>>>>>>>>> Output of command '" + command + " " + param + "'"); + _logger.LogInfo(String.Format(Resources.OutputOfCommandMessage, command, param)); } ReadTheStream(process, output, printTestOutput, throwIfError); if (printTestOutput) { - _logger.LogInfo("<<<<<<<<<<<<<<< End of Output"); + _logger.LogInfo(Resources.EndOfOutputMessage); } return waiter.WaitForExit(); } @@ -100,7 +101,7 @@ private void ReadTheStream(Process process, List streamContent, bool pri } if (throwIfError && process.ExitCode != 0) { - throw new Exception("Process exited with return code " + process.ExitCode); + throw new Exception(String.Format(Resources.ProcessExitCode, process.ExitCode)); } } diff --git a/GoogleTestAdapter/Core/Helpers/RegexTraitParser.cs b/GoogleTestAdapter/Core/Helpers/RegexTraitParser.cs index 155cca335..fcd7045b9 100644 --- a/GoogleTestAdapter/Core/Helpers/RegexTraitParser.cs +++ b/GoogleTestAdapter/Core/Helpers/RegexTraitParser.cs @@ -1,4 +1,4 @@ -// This file has been modified by Microsoft on 6/2017. +// This file has been modified by Microsoft on 8/2017. using GoogleTestAdapter.Common; using GoogleTestAdapter.Settings; @@ -31,7 +31,7 @@ public List ParseTraitsRegexesString(string option, bool ignoreE } catch (Exception e) { - string message = "Could not parse pair '" + pair + "', exception message: " + e.Message; + string message = String.Format(Resources.ParsePair, pair, e.Message); if (ignoreErrors) _logger?.LogError(message); else diff --git a/GoogleTestAdapter/Core/Helpers/TestProcessLauncher.cs b/GoogleTestAdapter/Core/Helpers/TestProcessLauncher.cs index 3d3825312..c35b2496f 100644 --- a/GoogleTestAdapter/Core/Helpers/TestProcessLauncher.cs +++ b/GoogleTestAdapter/Core/Helpers/TestProcessLauncher.cs @@ -1,4 +1,6 @@ -using System; +// This file has been modified by Microsoft on 8/2017. + +using System; using System.Collections.Generic; using System.Diagnostics; using GoogleTestAdapter.Common; @@ -61,11 +63,11 @@ public static void KillProcess(int processId, ILogger logger) try { process.Kill(); - logger.DebugInfo($"Killed process {process} with startTime={startTime.ToShortTimeString()}"); + logger.DebugInfo(String.Format(Resources.KilledProcess, process, startTime.ToShortTimeString())); } catch (Exception e) { - logger.DebugWarning($"Could not kill process {process} with startTime={startTime.ToShortTimeString()}: {e.Message}"); + logger.DebugWarning(String.Format(Resources.CouldNotKill, process, startTime.ToShortTimeString(), e.Message)); } } catch (Exception) @@ -78,7 +80,7 @@ public static void KillProcess(int processId, ILogger logger) private int LaunchProcessWithDebuggerAttached(string workingDirectory, string command, string param, bool printTestOutput, IDebuggedProcessLauncher handle) { - _logger.LogInfo("Attaching debugger to " + command); + _logger.LogInfo(String.Format(Resources.AttachDebuggerMessage, command)); if (printTestOutput) { _logger.DebugInfo( diff --git a/GoogleTestAdapter/Core/Helpers/Utils.cs b/GoogleTestAdapter/Core/Helpers/Utils.cs index a23f45da5..8158d2d93 100644 --- a/GoogleTestAdapter/Core/Helpers/Utils.cs +++ b/GoogleTestAdapter/Core/Helpers/Utils.cs @@ -1,4 +1,4 @@ -// This file has been modified by Microsoft on 6/2017. +// This file has been modified by Microsoft on 8/2017. using System; using System.Globalization; @@ -73,7 +73,7 @@ public static void ValidateRegex(string pattern) } catch (ArgumentException e) { - throw new Exception($"Invalid regular expression \"{pattern}\", exception message: {e.Message}"); + throw new Exception(String.Format(Resources.InvalidRegularExpression, pattern, e.Message)); } } diff --git a/GoogleTestAdapter/Core/Resources.Designer.cs b/GoogleTestAdapter/Core/Resources.Designer.cs new file mode 100644 index 000000000..3be5c5cb7 --- /dev/null +++ b/GoogleTestAdapter/Core/Resources.Designer.cs @@ -0,0 +1,855 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace GoogleTestAdapter { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GoogleTestAdapter.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Number of actual test case durations: {0}. + /// + internal static string ActualTestCase { + get { + return ResourceManager.GetString("ActualTestCase", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Added test case '{0}'. + /// + internal static string AddedTestCase { + get { + return ResourceManager.GetString("AddedTestCase", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test case already in analyzer: {0}. + /// + internal static string AlreadyInAnalyzer { + get { + return ResourceManager.GetString("AlreadyInAnalyzer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Attaching debugger to {0}. + /// + internal static string AttachDebuggerMessage { + get { + return ResourceManager.GetString("AttachDebuggerMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Average difference between expected and actual duration: {0} ms. + /// + internal static string AvgDifference { + get { + return ResourceManager.GetString("AvgDifference", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Restoring solution settings: {0}. + /// + internal static string BacktoSolution { + get { + return ResourceManager.GetString("BacktoSolution", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} {1} batch file: Did not find file: {2}. + /// + internal static string BatchFileMissing { + get { + return ResourceManager.GetString("BatchFileMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} {1} batch file returned exit code {2}, executed command: '{3}'. + /// + internal static string BatchReturnedExitCode { + get { + return ResourceManager.GetString("BatchReturnedExitCode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} Collected {1} test result(s) from result XML file {2}. + /// + internal static string CollectedResults { + get { + return ResourceManager.GetString("CollectedResults", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Collected {0} test results from console output. + /// + internal static string CollectedResultsFromConsole { + get { + return ResourceManager.GetString("CollectedResultsFromConsole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Command executed: '{0} {1}', working directory: '{2}'. + /// + internal static string CommandExecuted { + get { + return ResourceManager.GetString("CommandExecuted", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exceeded maximum allowed command line length ({0}) after including {1} tests (next string length is {2}). + /// + internal static string CommandLineGeneratorError { + get { + return ResourceManager.GetString("CommandLineGeneratorError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} Collected {1} test results from console output. + /// + internal static string ConsoleOutput { + get { + return ResourceManager.GetString("ConsoleOutput", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not terminate process {0} started at {1}: {2}. + /// + internal static string CouldNotKill { + get { + return ResourceManager.GetString("CouldNotKill", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to reason is probably a crash of test {0}. + /// + internal static string CrashTest { + get { + return ResourceManager.GetString("CrashTest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} Created {1} test results for tests which were found neither in result XML file nor in console output. + /// + internal static string CreatedResults { + get { + return ResourceManager.GetString("CreatedResults", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Created {0} test results for tests which were neither found in result XML file nor in console output. + /// + internal static string CreatedTestResults { + get { + return ResourceManager.GetString("CreatedTestResults", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to custom. + /// + internal static string Custom { + get { + return ResourceManager.GetString("Custom", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to default. + /// + internal static string Default { + get { + return ResourceManager.GetString("Default", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} Could not delete test directory '{1}': {2}. + /// + internal static string DeleteTestDir { + get { + return ResourceManager.GetString("DeleteTestDir", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} does not match {1} regex {2}. + /// + internal static string DontMatch { + get { + return ResourceManager.GetString("DontMatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <<<<<<<<<<<<<<< End of Output. + /// + internal static string EndOfOutputMessage { + get { + return ResourceManager.GetString("EndOfOutputMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} <<<<<<<<<<<<<<< End of Output. + /// + internal static string EndOfOutputWithThreadInfo { + get { + return ResourceManager.GetString("EndOfOutputWithThreadInfo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} Exception while running tests: {1}. + /// + internal static string ExceptionMessage { + get { + return ResourceManager.GetString("ExceptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exception while resolving test locations and traits in {0}\n{1}. + /// + internal static string ExceptionResolving { + get { + return ResourceManager.GetString("ExceptionResolving", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0}: Executable came from another computer and was blocked to help protect this computer.. + /// + internal static string ExecutableError { + get { + return ResourceManager.GetString("ExecutableError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} In particular: launch command prompt, change into directory '{1}', and execute the following command to make sure your tests can be run in general.{2}. + /// + internal static string ExecuteSteps { + get { + return ResourceManager.GetString("ExecuteSteps", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} Execution has been canceled: {1}. + /// + internal static string ExecutionCancelled { + get { + return ResourceManager.GetString("ExecutionCancelled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Execution is already running with settings for executable {0}, can not switch to settings for {1}. + /// + internal static string ExecutionString { + get { + return ResourceManager.GetString("ExecutionString", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} Execution took {1}. + /// + internal static string ExecutionTime { + get { + return ResourceManager.GetString("ExecutionTime", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} expected durations have been found in actual durations. + /// + internal static string ExpectedDurations { + get { + return ResourceManager.GetString("ExpectedDurations", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Number of expected test case durations: {0}. + /// + internal static string ExpectedTestCase { + get { + return ResourceManager.GetString("ExpectedTestCase", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Google Test indicator file found for executable {0}. + /// + internal static string FileFound { + get { + return ResourceManager.GetString("FileFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No Google Test indicator file found for executable {0}. + /// + internal static string FileNotFound { + get { + return ResourceManager.GetString("FileNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found {0} test method symbols and {1} trait symbols in binary {2}. + /// + internal static string FoundTestMethod { + get { + return ResourceManager.GetString("FoundTestMethod", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid file {0}. {1}. + /// + internal static string InvalidFile { + get { + return ResourceManager.GetString("InvalidFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid regular expression '{0}', exception message: {1}. + /// + internal static string InvalidRegularExpression { + get { + return ResourceManager.GetString("InvalidRegularExpression", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Terminated process {0} started at {1}. + /// + internal static string KilledProcess { + get { + return ResourceManager.GetString("KilledProcess", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not find source location for test {0}. + /// + internal static string LocationNotFoundError { + get { + return ResourceManager.GetString("LocationNotFoundError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} matches {1} regex {2}. + /// + internal static string Matches { + get { + return ResourceManager.GetString("Matches", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} must never be < 0. + /// + internal static string NeverBeZero { + get { + return ResourceManager.GetString("NeverBeZero", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No known test case for test result of line '{0}' - are you repeating a test run, but tests have changed in the meantime?. + /// + internal static string NoKnownTestCaseMessage { + get { + return ResourceManager.GetString("NoKnownTestCaseMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Command produced no output. + /// + internal static string NoOutput { + get { + return ResourceManager.GetString("NoOutput", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No settings configured for test executable '{0}'; running with solution settings: {1}. + /// + internal static string NoSettingConfigured { + get { + return ResourceManager.GetString("NoSettingConfigured", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note that no test output will be shown on the test console when executing tests concurrently!. + /// + internal static string NoTestOutputShown { + get { + return ResourceManager.GetString("NoTestOutputShown", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Nothing to report.. + /// + internal static string NothingToReport { + get { + return ResourceManager.GetString("NothingToReport", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Found {0} tests in executable {1}. + /// + internal static string NumberOfTestsMessage { + get { + return ResourceManager.GetString("NumberOfTestsMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Running {0} tests.... + /// + internal static string NumberOfTestsRunningMessage { + get { + return ResourceManager.GetString("NumberOfTestsRunningMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Output file does not exist, did your tests crash?. + /// + internal static string OutputFileMissing { + get { + return ResourceManager.GetString("OutputFileMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0}>>>>>>>>>>>>>>> Output of command '{1} {2}'. + /// + internal static string OutputOfCmdWithThreadInfo { + get { + return ResourceManager.GetString("OutputOfCmdWithThreadInfo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Output of command. + /// + internal static string OutputOfCommand { + get { + return ResourceManager.GetString("OutputOfCommand", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to >>>>>>>>>>>>>>> Output of command '{0} {1}'. + /// + internal static string OutputOfCommandMessage { + get { + return ResourceManager.GetString("OutputOfCommandMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parallel execution is selected in options, but tests are executed sequentially because debugger is attached.. + /// + internal static string ParallelExecution { + get { + return ResourceManager.GetString("ParallelExecution", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not parse duration in line '{0}'. + /// + internal static string ParseDurationMessage { + get { + return ResourceManager.GetString("ParseDurationMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not parse pair '{0}', exception message: {1}. + /// + internal static string ParsePair { + get { + return ResourceManager.GetString("ParsePair", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Process has exited with code {0}. + /// + internal static string ProcessExitCode { + get { + return ResourceManager.GetString("ProcessExitCode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not list test cases for executable '{0}': process execution failed with exit code {1}. + /// + internal static string ProcessFailed { + get { + return ResourceManager.GetString("ProcessFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not read test durations: {0}. + /// + internal static string ReadTestDurationError { + get { + return ResourceManager.GetString("ReadTestDurationError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Regex '{0}'. + /// + internal static string Regex { + get { + return ResourceManager.GetString("Regex", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Regex '{0}' cannot be parsed: {1}. + /// + internal static string RegexParseError { + get { + return ResourceManager.GetString("RegexParseError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Regex '{0}' timed out: {1}. + /// + internal static string RegexTimedOut { + get { + return ResourceManager.GetString("RegexTimedOut", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} Reported {1} test results to Visual Studio during test execution, executable: '{2}'. + /// + internal static string ReportedResultsToVS { + get { + return ResourceManager.GetString("ReportedResultsToVS", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} Reported {1} test results to Visual Studio, executable: '{2}', duration: {3}. + /// + internal static string ReportedTestResults { + get { + return ResourceManager.GetString("ReportedTestResults", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test {0}: Expected {1} ms, actual {2} ms. + /// + internal static string Results { + get { + return ResourceManager.GetString("Results", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} {1} batch file caused exception, message: '{2}', executed command: '{3}'. + /// + internal static string RunBatchException { + get { + return ResourceManager.GetString("RunBatchException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} Failed to run test executable '{1}': {2}. + /// + internal static string RunExecutableError { + get { + return ResourceManager.GetString("RunExecutableError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to >>> Scheduling statistics <<<. + /// + internal static string SchedulingStats { + get { + return ResourceManager.GetString("SchedulingStats", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Settings for test executable '{0}': {1}. + /// + internal static string Settings { + get { + return ResourceManager.GetString("Settings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Settings for test executable '{0}': {1}. + /// + internal static string SettingsMessage { + get { + return ResourceManager.GetString("SettingsMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SettingsWrapper is already running with settings for an executable on thread '{0}', cannot also be used by thread {1}. + /// + internal static string SettingsWrapperString { + get { + return ResourceManager.GetString("SettingsWrapperString", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} Stack trace: {1}{2}. + /// + internal static string StackTrace { + get { + return ResourceManager.GetString("StackTrace", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Standard deviation: {0}. + /// + internal static string StandardDeviation { + get { + return ResourceManager.GetString("StandardDeviation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} {1} batch file: Successfully ran '{2}'. + /// + internal static string SuccessfullyRun { + get { + return ResourceManager.GetString("SuccessfullyRun", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test case already in analyzer: {0}. + /// + internal static string TestCaseInAnalyzer { + get { + return ResourceManager.GetString("TestCaseInAnalyzer", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} Test cases seem to not have been run - are you repeating a test run, but tests have changed in the meantime? Test cases:{1}. + /// + internal static string TestCaseNotRun { + get { + return ResourceManager.GetString("TestCaseNotRun", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test whether the following commands can be executed sucessfully on the command line (make sure all required binaries are on the PATH):. + /// + internal static string TestCommandCanBeRun { + get { + return ResourceManager.GetString("TestCommandCanBeRun", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test discovery was cancelled after {0} s for executable {1}. + /// + internal static string TestDiscoveryCancelled { + get { + return ResourceManager.GetString("TestDiscoveryCancelled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test result file {0} could not be parsed (completely) - your test executable has probably crashed. Exception message: {1}. + /// + internal static string TestResultParse { + get { + return ResourceManager.GetString("TestResultParse", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test setup. + /// + internal static string TestSetup { + get { + return ResourceManager.GetString("TestSetup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test teardown. + /// + internal static string TestTeardown { + get { + return ResourceManager.GetString("TestTeardown", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Executing tests on {0} threads. + /// + internal static string ThreadExecutionMessage { + get { + return ResourceManager.GetString("ThreadExecutionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} Check out Test Adapter for Google Test's trouble shooting section at https://go.microsoft.com/fwlink/?linkid=848168. + /// + internal static string TroubleShooting { + get { + return ResourceManager.GetString("TroubleShooting", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unknown literal. + /// + internal static string UnknownLiteral { + get { + return ResourceManager.GetString("UnknownLiteral", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unknown test case status: {0}. + /// + internal static string UnknownTestCase { + get { + return ResourceManager.GetString("UnknownTestCase", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Using splitter based on test durations. + /// + internal static string UsingSplitterOnDuration { + get { + return ResourceManager.GetString("UsingSplitterOnDuration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Using splitter based on number of tests. + /// + internal static string UsingSplitterOnNumber { + get { + return ResourceManager.GetString("UsingSplitterOnNumber", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} worst differences:. + /// + internal static string WorstDifferences { + get { + return ResourceManager.GetString("WorstDifferences", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to XmlNode could not be parsed: '{0}'. Exception message: {1}. + /// + internal static string XmlNodeParse { + get { + return ResourceManager.GetString("XmlNodeParse", resourceCulture); + } + } + } +} diff --git a/GoogleTestAdapter/Core/Resources.resx b/GoogleTestAdapter/Core/Resources.resx new file mode 100644 index 000000000..9a4eb7d4c --- /dev/null +++ b/GoogleTestAdapter/Core/Resources.resx @@ -0,0 +1,456 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Number of actual test case durations: {0} + {0} represents a number (e.g. 5) + + + Added test case '{0}' + {0} represents an unlocalized test name (e.g. "TestSuite1.Test2") + + + Test case already in analyzer: {0} + {0} represents an unlocalized test name (e.g. "TestSuite1.Test2") + + + Attaching debugger to {0} + {0} represents an unlocalized command to which debugger attaches (e.g. cmd.exe) + + + Average difference between expected and actual duration: {0} ms + {0} represents a number (e.g. 5) + + + Restoring solution settings: {0} + {0} represents unlocalized properties of current object + + + {0} {1} batch file: Did not find file: {2} + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. "Test setup" or "Test teardown"), {2} represents unlocalized file path (e.g c:\test\foo.bat) + + + {0} {1} batch file returned exit code {2}, executed command: '{3}' + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. "Test setup" or "Test teardown"), {2} represents a number (e.g. 5), {3} represents unlocalized file path (e.g c:\test\foo.bat) + + + {0} Collected {1} test result(s) from result XML file {2} + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a number (e.g. 5), {2} represents unlocalized file path (e.g c:\test\results.xml) + + + Collected {0} test results from console output + {0} represents a number (e.g. 5) + + + Command executed: '{0} {1}', working directory: '{2}' + {0} represents an unlocalized name of executable (e.g. cmd.exe) file, {1} represents unlocalized options to test (e.g. "gtest_list_tests"), {2} represents unlocalized directory path (e.g c:\test\dir) + + + Exceeded maximum allowed command line length ({0}) after including {1} tests (next string length is {2}) + {0} represents a number (e.g. 5), {1} represents a number (e.g. 5), {2} represents a number (e.g. 5) + + + {0} Collected {1} test results from console output + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a number (e.g. 5) + + + Could not terminate process {0} started at {1}: {2} + {0} represents an unlocalized process name (e.g notepad.exe), {1} represents unlocalized string for time (e.g. "3/1/2008 7:00:00 AM"), {2} represents localized exception message (e.g. "Cannot load file") + + + reason is probably a crash of test {0} + {0} represents a unlocalized name of test (e.g. foo) + + + {0} Created {1} test results for tests which were found neither in result XML file nor in console output + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a number (e.g. 5) + + + Created {0} test results for tests which were neither found in result XML file nor in console output + {0} represents a number (e.g. 5) + + + custom + + + default + + + {0} Could not delete test directory '{1}': {2} + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents unlocalized directory path (e.g c:\test\dir), {2} represents localized exception message (e.g. "Cannot load file") + + + {0} does not match {1} regex {2} + {0} represents an unlocalized name of executable (e.g. cmd.exe) file, {1} represents localized string for regex source (e.g Custom or Default), {2} represents unlocalized string for regular expression (e.g "*a.exe") + + + <<<<<<<<<<<<<<< End of Output + + + {0} <<<<<<<<<<<<<<< End of Output + {0} represents an unlocalized name for thread (e.g. "T001519") + + + {0} Exception while running tests: {1} + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents localized exception message (e.g. "Cannot load file") + + + Exception while resolving test locations and traits in {0}\n{1} + {0} represents an unlocalized binary name (e.g notepad.exe), {1} represents localized exception message (e.g. "Cannot load file") + + + {0}: Executable came from another computer and was blocked to help protect this computer. + {0} represents a unlocalized name of executable (e.g. cmd.exe) file + + + {0} In particular: launch command prompt, change into directory '{1}', and execute the following command to make sure your tests can be run in general.{2} + This sentence is continuation of TroubleShooting string. {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents unlocalized directory path (e.g c:\test\dir), {2} represents a unlocalized new line string (e.g "\n") + + + {0} Execution has been canceled: {1} + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents localized exception message (e.g. "Cannot load file") + + + Execution is already running with settings for executable {0}, can not switch to settings for {1} + {0} represents a unlocalized name of executable (e.g. cmd.exe) file, {1} represents a unlocalized name of executable (e.g. cmd.exe) file + + + {0} Execution took {1} + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents unlocalized string for time it took (e.g. "3/1/2008 7:00:00 AM") + + + {0} expected durations have been found in actual durations + {0} represents a number (e.g. 5) + + + Number of expected test case durations: {0} + {0} represents a number (e.g. 5) + + + Google Test indicator file found for executable {0} + {0} represents a unlocalized name of executable (e.g. cmd.exe) file + + + No Google Test indicator file found for executable {0} + {0} represents a unlocalized name of executable (e.g. cmd.exe) file + + + Found {0} test method symbols and {1} trait symbols in binary {2} + {0} represents a number (e.g. 5), {1} represents a number (e.g. 5), {2} represents an unlocalized binary name (e.g notepad.exe) + + + Invalid file {0}. {1} + {0} represents an unlocalized file name (e.g. c:\foo.exe.gta.testdurations), {1} represents unlocalized string for exception message + + + Invalid regular expression '{0}', exception message: {1} + {0} represents an unlocalized regex (e.g. "abc*d+e*"), {1} represents localized exception message (e.g. "Cannot load file") + + + Terminated process {0} started at {1} + {0} represents an unlocalized process name (e.g notepad.exe), {1} represents unlocalized string for time (e.g. "3/1/2008 7:00:00 AM") + + + Could not find source location for test {0} + {0} represents an unlocalized test name (e.g. "TestSuite1.Test2") + + + {0} matches {1} regex {2} + {0} represents an unlocalized name of executable (e.g. cmd.exe) file, {1} represents localized string for regex source (e.g Custom or Default), {2} represents unlocalized string for regular expression (e.g "*a.exe") + + + {0} must never be < 0 + {0} represents an unlocalized string for name of variable (e.g. _nrOfRunningExecutions) + + + No known test case for test result of line '{0}' - are you repeating a test run, but tests have changed in the meantime? + {0} represents an unlocalized string for line in test + + + Command produced no output + + + No settings configured for test executable '{0}'; running with solution settings: {1} + {0} represents a unlocalized name of executable (e.g. cmd.exe) file, {1} represents unlocalized current object + + + Note that no test output will be shown on the test console when executing tests concurrently! + + + Nothing to report. + + + Found {0} tests in executable {1} + {0} represents a number (e.g. 5), {1} represents an unlocalized binary name (e.g notepad.exe) + + + Running {0} tests... + {0} represents a number (e.g. 5) + + + Output file does not exist, did your tests crash? + + + {0}>>>>>>>>>>>>>>> Output of command '{1} {2}' + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents an unlocalized binary name (e.g notepad.exe), {2} represents unlocalized paramaters to binary (e.g. "--param") + + + Output of command + + + >>>>>>>>>>>>>>> Output of command '{0} {1}' + {0} represents unlocalized command (e.g. cmd.exe), {1} represents unlocalized paramaters to executable (e.g. "/C exit 2") + + + Parallel execution is selected in options, but tests are executed sequentially because debugger is attached. + + + Could not parse duration in line '{0}' + {0} represents line + + + Could not parse pair '{0}', exception message: {1} + {0} is regex pair, {1} represents localized exception message (e.g. "Cannot load file") + + + Process has exited with code {0} + {0} represents a number (e.g. 5) + + + Could not list test cases for executable '{0}': process execution failed with exit code {1} + {0} represents a unlocalized name of executable (e.g. cmd.exe) file, {1} means process exit code + + + Could not read test durations: {0} + {0} represents localized exception message (e.g. "Cannot load file") + + + Regex '{0}' + {0} represents unlocalized regex pattern used (e.g. ab*d+) + + + Regex '{0}' cannot be parsed: {1} + {0} represents unlocalized regex pattern used (e.g. ab*d+), {1} represents localized exception message (e.g. "Cannot load file") + + + Regex '{0}' timed out: {1} + {0} represents unlocalized regex pattern used (e.g. ab*d+), {1} represents localized exception message (e.g. "Cannot load file") + + + {0} Reported {1} test results to Visual Studio during test execution, executable: '{2}' + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a number (e.g. 5), {2} represents a unlocalized name of executable (e.g. cmd.exe) file + + + {0} Reported {1} test results to Visual Studio, executable: '{2}', duration: {3} + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a number (e.g. 5),{2} represents an unlocalized name of executable (e.g. cmd.exe) file, {3} means stopwatch time + + + Test {0}: Expected {1} ms, actual {2} ms + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a number (e.g. 5), {2} represents a number (e.g. 5) + + + {0} {1} batch file caused exception, message: '{2}', executed command: '{3}' + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. "Test setup" or "Test teardown") , {2} represents localized exception message (e.g. "Cannot load file"), {3} represents unlocalized file path (e.g c:\test\foo.bat) + + + {0} Failed to run test executable '{1}': {2} + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a unlocalized name of executable (e.g. cmd.exe) file, {2} represents localized exception message (e.g. "Cannot load file") + + + >>> Scheduling statistics <<< + + + Settings for test executable '{0}': {1} + {0} represents a unlocalized name of executable (e.g. cmd.exe) file, {1} means current object + + + Settings for test executable '{0}': {1} + {0} represents a unlocalized name of executable (e.g. cmd.exe) file, {1} represents an unlocalized settings string + + + SettingsWrapper is already running with settings for an executable on thread '{0}', cannot also be used by thread {1} + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents an unlocalized name for thread (e.g. "T001519") + + + {0} Stack trace: {1}{2} + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} means new line string, {2} represents unlocalized exception stack + + + Standard deviation: {0} + {0} represents the standardDeviation for statistics to debug output + + + {0} {1} batch file: Successfully ran '{2}' + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. "Test setup" or "Test teardown"), {2} represents unlocalized file path (e.g c:\test\foo.bat) + + + Test case already in analyzer: {0} + {0} represents an unlocalized string for test name (e.g. "TestSuite1.Test2") + + + {0} Test cases seem to not have been run - are you repeating a test run, but tests have changed in the meantime? Test cases:{1} + {0} represents a number (e.g. 5), {1} represents a unlocalized new line string (e.g "\n") + + + Test whether the following commands can be executed sucessfully on the command line (make sure all required binaries are on the PATH): + + + Test discovery was cancelled after {0} s for executable {1} + {0} represents a number (e.g. 5), {1} represents a unlocalized name of executable (e.g. cmd.exe) file + + + Test result file {0} could not be parsed (completely) - your test executable has probably crashed. Exception message: {1} + {0} represents unlocalized file path (e.g c:\test\results.xml), {1} represents localized exception message (e.g. "Cannot load file") + + + Test setup + + + Test teardown + + + Executing tests on {0} threads + {0} represents a number (e.g. 5) + + + {0} Check out Test Adapter for Google Test's trouble shooting section at https://go.microsoft.com/fwlink/?linkid=848168 + {0} represents an unlocalized name for thread (e.g. "T001519") + + + Unknown literal + + + Unknown test case status: {0} + {0} represents an unlocalized status of test (e.g. "run" or "notrun") + + + Using splitter based on test durations + + + Using splitter based on number of tests + + + {0} worst differences: + {0} represents a number (e.g. 5) + + + XmlNode could not be parsed: '{0}'. Exception message: {1} + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents localized exception message (e.g. "Cannot load file") + + \ No newline at end of file diff --git a/GoogleTestAdapter/Core/Runners/CommandLineGenerator.cs b/GoogleTestAdapter/Core/Runners/CommandLineGenerator.cs index 4623a4562..f999094e7 100644 --- a/GoogleTestAdapter/Core/Runners/CommandLineGenerator.cs +++ b/GoogleTestAdapter/Core/Runners/CommandLineGenerator.cs @@ -1,4 +1,6 @@ -using System; +// This file has been modified by Microsoft on 8/2017. + +using System; using System.Collections.Generic; using System.Linq; using GoogleTestAdapter.Helpers; @@ -117,8 +119,7 @@ private string JoinTestsUpToMaxLength(List testCases, int maxLength, o string nextTest = testCases[0].FullyQualifiedName; if (nextTest.Length > maxLength) { - throw new Exception("CommandLineGenerator: I can not deal with this case :-( - maxLength=" + maxLength + - ", includedTestCases.Count=" + includedTestCases.Count + ", nextTest.Length=" + nextTest.Length); + throw new Exception(String.Format(Resources.CommandLineGeneratorError, maxLength, includedTestCases.Count, nextTest.Length)); } while (result.Length + nextTest.Length <= maxLength && testCases.Count > 0) diff --git a/GoogleTestAdapter/Core/Runners/ParallelTestRunner.cs b/GoogleTestAdapter/Core/Runners/ParallelTestRunner.cs index 75a2164aa..74e934153 100644 --- a/GoogleTestAdapter/Core/Runners/ParallelTestRunner.cs +++ b/GoogleTestAdapter/Core/Runners/ParallelTestRunner.cs @@ -1,5 +1,6 @@ -// This file has been modified by Microsoft on 6/2017. +// This file has been modified by Microsoft on 8/2017. +using System; using System.Collections.Generic; using System.Linq; using System.Threading; @@ -70,8 +71,8 @@ private void RunTests(IEnumerable testCasesToRun, string baseDir, List ITestsSplitter splitter = GetTestsSplitter(testCasesToRunAsArray); List> splittedTestCasesToRun = splitter.SplitTestcases(); - _logger.LogInfo("Executing tests on " + splittedTestCasesToRun.Count + " threads"); - _logger.DebugInfo("Note that no test output will be shown on the test console when executing tests concurrently!"); + _logger.LogInfo(string.Format(Resources.ThreadExecutionMessage, splittedTestCasesToRun.Count)); + _logger.DebugInfo(Resources.NoTestOutputShown); int threadId = 0; foreach (List testcases in splittedTestCasesToRun) @@ -97,24 +98,24 @@ private ITestsSplitter GetTestsSplitter(TestCase[] testCasesToRun) foreach (KeyValuePair duration in durations) { if (!_schedulingAnalyzer.AddExpectedDuration(duration.Key, duration.Value)) - _logger.DebugWarning("TestCase already in analyzer: " + duration.Key.FullyQualifiedName); + _logger.DebugWarning(String.Format(Resources.TestCaseInAnalyzer, duration.Key.FullyQualifiedName)); } } catch (InvalidTestDurationsException e) { - _logger.LogWarning($"Could not read test durations: {e.Message}"); + _logger.LogWarning(string.Format(Resources.ReadTestDurationError, e.Message)); } ITestsSplitter splitter; if (durations == null || durations.Count < testCasesToRun.Length) { splitter = new NumberBasedTestsSplitter(testCasesToRun, _settings); - _logger.DebugInfo("Using splitter based on number of tests"); + _logger.DebugInfo(Resources.UsingSplitterOnNumber); } else { splitter = new DurationBasedTestsSplitter(durations, _settings); - _logger.DebugInfo("Using splitter based on test durations"); + _logger.DebugInfo(Resources.UsingSplitterOnDuration); } return splitter; diff --git a/GoogleTestAdapter/Core/Runners/PreparingTestRunner.cs b/GoogleTestAdapter/Core/Runners/PreparingTestRunner.cs index cfe469099..10b270600 100644 --- a/GoogleTestAdapter/Core/Runners/PreparingTestRunner.cs +++ b/GoogleTestAdapter/Core/Runners/PreparingTestRunner.cs @@ -1,4 +1,6 @@ -using System; +// This file has been modified by Microsoft on 8/2017. + +using System; using System.IO; using System.Collections.Generic; using System.Diagnostics; @@ -11,11 +13,13 @@ namespace GoogleTestAdapter.Runners { + public enum TestStatus + { + TestSetup, + TestTeardown + } public class PreparingTestRunner : ITestRunner { - public const string TestSetup = "Test setup"; - public const string TestTeardown = "Test teardown"; - private readonly ILogger _logger; private readonly SettingsWrapper _settings; private readonly ITestRunner _innerTestRunner; @@ -57,27 +61,26 @@ public void RunTests(IEnumerable testCasesToRun, string baseDir, string batch = _settings.GetBatchForTestSetup(_solutionDirectory, testDirectory, _threadId); batch = batch == "" ? "" : _solutionDirectory + batch; - SafeRunBatch(TestSetup, _solutionDirectory, batch, isBeingDebugged); + SafeRunBatch(TestStatus.TestSetup, _solutionDirectory, batch, isBeingDebugged); _innerTestRunner.RunTests(testCasesToRun, baseDir, workingDir, userParameters, isBeingDebugged, debuggedLauncher, executor); batch = _settings.GetBatchForTestTeardown(_solutionDirectory, testDirectory, _threadId); batch = batch == "" ? "" : _solutionDirectory + batch; - SafeRunBatch(TestTeardown, _solutionDirectory, batch, isBeingDebugged); + SafeRunBatch(TestStatus.TestTeardown, _solutionDirectory, batch, isBeingDebugged); stopwatch.Stop(); - _logger.DebugInfo($"{_threadName}Execution took {stopwatch.Elapsed}"); + _logger.DebugInfo(String.Format(Resources.ExecutionTime, _threadName, stopwatch.Elapsed)); string errorMessage; if (!Utils.DeleteDirectory(testDirectory, out errorMessage)) { - _logger.DebugWarning( - $"{_threadName}Could not delete test directory '" + testDirectory + "': " + errorMessage); + _logger.DebugWarning(String.Format(Resources.DeleteTestDir, _threadName, testDirectory, errorMessage)); } } catch (Exception e) { - _logger.LogError($"{_threadName}Exception while running tests: " + e); + _logger.LogError(String.Format(Resources.ExceptionMessage, _threadName, e)); } } @@ -87,26 +90,26 @@ public void Cancel() } - private void SafeRunBatch(string batchType, string workingDirectory, string batch, bool isBeingDebugged) + private void SafeRunBatch(TestStatus batchType, string workingDirectory, string batch, bool isBeingDebugged) { + string locBatchType = (batchType == TestStatus.TestSetup) ? Resources.TestSetup : Resources.TestTeardown; if (string.IsNullOrEmpty(batch)) { return; } if (!File.Exists(batch)) { - _logger.LogError($"{_threadName}Did not find " + batchType.ToLower() + " batch file: " + batch); + _logger.LogError(String.Format(Resources.BatchFileMissing, _threadName, locBatchType.ToLower(), batch)); return; } try { - RunBatch(batchType, workingDirectory, batch, isBeingDebugged); + RunBatch(locBatchType, workingDirectory, batch, isBeingDebugged); } catch (Exception e) { - _logger.LogError( - $"{_threadName}{batchType} batch caused exception, msg: \'{e.Message}\', executed command: \'{batch}\'"); + _logger.LogError(String.Format(Resources.RunBatchException, _threadName, locBatchType, e.Message, batch)); } } @@ -126,13 +129,11 @@ private void RunBatch(string batchType, string workingDirectory, string batch, b if (batchExitCode == 0) { - _logger.DebugInfo( - $"{_threadName}Successfully ran {batchType} batch \'{batch}\'"); + _logger.DebugInfo(String.Format(Resources.SuccessfullyRun, _threadName, batchType, batch)); } else { - _logger.LogWarning( - $"{_threadName}{batchType} batch returned exit code {batchExitCode}, executed command: \'{batch}\'"); + _logger.LogWarning(String.Format(Resources.BatchReturnedExitCode, _threadName, batchType, batchExitCode, batch)); } } diff --git a/GoogleTestAdapter/Core/Runners/SequentialTestRunner.cs b/GoogleTestAdapter/Core/Runners/SequentialTestRunner.cs index f6d78563e..6ba53b3b9 100644 --- a/GoogleTestAdapter/Core/Runners/SequentialTestRunner.cs +++ b/GoogleTestAdapter/Core/Runners/SequentialTestRunner.cs @@ -1,4 +1,4 @@ -// This file has been modified by Microsoft on 6/2017. +// This file has been modified by Microsoft on 8/2017. using System; using System.Collections.Generic; @@ -104,11 +104,11 @@ private void RunTestsFromExecutable(string executable, string workingDir, _frameworkReporter.ReportTestResults(results); stopwatch.Stop(); if (results.Length > 0) - _logger.DebugInfo($"{_threadName}Reported {results.Length} test results to VS, executable: '{executable}', duration: {stopwatch.Elapsed}"); + _logger.DebugInfo(String.Format(Resources.ReportedTestResults, _threadName, results.Length, executable, stopwatch.Elapsed)); } catch (TestRunCanceledException e) { - _logger.DebugInfo($"{_threadName}Execution has been canceled: {e.InnerException?.Message ?? e.Message}"); + _logger.DebugInfo(String.Format(Resources.ExecutionCancelled, _threadName, e.InnerException?.Message ?? e.Message)); Cancel(); } @@ -116,7 +116,7 @@ private void RunTestsFromExecutable(string executable, string workingDir, foreach (TestResult result in results) { if (!_schedulingAnalyzer.AddActualDuration(result.TestCase, (int)result.Duration.TotalMilliseconds)) - _logger.DebugWarning("TestCase already in analyzer: " + result.TestCase.FullyQualifiedName); + _logger.DebugWarning(String.Format(Resources.TestCaseInAnalyzer, result.TestCase.FullyQualifiedName)); } } } @@ -137,12 +137,10 @@ private IEnumerable RunTests(string executable, string workingDir, b public static void LogExecutionError(ILogger logger, string executable, string workingDir, string arguments, Exception exception, string threadName = "") { - logger.LogError($"{threadName}Failed to run test executable '{executable}': {exception.Message}"); - logger.DebugError($@"{threadName}Stacktrace:{Environment.NewLine}{exception.StackTrace}"); - logger.LogError( - $"{threadName}{Strings.Instance.TroubleShootingLink}"); - logger.LogError( - $"{threadName}In particular: launch command prompt, change into directory '{workingDir}', and execute the following command to make sure your tests can be run in general.{Environment.NewLine}{executable} {arguments}"); + logger.LogError(String.Format(Resources.RunExecutableError, threadName, executable, exception.Message)); + logger.DebugError(String.Format(Resources.StackTrace, threadName, Environment.NewLine, exception.StackTrace)); + logger.LogError($"{threadName}{Strings.Instance.TroubleShootingLink}"); + logger.LogError(String.Format(Resources.ExecuteSteps, threadName, workingDir, Environment.NewLine) + $"{executable} {arguments}"); } private IEnumerable TryRunTests(string executable, string workingDir, bool isBeingDebugged, @@ -181,8 +179,7 @@ private List RunTestExecutableWithNewFramework(string executable, string !_settings.ParallelTestExecution; if (printTestOutput) - _logger.LogInfo( - $"{_threadName}>>>>>>>>>>>>>>> Output of command '" + executable + " " + arguments.CommandLine + "'"); + _logger.LogInfo(String.Format(Resources.OutputOfCmdWithThreadInfo, _threadName, executable, arguments.CommandLine)); Action reportOutputAction = line => { @@ -196,7 +193,7 @@ private List RunTestExecutableWithNewFramework(string executable, string } catch (TestRunCanceledException e) { - _logger.DebugInfo($"{_threadName}Execution has been canceled: {e.InnerException?.Message ?? e.Message}"); + _logger.DebugInfo(String.Format(Resources.ExecutionCancelled, _threadName, e.InnerException?.Message ?? e.Message)); Cancel(); } }; @@ -207,16 +204,16 @@ private List RunTestExecutableWithNewFramework(string executable, string streamingParser.Flush(); if (printTestOutput) - _logger.LogInfo($"{_threadName}<<<<<<<<<<<<<<< End of Output"); + _logger.LogInfo(String.Format(Resources.EndOfOutputWithThreadInfo, _threadName)); var consoleOutput = new List(); new TestDurationSerializer().UpdateTestDurations(streamingParser.TestResults); - _logger.DebugInfo( - $"{_threadName}Reported {streamingParser.TestResults.Count} test results to VS during test execution, executable: '{executable}'"); + _logger.DebugInfo(String.Format(Resources.ReportedResultsToVS, _threadName, streamingParser.TestResults.Count, executable)); + foreach (TestResult result in streamingParser.TestResults) { if (!_schedulingAnalyzer.AddActualDuration(result.TestCase, (int) result.Duration.TotalMilliseconds)) - _logger.LogWarning($"{_threadName}TestCase already in analyzer: {result.TestCase.FullyQualifiedName}"); + _logger.LogWarning($"{_threadName}{String.Format(Resources.AlreadyInAnalyzer, result.TestCase.FullyQualifiedName)}"); } return consoleOutput; } diff --git a/GoogleTestAdapter/Core/Runners/TestResultCollector.cs b/GoogleTestAdapter/Core/Runners/TestResultCollector.cs index 3ac00fff5..ef5f19a01 100644 --- a/GoogleTestAdapter/Core/Runners/TestResultCollector.cs +++ b/GoogleTestAdapter/Core/Runners/TestResultCollector.cs @@ -1,3 +1,5 @@ +// This file has been modified by Microsoft on 8/2017. + using System; using System.Collections.Generic; using System.Linq; @@ -61,7 +63,7 @@ private void CollectResultsFromXmlFile(TestCase[] testCasesRun, string resultXml } if (nrOfCollectedTestResults > 0) _logger.DebugInfo( - $"{_threadName}Collected {nrOfCollectedTestResults} test results from result XML file {resultXmlFile}"); + String.Format(Resources.CollectedResults, _threadName, nrOfCollectedTestResults, resultXmlFile)); } private void CollectResultsFromConsoleOutput(StandardOutputTestResultParser consoleParser, List testResults) @@ -75,12 +77,12 @@ private void CollectResultsFromConsoleOutput(StandardOutputTestResultParser cons nrOfCollectedTestResults++; } if (nrOfCollectedTestResults > 0) - _logger.DebugInfo($"{_threadName}Collected {nrOfCollectedTestResults} test results from console output"); + _logger.DebugInfo($"{_threadName}{String.Format(Resources.CollectedResultsFromConsole, nrOfCollectedTestResults)}"); } private void CreateMissingResults(TestCase[] testCases, TestCase crashedTestCase, List testResults) { - var errorMessage = $"reason is probably a crash of test {crashedTestCase.DisplayName}"; + var errorMessage = String.Format(Resources.CrashTest, crashedTestCase.DisplayName); var errorStackTrace = ErrorMessageParser.CreateStackTraceEntry("crash suspect", crashedTestCase.CodeFilePath, crashedTestCase.LineNumber.ToString()); @@ -95,14 +97,14 @@ private void CreateMissingResults(TestCase[] testCases, TestCase crashedTestCase }); } if (testCases.Length > 0) - _logger.DebugInfo($"{_threadName}Created {testCases.Length} test results for tests which were neither found in result XML file nor in console output"); + _logger.DebugInfo($"{_threadName}{String.Format(Resources.CreatedTestResults, testCases.Length)}"); } private void ReportSuspiciousTestCases(TestCase[] testCases) { string testCasesAsString = string.Join(Environment.NewLine, testCases.Select(tc => tc.DisplayName)); _logger.DebugWarning( - $"{_threadName}{testCases.Length} test cases seem to not have been run - are you repeating a test run, but tests have changed in the meantime? Test cases:{Environment.NewLine}{testCasesAsString}"); + $"{_threadName}{String.Format(Resources.TestCaseNotRun, testCases.Length, Environment.NewLine)}{testCasesAsString}"); } } diff --git a/GoogleTestAdapter/Core/Scheduling/SchedulingAnalyzer.cs b/GoogleTestAdapter/Core/Scheduling/SchedulingAnalyzer.cs index 7986ee279..5b709b02b 100644 --- a/GoogleTestAdapter/Core/Scheduling/SchedulingAnalyzer.cs +++ b/GoogleTestAdapter/Core/Scheduling/SchedulingAnalyzer.cs @@ -1,4 +1,6 @@ -using System; +// This file has been modified by Microsoft on 8/2017. + +using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Globalization; @@ -39,12 +41,12 @@ public bool AddActualDuration(TestCase testCase, int duration) public void PrintStatisticsToDebugOutput() { - _logger.DebugInfo(">>> Scheduling statistics <<<"); - _logger.DebugInfo($"# of expected test case durations: {ExpectedTestcaseDurations.Count}"); - _logger.DebugInfo($"# of actual test case durations: {ActualTestcaseDurations.Count}"); + _logger.DebugInfo(Resources.SchedulingStats); + _logger.DebugInfo(String.Format(Resources.ExpectedTestCase, ExpectedTestcaseDurations.Count)); + _logger.DebugInfo(String.Format(Resources.ActualTestCase, ActualTestcaseDurations.Count)); if (ExpectedTestcaseDurations.Count == 0 || ActualTestcaseDurations.Count == 0) { - _logger.DebugInfo("Nothing to report."); + _logger.DebugInfo(Resources.NothingToReport); return; } @@ -63,15 +65,15 @@ public void PrintStatisticsToDebugOutput() double sumOfSquaresOfDifferences = differences.Select(d => (d.DifferenceInMs - avgDifference) * (d.DifferenceInMs - avgDifference)).Sum(); double standardDeviation = Math.Sqrt(sumOfSquaresOfDifferences / differences.Count); - _logger.DebugInfo($"{differences.Count} expected durations have been found in actual durations"); - _logger.DebugInfo($"Avg difference between expected and actual duration: {avgDifference.ToString("F1", CultureInfo.InvariantCulture)}ms"); - _logger.DebugInfo($"Standard deviation: {standardDeviation.ToString("F1", CultureInfo.InvariantCulture)}ms"); + _logger.DebugInfo(String.Format(Resources.ExpectedDurations, differences.Count)); + _logger.DebugInfo(String.Format(Resources.AvgDifference, avgDifference.ToString("F1", CultureInfo.InvariantCulture))); + _logger.DebugInfo(String.Format(Resources.StandardDeviation, standardDeviation.ToString("F1", CultureInfo.InvariantCulture))); int nrOfWorstDifferences = Math.Min(10, differences.Count); - _logger.DebugInfo($"{nrOfWorstDifferences} worst differences:"); + _logger.DebugInfo(String.Format(Resources.WorstDifferences, nrOfWorstDifferences)); for (int i = 0; i < nrOfWorstDifferences; i++) { - _logger.DebugInfo($"Test {differences[i].TestCase.FullyQualifiedName}: Expected {ExpectedTestcaseDurations[differences[i].TestCase]}ms, actual {ActualTestcaseDurations[differences[i].TestCase]}ms"); + _logger.DebugInfo(String.Format(Resources.Results, differences[i].TestCase.FullyQualifiedName, ExpectedTestcaseDurations[differences[i].TestCase], ActualTestcaseDurations[differences[i].TestCase])); } } diff --git a/GoogleTestAdapter/Core/Scheduling/TestDurationSerializer.cs b/GoogleTestAdapter/Core/Scheduling/TestDurationSerializer.cs index f565356ec..069b91519 100644 --- a/GoogleTestAdapter/Core/Scheduling/TestDurationSerializer.cs +++ b/GoogleTestAdapter/Core/Scheduling/TestDurationSerializer.cs @@ -1,4 +1,4 @@ -// This file has been modified by Microsoft on 6/2017. +// This file has been modified by Microsoft on 8/2017. using GoogleTestAdapter.Helpers; using GoogleTestAdapter.Model; @@ -163,7 +163,7 @@ private GtaTestDurations LoadTestDurations(string durationsFile) } catch (InvalidOperationException e) when (e.InnerException is XmlSchemaValidationException) { - throw new InvalidTestDurationsException($"Invalid file {durationsFile}. {e.InnerException.Message}", e.InnerException); + throw new InvalidTestDurationsException(String.Format(Resources.InvalidFile, durationsFile, e.InnerException.Message), e.InnerException); } } } diff --git a/GoogleTestAdapter/Core/Settings/SettingsWrapper.cs b/GoogleTestAdapter/Core/Settings/SettingsWrapper.cs index 97eb2329e..adebf8b65 100644 --- a/GoogleTestAdapter/Core/Settings/SettingsWrapper.cs +++ b/GoogleTestAdapter/Core/Settings/SettingsWrapper.cs @@ -1,4 +1,4 @@ -// This file has been modified by Microsoft on 7/2017. +// This file has been modified by Microsoft on 8/2017. using System; using System.Collections.Generic; @@ -88,13 +88,13 @@ public void ExecuteWithSettingsForExecutable(string executable, Action action, I _currentSettings = projectSettings; string settingsString = ToString(); _currentSettings = _settingsContainer.SolutionSettings; - logger.DebugInfo($"Settings for test executable '{executable}': {settingsString}"); + logger.DebugInfo(String.Format(Resources.SettingsMessage, executable, settingsString)); _currentSettings = projectSettings; } else { - logger.DebugInfo($"No settings configured for test executable '{executable}'; running with solution settings: {this}"); + logger.DebugInfo(String.Format(Resources.NoSettingConfigured, executable, this)); } } @@ -116,7 +116,7 @@ public void ExecuteWithSettingsForExecutable(string executable, Action action, I if (_currentSettings != _settingsContainer.SolutionSettings) { _currentSettings = _settingsContainer.SolutionSettings; - logger.DebugInfo($"Back to solution settings: {this}"); + logger.DebugInfo(String.Format(Resources.BacktoSolution, this)); } } } @@ -129,15 +129,13 @@ public virtual void CheckCorrectUsage(string executable) if (_nrOfRunningExecutions == 0) return; if (_nrOfRunningExecutions < 0) - throw new InvalidOperationException($"{nameof(_nrOfRunningExecutions)} must never be < 0"); + throw new InvalidOperationException(String.Format(Resources.NeverBeZero, nameof(_nrOfRunningExecutions))); if (_currentThread != Thread.CurrentThread) - throw new InvalidOperationException( - $"SettingsWrapper is already running with settings for an executable on thread '{_currentThread.Name}', can not also be used by thread {Thread.CurrentThread.Name}"); + throw new InvalidOperationException(String.Format(Resources.SettingsWrapperString, _currentThread.Name, Thread.CurrentThread.Name)); if (executable != _currentExecutable) - throw new InvalidOperationException( - $"Execution is already running with settings for executable {_currentExecutable}, can not switch to settings for {executable}"); + throw new InvalidOperationException(String.Format(Resources.ExecutionString, _currentExecutable, executable)); } public override string ToString() diff --git a/GoogleTestAdapter/Core/TestCases/MethodSignatureCreator.cs b/GoogleTestAdapter/Core/TestCases/MethodSignatureCreator.cs index 6fec42a4c..73e447699 100644 --- a/GoogleTestAdapter/Core/TestCases/MethodSignatureCreator.cs +++ b/GoogleTestAdapter/Core/TestCases/MethodSignatureCreator.cs @@ -1,4 +1,6 @@ -using System; +// This file has been modified by Microsoft on 8/2017. + +using System; using System.Collections.Generic; using GoogleTestAdapter.Helpers; @@ -19,7 +21,7 @@ internal IEnumerable GetTestMethodSignatures(TestCaseDescriptor descript case TestCaseDescriptor.TestTypes.Simple: return GetTestMethodSignature(descriptor.Suite, descriptor.Name).Yield(); default: - throw new InvalidOperationException($"Unknown literal {descriptor.TestType}"); + throw new InvalidOperationException($"{Resources.UnknownLiteral} {descriptor.TestType}"); } } diff --git a/GoogleTestAdapter/Core/TestCases/NewTestCaseResolver.cs b/GoogleTestAdapter/Core/TestCases/NewTestCaseResolver.cs index a128fe4ea..9a937c24a 100644 --- a/GoogleTestAdapter/Core/TestCases/NewTestCaseResolver.cs +++ b/GoogleTestAdapter/Core/TestCases/NewTestCaseResolver.cs @@ -1,4 +1,6 @@ -using System; +// This file has been modified by Microsoft on 8/2017. + +using System; using System.Collections.Generic; using System.IO; using System.Linq; @@ -73,11 +75,11 @@ private void AddSymbolsFromBinary(string binary) _allTestMethodSymbols.AddRange(diaResolver.GetFunctions("*" + GoogleTestConstants.TestBodySignature)); _allTraitSymbols.AddRange(diaResolver.GetFunctions("*" + TraitAppendix)); - _logger.DebugInfo($"Found {_allTestMethodSymbols.Count} test method symbols and {_allTraitSymbols.Count} trait symbols in binary {binary}"); + _logger.DebugInfo(String.Format(Resources.FoundTestMethod, _allTestMethodSymbols.Count, _allTraitSymbols.Count, binary)); } catch (Exception e) { - _logger.DebugError($"Exception while resolving test locations and traits in {binary}\n{e}"); + _logger.DebugError(String.Format(Resources.ExceptionResolving, binary, e)); } } } diff --git a/GoogleTestAdapter/Core/TestCases/TestCaseFactory.cs b/GoogleTestAdapter/Core/TestCases/TestCaseFactory.cs index fb15aa08d..953e0a6cd 100644 --- a/GoogleTestAdapter/Core/TestCases/TestCaseFactory.cs +++ b/GoogleTestAdapter/Core/TestCases/TestCaseFactory.cs @@ -1,4 +1,4 @@ -// This file has been modified by Microsoft on 7/2017. +// This file has been modified by Microsoft on 8/2017. using System; using System.Collections.Generic; @@ -152,9 +152,9 @@ private IList NewCreateTestcases(Action reportTestCase, List string cdToWorkingDir = $@"cd ""{dir}"""; string listTestsCommand = $"{file} {GoogleTestConstants.ListTestsOption.Trim()}"; - _logger.LogError($"Test discovery was cancelled after {_settings.TestDiscoveryTimeoutInSeconds}s for executable {_executable}"); - _logger.DebugError($"Test whether the following commands can be executed sucessfully on the command line (make sure all required binaries are on the PATH):{Environment.NewLine}{cdToWorkingDir}{Environment.NewLine}{listTestsCommand}"); - + _logger.LogError(String.Format(Resources.TestDiscoveryCancelled, _settings.TestDiscoveryTimeoutInSeconds, _executable)); + _logger.DebugError($"{Resources.TestCommandCanBeRun}{Environment.NewLine}{cdToWorkingDir}{Environment.NewLine}{listTestsCommand}"); + return new List(); } @@ -183,14 +183,12 @@ private bool CheckProcessExitCode(int processExitCode, ICollection stand { if (processExitCode != 0) { - string messsage = - $"Could not list test cases of executable '{_executable}': executing process failed with return code {processExitCode}"; - messsage += - $"\nCommand executed: '{_executable} {GoogleTestConstants.ListTestsOption.Trim()}', working directory: '{Path.GetDirectoryName(_executable)}'"; + string messsage = String.Format(Resources.ProcessFailed, _executable, processExitCode); + messsage += Environment.NewLine + String.Format(Resources.CommandExecuted, _executable, GoogleTestConstants.ListTestsOption.Trim(), Path.GetDirectoryName(_executable)); if (standardOutput.Count(s => !string.IsNullOrEmpty(s)) > 0) - messsage += $"\nOutput of command:\n{string.Join("\n", standardOutput)}"; + messsage += Environment.NewLine + Resources.OutputOfCommand + ":" + Environment.NewLine + string.Join(Environment.NewLine, standardOutput); else - messsage += "\nCommand produced no output"; + messsage += Environment.NewLine + Resources.NoOutput; _logger.LogError(messsage); return false; @@ -244,7 +242,7 @@ private TestCase CreateTestCase(TestCaseDescriptor descriptor, TestCaseLocation return testCase; } - _logger.LogWarning($"Could not find source location for test {descriptor.FullyQualifiedName}"); + _logger.LogWarning(String.Format(Resources.LocationNotFoundError, descriptor.FullyQualifiedName)); return new TestCase( descriptor.FullyQualifiedName, _executable, descriptor.DisplayName, "", 0); } diff --git a/GoogleTestAdapter/Core/TestCases/TestCaseResolver.cs b/GoogleTestAdapter/Core/TestCases/TestCaseResolver.cs index 3c4f8ba14..7de4f0659 100644 --- a/GoogleTestAdapter/Core/TestCases/TestCaseResolver.cs +++ b/GoogleTestAdapter/Core/TestCases/TestCaseResolver.cs @@ -1,4 +1,4 @@ -// This file has been modified by Microsoft on 7/2017. +// This file has been modified by Microsoft on 8/2017. using System; using System.Collections.Generic; @@ -62,7 +62,7 @@ private Dictionary FindTestCaseLocationsInBinary( { IList allTestMethodSymbols = diaResolver.GetFunctions(symbolFilterString); IList allTraitSymbols = diaResolver.GetFunctions("*" + TraitAppendix); - _logger.DebugInfo($"Found {allTestMethodSymbols.Count} test method symbols and {allTraitSymbols.Count} trait symbols in binary {binary}"); + _logger.DebugInfo(String.Format(Resources.FoundTestMethod, allTestMethodSymbols.Count, allTraitSymbols.Count, binary)); return allTestMethodSymbols .Where(nsfl => testMethodSignatures.Contains(TestCaseFactory.StripTestSymbolNamespace(nsfl.Symbol))) @@ -71,7 +71,7 @@ private Dictionary FindTestCaseLocationsInBinary( } catch (Exception e) { - _logger.DebugError($"Exception while resolving test locations and traits in {binary}\n{e}"); + _logger.DebugError(String.Format(Resources.ExceptionResolving, binary, e)); return new Dictionary(); } } diff --git a/GoogleTestAdapter/Core/TestResults/StandardOutputTestResultParser.cs b/GoogleTestAdapter/Core/TestResults/StandardOutputTestResultParser.cs index b6a75cdf7..15c4b79f8 100644 --- a/GoogleTestAdapter/Core/TestResults/StandardOutputTestResultParser.cs +++ b/GoogleTestAdapter/Core/TestResults/StandardOutputTestResultParser.cs @@ -1,4 +1,6 @@ -using System; +// This file has been modified by Microsoft on 8/2017. + +using System; using System.Collections.Generic; using System.Globalization; using System.Linq; @@ -61,7 +63,7 @@ private TestResult CreateTestResult(int indexOfTestcase) TestCase testCase = FindTestcase(qualifiedTestname); if (testCase == null) { - _logger.DebugWarning($"No known test case for test result of line '{line}' - are you repeating a test run, but tests have changed in the meantime?"); + _logger.DebugWarning(String.Format(Resources.NoKnownTestCaseMessage, line)); return null; } @@ -136,7 +138,7 @@ public static TimeSpan ParseDuration(string line, ILogger logger) } catch (Exception) { - logger.LogWarning("Could not parse duration in line '" + line + "'"); + logger.LogWarning(String.Format(Resources.ParseDurationMessage, line)); } return NormalizeDuration(TimeSpan.FromMilliseconds(durationInMs)); diff --git a/GoogleTestAdapter/Core/TestResults/StreamingStandardOutputTestResultParser.cs b/GoogleTestAdapter/Core/TestResults/StreamingStandardOutputTestResultParser.cs index ac24f08d0..e4bdc5526 100644 --- a/GoogleTestAdapter/Core/TestResults/StreamingStandardOutputTestResultParser.cs +++ b/GoogleTestAdapter/Core/TestResults/StreamingStandardOutputTestResultParser.cs @@ -1,4 +1,6 @@ -using System; +// This file has been modified by Microsoft on 8/2017. + +using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; @@ -111,7 +113,7 @@ private TestResult CreateTestResult() TestCase testCase = StandardOutputTestResultParser.FindTestcase(qualifiedTestname, _testCasesRun); if (testCase == null) { - _logger.DebugWarning($"No known test case for test result of line '{line}'' - are you repeating a test run, but tests have changed in the meantime?"); + _logger.DebugWarning(String.Format(Resources.NoKnownTestCaseMessage, line)); return null; } diff --git a/GoogleTestAdapter/Core/TestResults/XmlTestResultParser.cs b/GoogleTestAdapter/Core/TestResults/XmlTestResultParser.cs index 7fc2ddc8b..70744539a 100644 --- a/GoogleTestAdapter/Core/TestResults/XmlTestResultParser.cs +++ b/GoogleTestAdapter/Core/TestResults/XmlTestResultParser.cs @@ -1,4 +1,4 @@ -// This file has been modified by Microsoft on 6/2017. +// This file has been modified by Microsoft on 8/2017. using System; using System.Collections.Generic; @@ -14,8 +14,6 @@ namespace GoogleTestAdapter.TestResults { public class XmlTestResultParser { - private const string ErrorMsgNoXmlFile = "Output file does not exist, did your tests crash?"; - private static readonly NumberFormatInfo NumberFormatInfo = new CultureInfo("en-US").NumberFormat; @@ -39,7 +37,7 @@ public List GetTestResults() return ParseTestResults(); } - _logger.LogWarning(ErrorMsgNoXmlFile); + _logger.LogWarning(Resources.OutputFileMissing); return new List(); } @@ -72,8 +70,7 @@ private List ParseTestResults() } catch (XmlException e) { - _logger.DebugWarning( - $"Test result file {_xmlResultFile} could not be parsed (completely) - your test executable has probably crashed. Exception message: {e.Message}"); + _logger.DebugWarning(String.Format(Resources.TestResultParse, _xmlResultFile, e.Message)); } return testResults; @@ -87,8 +84,7 @@ private TestResult TryParseTestResult(XmlNode testcaseNode) } catch (Exception e) { - _logger.DebugWarning( - $"XmlNode could not be parsed: \'{GetQualifiedName(testcaseNode)}\'. Exception message: {e.Message}"); + _logger.DebugWarning(String.Format(Resources.XmlNodeParse, GetQualifiedName(testcaseNode), e.Message)); return null; } } @@ -133,7 +129,7 @@ private TestResult ParseTestResult(XmlNode testcaseNode) testResult.Outcome = TestOutcome.Skipped; break; default: - string msg = "Unknown testcase status: " + testCaseStatus; + string msg = String.Format(Resources.UnknownTestCase, testCaseStatus); _logger.LogError(msg); throw new Exception(msg); } diff --git a/GoogleTestAdapter/DiaResolver.Tests/DiaResolverTests.cs b/GoogleTestAdapter/DiaResolver.Tests/DiaResolverTests.cs index 4a9afec2f..bb9fe6ba5 100644 --- a/GoogleTestAdapter/DiaResolver.Tests/DiaResolverTests.cs +++ b/GoogleTestAdapter/DiaResolver.Tests/DiaResolverTests.cs @@ -1,4 +1,6 @@ -using System.Collections.Generic; +// This file has been modified by Microsoft on 8/2017. + +using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.IO; using FluentAssertions; @@ -100,7 +102,7 @@ public void GetFunctions_ExeWithoutPdb_AttemptsToFindPdbAreLogged() .Contain(msg => msg.Contains("Couldn't find the .pdb file")); fakeLogger.Infos .Should() - .Contain(msg => msg.Contains("Attempts to find pdb:")); + .Contain(msg => msg.Contains("Attempts to find PDB")); } private void DoResolveTest(string executable, string filter, int expectedLocations, int expectedErrorMessages, bool disposeResolver = true) diff --git a/GoogleTestAdapter/DiaResolver/DiaFactory.cs b/GoogleTestAdapter/DiaResolver/DiaFactory.cs index f9f8460d4..4e8753e8f 100644 --- a/GoogleTestAdapter/DiaResolver/DiaFactory.cs +++ b/GoogleTestAdapter/DiaResolver/DiaFactory.cs @@ -19,7 +19,7 @@ static DiaFactory() string path = Path.Combine(GetAssemblyBaseDir(), Is32Bit() ? "x86" : "x64", DiaDll); var ptrDll = LoadLibrary(path); if (ptrDll == IntPtr.Zero) - throw new Exception($"Cannot load {path}."); + throw new Exception(String.Format(Resources.LoadError, path)); } public static IDiaDataSource CreateInstance() diff --git a/GoogleTestAdapter/DiaResolver/DiaResolver.cs b/GoogleTestAdapter/DiaResolver/DiaResolver.cs index fd2b4dac6..e255dd7f9 100644 --- a/GoogleTestAdapter/DiaResolver/DiaResolver.cs +++ b/GoogleTestAdapter/DiaResolver/DiaResolver.cs @@ -1,4 +1,4 @@ -// This file has been modified by Microsoft on 6/2017. +// This file has been modified by Microsoft on 8/2017. using GoogleTestAdapter.Common; using Microsoft.Dia; @@ -53,17 +53,17 @@ internal DiaResolver(string binary, string pathExtension, ILogger logger) string pdb = FindPdbFile(binary, pathExtension); if (pdb == null) { - _logger.LogWarning($"Couldn't find the .pdb file of file '{binary}'. You will not get any source locations for your tests."); + _logger.LogWarning(String.Format(Resources.PdbFileNotFoundError, binary)); return; } if (!TryCreateDiaInstance()) { - _logger.LogError("Couldn't find the msdia.dll to parse *.pdb files. You will not get any source locations for your tests."); + _logger.LogError(Resources.msdiaError); return; } - _logger.DebugInfo($"Parsing pdb file \"{pdb}\""); + _logger.DebugInfo(String.Format(Resources.ParsingFile, pdb)); _fileStream = File.Open(pdb, FileMode.Open, FileAccess.Read, FileShare.Read); _diaDataSource.loadDataFromIStream(new DiaMemoryStream(_fileStream)); @@ -120,7 +120,7 @@ private string FindPdbFile(string binary, string pathExtension) } } - _logger.DebugInfo("Attempts to find pdb: " + string.Join("::", attempts)); + _logger.DebugInfo(String.Format(Resources.AttemptsToFind, string.Join("::", attempts))); return null; } @@ -147,7 +147,7 @@ private SourceFileLocation ToSourceFileLocation(NativeSourceFileLocation nativeS IDiaEnumLineNumbers lineNumbers = GetLineNumbers(nativeSymbol.AddressSection, nativeSymbol.AddressOffset, nativeSymbol.Length); if (lineNumbers.count <= 0) { - _logger.LogWarning("Failed to locate line number for " + nativeSymbol); + _logger.LogWarning(String.Format(Resources.LineNumberError, nativeSymbol)); return new SourceFileLocation(_binary, "", 0); } @@ -186,8 +186,8 @@ private IDiaEnumSymbols FindFunctionsByRegex(string pattern) catch (NotImplementedException) { // https://developercommunity.visualstudio.com/content/problem/4631/dia-sdk-still-doesnt-support-debugfastlink.html - _logger.LogWarning("In order to get source locations for your tests, please ensure to generate *full* PDBs for your test executables."); - _logger.LogWarning("Use linker option /DEBUG:FULL (VS2017) or /DEBUG (VS2015 and older) - do not use /DEBUG:FASTLINK!"); + _logger.LogWarning(Resources.GenerateFullPDBMessage); + _logger.LogWarning(Resources.UseLinkerOption); } return result; } diff --git a/GoogleTestAdapter/DiaResolver/DiaResolver.csproj b/GoogleTestAdapter/DiaResolver/DiaResolver.csproj index a623939ae..c0971b948 100644 --- a/GoogleTestAdapter/DiaResolver/DiaResolver.csproj +++ b/GoogleTestAdapter/DiaResolver/DiaResolver.csproj @@ -66,6 +66,11 @@ + + True + True + Resources.resx + @@ -85,6 +90,12 @@ PreserveNewest + + + ResXFileCodeGenerator + Resources.Designer.cs + + diff --git a/GoogleTestAdapter/DiaResolver/PeParser.cs b/GoogleTestAdapter/DiaResolver/PeParser.cs index 1a1104417..0b19215d6 100644 --- a/GoogleTestAdapter/DiaResolver/PeParser.cs +++ b/GoogleTestAdapter/DiaResolver/PeParser.cs @@ -1,4 +1,6 @@ -using System; +// This file has been modified by Microsoft on 8/2017. + +using System; using System.Collections.Generic; using System.Runtime.InteropServices; using GoogleTestAdapter.Common; @@ -127,7 +129,7 @@ private static void ParsePeFile(string executable, ILogger logger, Action +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace GoogleTestAdapter.DiaResolver { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GoogleTestAdapter.DiaResolver.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Attempts to find PDB {0}. + /// + internal static string AttemptsToFind { + get { + return ResourceManager.GetString("AttemptsToFind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to In order to get source locations for your tests, please ensure to generate *full* PDBs for your test executables.. + /// + internal static string GenerateFullPDBMessage { + get { + return ResourceManager.GetString("GenerateFullPDBMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Failed to locate line number for {0}. + /// + internal static string LineNumberError { + get { + return ResourceManager.GetString("LineNumberError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot load {0}.. + /// + internal static string LoadError { + get { + return ResourceManager.GetString("LoadError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Couldn't find the msdia.dll to parse *.pdb files. You will not get any source locations for your tests.. + /// + internal static string msdiaError { + get { + return ResourceManager.GetString("msdiaError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parsing PDB file {0}. + /// + internal static string ParsingFile { + get { + return ResourceManager.GetString("ParsingFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Couldn't find the .pdb file of file '{0}'. You will not get any source locations for your tests.. + /// + internal static string PdbFileNotFoundError { + get { + return ResourceManager.GetString("PdbFileNotFoundError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to UnMapAndLoad failed!. + /// + internal static string UnMapLoad { + get { + return ResourceManager.GetString("UnMapLoad", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Use linker option /DEBUG:FULL (Visual Studio 2017) or /DEBUG (Visual Studio 2015 and older) - do not use /DEBUG:FASTLINK!. + /// + internal static string UseLinkerOption { + get { + return ResourceManager.GetString("UseLinkerOption", resourceCulture); + } + } + } +} diff --git a/GoogleTestAdapter/DiaResolver/Resources.resx b/GoogleTestAdapter/DiaResolver/Resources.resx new file mode 100644 index 000000000..1019a2f4f --- /dev/null +++ b/GoogleTestAdapter/DiaResolver/Resources.resx @@ -0,0 +1,152 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + In order to get source locations for your tests, please ensure to generate *full* PDBs for your test executables. + + + Failed to locate line number for {0} + {0} represents an unlocalized symbol name (e.g. "foo") + + + Couldn't find the msdia.dll to parse *.pdb files. You will not get any source locations for your tests. + + + Couldn't find the .pdb file of file '{0}'. You will not get any source locations for your tests. + {0} represents unlocalized file path (e.g c:\test\foo.exe) + + + Use linker option /DEBUG:FULL (Visual Studio 2017) or /DEBUG (Visual Studio 2015 and older) - do not use /DEBUG:FASTLINK! + + + UnMapAndLoad failed! + + + Attempts to find PDB {0} + {0} represents unlocalized file path (e.g c:\test\foo.pdb) + + + Parsing PDB file {0} + {0} represents unlocalized file path (e.g c:\test\foo.pdb) + + + Cannot load {0}. + {0} represents unlocalized file path (e.g c:\test\foo.pdb) + + \ No newline at end of file diff --git a/GoogleTestAdapter/TestAdapter.Tests/TestDiscovererTests.cs b/GoogleTestAdapter/TestAdapter.Tests/TestDiscovererTests.cs index 14d4d71e5..a7e240953 100644 --- a/GoogleTestAdapter/TestAdapter.Tests/TestDiscovererTests.cs +++ b/GoogleTestAdapter/TestAdapter.Tests/TestDiscovererTests.cs @@ -1,4 +1,4 @@ -// This file has been modified by Microsoft on 7/2017. +// This file has been modified by Microsoft on 8/2017. using FluentAssertions; using GoogleTestAdapter.Helpers; @@ -40,7 +40,7 @@ public void DiscoverTests_WithCustomNonMatchingRegex_DoesNotFindTests() public void DiscoverTests_CrashingExecutable_CrashIsLogged() { RunExecutableAndCheckLogging(TestResources.AlwaysCrashingExe, - () => MockLogger.Verify(l => l.LogError(It.Is(s => s.Contains("Could not list test cases of executable"))), + () => MockLogger.Verify(l => l.LogError(It.Is(s => s.Contains("Could not list test cases for executable"))), Times.Once)); } @@ -49,7 +49,7 @@ public void DiscoverTests_CrashingExecutable_CrashIsLogged() public void DiscoverTests_FailingExecutable_ExitCodeIsLogged() { RunExecutableAndCheckLogging(TestResources.AlwaysFailingExe, - () => MockLogger.Verify(l => l.LogError(It.Is(s => s.Contains("executing process failed with return code 4711"))), + () => MockLogger.Verify(l => l.LogError(It.Is(s => s.Contains("process execution failed with exit code 4711"))), Times.Once)); } @@ -85,7 +85,7 @@ public void DiscoverTests_UntrustedExecutable_IsNotRun() File.Copy(TestResources.SemaphoreExe, Temp1Exe); File.Exists(SemPath).Should().BeFalse(); RunExecutableAndCheckLogging(Temp1Exe, - () => MockLogger.Verify(l => l.LogError(It.Is(s => s.Contains("executing process failed with return code 143"))), + () => MockLogger.Verify(l => l.LogError(It.Is(s => s.Contains("process execution failed with exit code 143"))), Times.Once)); File.Exists(SemPath).Should().BeTrue("because exe should have been run"); } diff --git a/GoogleTestAdapter/TestAdapter.Tests/TestExecutorTestsBase.cs b/GoogleTestAdapter/TestAdapter.Tests/TestExecutorTestsBase.cs index ff92c6e84..3dc72528a 100644 --- a/GoogleTestAdapter/TestAdapter.Tests/TestExecutorTestsBase.cs +++ b/GoogleTestAdapter/TestAdapter.Tests/TestExecutorTestsBase.cs @@ -17,8 +17,9 @@ namespace GoogleTestAdapter.TestAdapter { public abstract class TestExecutorTestsBase : TestAdapterTestsBase { + private const string TestSetup = "Test setup"; + private const string TestTeardown = "Test teardown"; private readonly bool _parallelTestExecution; - private readonly int _maxNrOfThreads; @@ -147,10 +148,10 @@ public virtual void RunTests_WithSetupAndTeardownBatchesWhereTeardownFails_LogsW RunAndVerifyTests(TestResources.DllTests_ReleaseX86, 1, 1, 0); MockLogger.Verify(l => l.LogWarning( - It.Is(s => s.Contains(PreparingTestRunner.TestSetup))), + It.Is(s => s.Contains(TestSetup))), Times.Never); MockLogger.Verify(l => l.LogWarning( - It.Is(s => s.Contains(PreparingTestRunner.TestTeardown))), + It.Is(s => s.Contains(TestTeardown))), Times.AtLeastOnce()); } @@ -164,10 +165,10 @@ public virtual void RunTests_WithSetupAndTeardownBatchesWhereSetupFails_LogsWarn RunAndVerifyTests(TestResources.DllTests_ReleaseX86, 1, 1, 0); MockLogger.Verify(l => l.LogWarning( - It.Is(s => s.Contains(PreparingTestRunner.TestSetup))), + It.Is(s => s.Contains(TestSetup))), Times.AtLeastOnce()); MockLogger.Verify(l => l.LogWarning( - It.Is(s => s.Contains(PreparingTestRunner.TestTeardown))), + It.Is(s => s.Contains(TestTeardown))), Times.Never); } @@ -178,22 +179,22 @@ public virtual void RunTests_WithoutBatches_NoLogging() RunAndVerifyTests(TestResources.DllTests_ReleaseX86, 1, 1, 0); MockLogger.Verify(l => l.LogInfo( - It.Is(s => s.Contains(PreparingTestRunner.TestSetup))), + It.Is(s => s.Contains(TestSetup))), Times.Never); MockLogger.Verify(l => l.LogWarning( - It.Is(s => s.Contains(PreparingTestRunner.TestSetup))), + It.Is(s => s.Contains(TestSetup))), Times.Never); MockLogger.Verify(l => l.LogError( - It.Is(s => s.Contains(PreparingTestRunner.TestSetup))), + It.Is(s => s.Contains(TestSetup))), Times.Never); MockLogger.Verify(l => l.LogInfo( - It.Is(s => s.Contains(PreparingTestRunner.TestTeardown))), + It.Is(s => s.Contains(TestTeardown))), Times.Never); MockLogger.Verify(l => l.LogWarning( - It.Is(s => s.Contains(PreparingTestRunner.TestTeardown))), + It.Is(s => s.Contains(TestTeardown))), Times.Never); MockLogger.Verify(l => l.LogError( - It.Is(s => s.Contains(PreparingTestRunner.TestTeardown))), + It.Is(s => s.Contains(TestTeardown))), Times.Never); } @@ -206,7 +207,7 @@ public virtual void RunTests_WithNonexistingSetupBatch_LogsError() RunAndVerifyTests(TestResources.DllTests_ReleaseX86, 1, 1, 0); MockLogger.Verify(l => l.LogError( - It.Is(s => s.Contains(PreparingTestRunner.TestSetup.ToLower()))), + It.Is(s => s.Contains(TestSetup.ToLower()))), Times.AtLeastOnce()); } diff --git a/GoogleTestAdapter/TestAdapter/CommonFunctions.cs b/GoogleTestAdapter/TestAdapter/CommonFunctions.cs index f9fd74be0..e0d119577 100644 --- a/GoogleTestAdapter/TestAdapter/CommonFunctions.cs +++ b/GoogleTestAdapter/TestAdapter/CommonFunctions.cs @@ -1,4 +1,6 @@ -using System; +// This file has been modified by Microsoft on 8/2017. + +using System; using System.Collections.Generic; using GoogleTestAdapter.Common; using GoogleTestAdapter.Helpers; @@ -12,8 +14,9 @@ namespace GoogleTestAdapter.TestAdapter { public static class CommonFunctions { - public static void ReportErrors(ILogger logger, string phase, bool isDebugModeEnabled) + public static void ReportErrors(ILogger logger, TestPhase phase, bool isDebugModeEnabled) { + string phaseType = (phase == TestPhase.TestDiscovery) ? Resources.TestDiscovery: Resources.TestExecution; IList errors = logger.GetMessages(Severity.Error, Severity.Warning); if (errors.Count == 0) return; @@ -21,11 +24,11 @@ public static void ReportErrors(ILogger logger, string phase, bool isDebugModeEn bool hasErrors = logger.GetMessages(Severity.Error).Count > 0; string hint = isDebugModeEnabled ? "" - : " (enable debug mode for more information)"; + : Resources.EnableDebugMode; string jointErrors = string.Join(Environment.NewLine, errors); - string message = $"{Environment.NewLine}================{Environment.NewLine}" - + $"The following errors and warnings occured during {phase}{hint}:{Environment.NewLine}" + string message = $"{Environment.NewLine}================{Environment.NewLine}" + + String.Format(Resources.ErrorAndWarning, phaseType, hint, Environment.NewLine) + jointErrors; if (hasErrors) @@ -64,7 +67,7 @@ public static void LogVisualStudioVersion(ILogger logger) case VsVersion.VS2012: return; default: - logger.DebugInfo($"Visual Studio Version: {version}"); + logger.DebugInfo(String.Format(Resources.VSVersion, version)); break; } } diff --git a/GoogleTestAdapter/TestAdapter/DataConversionExtensions.cs b/GoogleTestAdapter/TestAdapter/DataConversionExtensions.cs index 661b1f504..cbf7eebe3 100644 --- a/GoogleTestAdapter/TestAdapter/DataConversionExtensions.cs +++ b/GoogleTestAdapter/TestAdapter/DataConversionExtensions.cs @@ -1,4 +1,6 @@ -using System; +// This file has been modified by Microsoft on 8/2017. + +using System; using System.Linq; using GoogleTestAdapter.Common; using GoogleTestAdapter.Model; @@ -113,7 +115,7 @@ public static Severity GetSeverity(this TestMessageLevel level) case TestMessageLevel.Error: return Severity.Error; default: - throw new InvalidOperationException($"Unknown enum literal: {level}"); + throw new InvalidOperationException(String.Format(Resources.UnknownEnum, level)); } } diff --git a/GoogleTestAdapter/TestAdapter/Framework/MessageBasedDebuggerAttacher.cs b/GoogleTestAdapter/TestAdapter/Framework/MessageBasedDebuggerAttacher.cs index 0ff083c89..1e4041c20 100644 --- a/GoogleTestAdapter/TestAdapter/Framework/MessageBasedDebuggerAttacher.cs +++ b/GoogleTestAdapter/TestAdapter/Framework/MessageBasedDebuggerAttacher.cs @@ -1,4 +1,4 @@ -// This file has been modified by Microsoft on 7/2017. +// This file has been modified by Microsoft on 8/2017. using GoogleTestAdapter.Common; using GoogleTestAdapter.Framework; @@ -43,7 +43,7 @@ public bool AttachDebugger(int processId) { client.Service.AttachDebugger(processId); stopWatch.Stop(); - _logger.DebugInfo($"Debugger attached to process {processId}, took {stopWatch.ElapsedMilliseconds} ms"); + _logger.DebugInfo(String.Format(Resources.DebuggerAttachTime, processId, stopWatch.ElapsedMilliseconds)); return true; } } @@ -51,15 +51,15 @@ public bool AttachDebugger(int processId) { var errorMessage = serviceFault.Detail.Message; if (string.IsNullOrWhiteSpace(errorMessage)) - errorMessage = $"Could not attach debugger to process {processId}, no error message available"; + errorMessage = String.Format(Resources.DebuggerAttachMessage, processId); - errorMessage += $"{Environment.NewLine}There might be more information on the problem in Visual Studio's ActivityLog.xml (see e.g. https://blogs.msdn.microsoft.com/visualstudio/2010/02/24/troubleshooting-extensions-with-the-activity-log/)"; + errorMessage += $"{Environment.NewLine}{Resources.MoreInformationMessage}"; _logger.LogError(errorMessage); } catch (Exception e) { - _logger.LogError($"Could not attach debugger to process {processId}:{Environment.NewLine}{e}"); + _logger.LogError($"{Resources.CouldNotAttachMessage} {processId}:{Environment.NewLine}{e}"); } return false; } diff --git a/GoogleTestAdapter/TestAdapter/Framework/VsTestFrameworkLogger.cs b/GoogleTestAdapter/TestAdapter/Framework/VsTestFrameworkLogger.cs index d6711b5ca..12ba6dfdf 100644 --- a/GoogleTestAdapter/TestAdapter/Framework/VsTestFrameworkLogger.cs +++ b/GoogleTestAdapter/TestAdapter/Framework/VsTestFrameworkLogger.cs @@ -1,4 +1,6 @@ -using System; +// This file has been modified by Microsoft on 8/2017. + +using System; using GoogleTestAdapter.Common; using GoogleTestAdapter.Helpers; using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging; @@ -27,13 +29,13 @@ public override void Log(Severity severity, string message) LogSafe(TestMessageLevel.Informational, message); break; case Severity.Warning: - LogSafe(TestMessageLevel.Warning, $"Warning: {message}"); + LogSafe(TestMessageLevel.Warning, String.Format(Resources.WarningMessage, message)); break; case Severity.Error: - LogSafe(TestMessageLevel.Error, $"ERROR: {message}"); + LogSafe(TestMessageLevel.Error, String.Format(Resources.ErrorMessage, message)); break; default: - throw new Exception($"Unknown enum literal: {severity}"); + throw new Exception(String.Format(Resources.UnknownLiteral, severity)); } } diff --git a/GoogleTestAdapter/TestAdapter/Framework/VsVersion.cs b/GoogleTestAdapter/TestAdapter/Framework/VsVersion.cs index fb101cafe..2a2b6b7d5 100644 --- a/GoogleTestAdapter/TestAdapter/Framework/VsVersion.cs +++ b/GoogleTestAdapter/TestAdapter/Framework/VsVersion.cs @@ -1,4 +1,6 @@ -using System; +// This file has been modified by Microsoft on 8/2017. + +using System; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.IO; @@ -63,7 +65,7 @@ public static VsVersion GetVisualStudioVersion(ILogger logger) } catch (Exception e) { - logger?.LogError($"Could not find out VisualStudio version: {e.Message}"); + logger?.LogError(String.Format(Resources.VSVersionMessage, e.Message)); _version = VsVersion.Unknown; } return _version.Value; @@ -75,7 +77,7 @@ private static VsVersion GetVsVersionFromProcess() { string pathToBinary = FindVsOrVsTestConsoleExe()?.MainModule.FileName; if (pathToBinary == null) - throw new InvalidOperationException("Could not find process"); + throw new InvalidOperationException(Resources.ProcessNotFound); FileVersionInfo binaryVersionInfo = FileVersionInfo.GetVersionInfo(pathToBinary); @@ -114,7 +116,7 @@ private static VsVersion GetVsVersionFromVersionString(string versionString) return VsVersion.VS2012; if (version.Major < (int) FirstSupportedVersion || version.Major > (int) LastSupportedVersion) - throw new InvalidOperationException($"Unknown VisualStudio version: {versionString}"); + throw new InvalidOperationException(String.Format(Resources.UnknownVisualStudioVersion, versionString)); return (VsVersion) version.Major; } diff --git a/GoogleTestAdapter/TestAdapter/Helpers/TestCaseFilter.cs b/GoogleTestAdapter/TestAdapter/Helpers/TestCaseFilter.cs index 8747f1fa9..1f0c6cd3d 100644 --- a/GoogleTestAdapter/TestAdapter/Helpers/TestCaseFilter.cs +++ b/GoogleTestAdapter/TestAdapter/Helpers/TestCaseFilter.cs @@ -1,4 +1,6 @@ -using System; +// This file has been modified by Microsoft on 8/2017. + +using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; @@ -60,7 +62,7 @@ private void InitProperties(ISet traitNames) { if (_testPropertiesMap.Keys.Contains(traitName)) { - _logger.LogWarning($"Trait has same name as base test property and will thus be ignored for test case filtering: {traitName}"); + _logger.LogWarning(String.Format(Resources.TraitIgnoreMessage, traitName)); continue; } @@ -105,15 +107,15 @@ private ITestCaseFilterExpression GetFilterExpression() ITestCaseFilterExpression filterExpression = _runContext.GetTestCaseFilter(_allPropertyNames, PropertyProvider); string message = filterExpression == null - ? "No test case filter provided" - : $"Test case filter: {filterExpression.TestCaseFilterValue}"; + ? Resources.NoTestCaseFilter + : String.Format(Resources.TestCaseFilter, filterExpression.TestCaseFilterValue); _logger.DebugInfo(message); return filterExpression; } catch (TestPlatformFormatException e) { - _logger.LogError($"Test case filter is invalid: {e.Message}"); + _logger.LogError(String.Format(Resources.TestCaseFilter, e.Message)); return null; } } @@ -137,8 +139,8 @@ private bool Matches(TestCase testCase, ITestCaseFilterExpression filterExpressi filterExpression.MatchTestCase(testCase, propertyName => PropertyValueProvider(testCase, propertyName)); string message = matches - ? $"{testCase.DisplayName} matches {filterExpression.TestCaseFilterValue}" - : $"{testCase.DisplayName} does not match {filterExpression.TestCaseFilterValue}"; + ? String.Format(Resources.Matches, testCase.DisplayName, filterExpression.TestCaseFilterValue) + : String.Format(Resources.DontMatch, testCase.DisplayName, filterExpression.TestCaseFilterValue); _logger.DebugInfo(message); return matches; diff --git a/GoogleTestAdapter/TestAdapter/Resources.Designer.cs b/GoogleTestAdapter/TestAdapter/Resources.Designer.cs new file mode 100644 index 000000000..a180c0674 --- /dev/null +++ b/GoogleTestAdapter/TestAdapter/Resources.Designer.cs @@ -0,0 +1,369 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace GoogleTestAdapter.TestAdapter { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("GoogleTestAdapter.TestAdapter.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Failed attaching debugger to process {0}: {1}. + /// + internal static string AttachDebuggerMessage { + get { + return ResourceManager.GetString("AttachDebuggerMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not attach debugger to process. + /// + internal static string CouldNotAttachMessage { + get { + return ResourceManager.GetString("CouldNotAttachMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not attach debugger to process {0}, no error message available. + /// + internal static string DebuggerAttachMessage { + get { + return ResourceManager.GetString("DebuggerAttachMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Debugger attached to process {0}, took {1} ms. + /// + internal static string DebuggerAttachTime { + get { + return ResourceManager.GetString("DebuggerAttachTime", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Debugging is only possible if GoogleTestAdapter has been installed into Visual Studio - NuGet installation does not support this (and other features such as Visual Studio Options, toolbar, and solution settings).. + /// + internal static string DebuggingMessage { + get { + return ResourceManager.GetString("DebuggingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} does not match {1}. + /// + internal static string DontMatch { + get { + return ResourceManager.GetString("DontMatch", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to (enable debug mode for more information). + /// + internal static string EnableDebugMode { + get { + return ResourceManager.GetString("EnableDebugMode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The following errors and warnings have occured during {0},{1}:{2}. + /// + internal static string ErrorAndWarning { + get { + return ResourceManager.GetString("ErrorAndWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ERROR: {0}. + /// + internal static string ErrorMessage { + get { + return ResourceManager.GetString("ErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test case filter is invalid: {0}. + /// + internal static string FilterInvalid { + get { + return ResourceManager.GetString("FilterInvalid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not identify Visual Studio version. {0} requires at least Visual Studio 2012 Update 1.. + /// + internal static string IdentifyVSError { + get { + return ResourceManager.GetString("IdentifyVSError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid {0}. + /// + internal static string Invalid { + get { + return ResourceManager.GetString("Invalid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} matches {1}. + /// + internal static string Matches { + get { + return ResourceManager.GetString("Matches", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There might be more information on the problem in Visual Studio's ActivityLog.xml (see e.g. https://blogs.msdn.microsoft.com/visualstudio/2010/02/24/troubleshooting-extensions-with-the-activity-log/). + /// + internal static string MoreInformationMessage { + get { + return ResourceManager.GetString("MoreInformationMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No test case filter provided. + /// + internal static string NoTestCaseFilter { + get { + return ResourceManager.GetString("NoTestCaseFilter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not find process. + /// + internal static string ProcessNotFound { + get { + return ResourceManager.GetString("ProcessNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Solution settings:. + /// + internal static string Settings { + get { + return ResourceManager.GetString("Settings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test case filter:. + /// + internal static string TestCaseFilter { + get { + return ResourceManager.GetString("TestCaseFilter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to test discovery. + /// + internal static string TestDiscovery { + get { + return ResourceManager.GetString("TestDiscovery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test discovery completed, overall duration: {0}. + /// + internal static string TestDiscoveryCompleted { + get { + return ResourceManager.GetString("TestDiscoveryCompleted", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exception while discovering tests: {0}. + /// + internal static string TestDiscoveryExceptionError { + get { + return ResourceManager.GetString("TestDiscoveryExceptionError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test execution. + /// + internal static string TestExecution { + get { + return ResourceManager.GetString("TestExecution", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test execution canceled.. + /// + internal static string TestExecutionCancelled { + get { + return ResourceManager.GetString("TestExecutionCancelled", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Google Test execution completed, overall duration: {0}. + /// + internal static string TestExecutionCompleted { + get { + return ResourceManager.GetString("TestExecutionCompleted", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Exception while running tests: {0}. + /// + internal static string TestRunningException { + get { + return ResourceManager.GetString("TestRunningException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Trait has same name as base test property and will thus be ignored for test case filtering: {0}. + /// + internal static string TraitIgnoreMessage { + get { + return ResourceManager.GetString("TraitIgnoreMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unknown enum literal: {0}. + /// + internal static string UnknownEnum { + get { + return ResourceManager.GetString("UnknownEnum", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unknown enum literal: {0}. + /// + internal static string UnknownLiteral { + get { + return ResourceManager.GetString("UnknownLiteral", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unknown Visual Studio version: {0}. + /// + internal static string UnknownVisualStudioVersion { + get { + return ResourceManager.GetString("UnknownVisualStudioVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} requires at least Visual Studio 2012 Update 1 - please update your Visual Studio installation.. + /// + internal static string VS2012Error { + get { + return ResourceManager.GetString("VS2012Error", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not find Visual Studio instance. + /// + internal static string VSInstanceNotFound { + get { + return ResourceManager.GetString("VSInstanceNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Visual Studio version: {0}. + /// + internal static string VSVersion { + get { + return ResourceManager.GetString("VSVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not find out Visual Studio version: {0}. + /// + internal static string VSVersionMessage { + get { + return ResourceManager.GetString("VSVersionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Warning: {0}. + /// + internal static string WarningMessage { + get { + return ResourceManager.GetString("WarningMessage", resourceCulture); + } + } + } +} diff --git a/GoogleTestAdapter/TestAdapter/Resources.resx b/GoogleTestAdapter/TestAdapter/Resources.resx new file mode 100644 index 000000000..ef9ab63bb --- /dev/null +++ b/GoogleTestAdapter/TestAdapter/Resources.resx @@ -0,0 +1,245 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Test discovery completed, overall duration: {0} + {0} represents unlocalized duration (e.g. "02:14:18") + + + Exception while discovering tests: {0} + {0} represents localized exception message (e.g. "Cannot load file") + + + Test execution canceled. + + + Google Test execution completed, overall duration: {0} + {0} represents unlocalized duration (e.g. "02:14:18") + + + Failed attaching debugger to process {0}: {1} + {0} represents a number (e.g. 5), {1} represents localized exception message (e.g. "Cannot load file") + + + Exception while running tests: {0} + {0} represents localized exception message (e.g. "Cannot load file") + + + Could not find Visual Studio instance + + + Could not find out Visual Studio version: {0} + {0} represents localized exception message (e.g. "Cannot load file") + + + (enable debug mode for more information) + this is used in ErrorAndWarning string + + + The following errors and warnings have occured during {0},{1}:{2} + {0} represents localized phase of test (e.g. "test discovery"), {1} represents unlocalized hint (e.g. "enable debug mode for more information"), {2} represents a unlocalized new line string (e.g "\n") + + + {0} does not match {1} + {0} represents an unlocalized test name (e.g. "TestSuite1.Test2"), {1} represents an unlocalized test filter value (e.g. "TestCategory=Nightly") + + + {0} matches {1} + {0} represents an unlocalized test name (e.g. "TestSuite1.Test2"), {1} represents an unlocalized test filter value (e.g. "TestCategory=Nightly") + + + No test case filter provided + + + Solution settings: + + + Test case filter: + + + Visual Studio version: {0} + {0} represents a number (e.g. "12" or "14") + + + test discovery + + + Test execution + + + ERROR: {0} + {0} represents unlocalized error message (e.g. "Cannot load file") + + + Unknown enum literal: {0} + {0} represents a number (e.g. "0" or "1") + + + Warning: {0} + {0} represents unlocalized warning message (e.g. "Cannot load file") + + + Could not identify Visual Studio version. {0} requires at least Visual Studio 2012 Update 1. + {0} represents unlocalized name for extension (e.g. "Google Test Adaptor") + + + {0} requires at least Visual Studio 2012 Update 1 - please update your Visual Studio installation. + {0} represents unlocalized name for extension (e.g. "Google Test Adaptor") + + + Debugging is only possible if GoogleTestAdapter has been installed into Visual Studio - NuGet installation does not support this (and other features such as Visual Studio Options, toolbar, and solution settings). + + + Test case filter is invalid: {0} + {0} represents localized exception message (e.g. "Cannot load file") + + + Trait has same name as base test property and will thus be ignored for test case filtering: {0} + {0} represents unlocalized name for trait (e.g. "Test") + + + Could not attach debugger to process + + + Could not attach debugger to process {0}, no error message available + {0} represents a number for executable process Id (e.g. "10480") + + + Debugger attached to process {0}, took {1} ms + {0} represents a number for executable process Id (e.g. "10480"), {1} represents a number (e.g. "12" or "14") + + + There might be more information on the problem in Visual Studio's ActivityLog.xml (see e.g. https://blogs.msdn.microsoft.com/visualstudio/2010/02/24/troubleshooting-extensions-with-the-activity-log/) + + + Invalid {0} + {0} represents unlocalized settings name (e.g. "GoogleTestAdapterSettings") + + + Could not find process + + + Unknown enum literal: {0} + {0} represents a number (e.g. "0" or "1") + + + Unknown Visual Studio version: {0} + {0} represents unlocalized string for Visual Studio version (e.g. "15.0") + + \ No newline at end of file diff --git a/GoogleTestAdapter/TestAdapter/Settings/RunSettingsContainer.cs b/GoogleTestAdapter/TestAdapter/Settings/RunSettingsContainer.cs index 4e76d672f..26075ab06 100644 --- a/GoogleTestAdapter/TestAdapter/Settings/RunSettingsContainer.cs +++ b/GoogleTestAdapter/TestAdapter/Settings/RunSettingsContainer.cs @@ -1,4 +1,4 @@ -// This file has been modified by Microsoft on 6/2017. +// This file has been modified by Microsoft on 8/2017. using GoogleTestAdapter.Helpers; using GoogleTestAdapter.Settings; @@ -106,7 +106,7 @@ public static RunSettingsContainer LoadFromXml(XPathNavigator rootElement) } catch (InvalidOperationException e) when (e.InnerException is XmlSchemaValidationException) { - throw new InvalidRunSettingsException($"Invalid {GoogleTestConstants.SettingsName}", e.InnerException); + throw new InvalidRunSettingsException(String.Format(Resources.Invalid, GoogleTestConstants.SettingsName), e.InnerException); } catch (Exception e) { diff --git a/GoogleTestAdapter/TestAdapter/TestAdapter.csproj b/GoogleTestAdapter/TestAdapter/TestAdapter.csproj index 090cbcc37..48448a5c8 100644 --- a/GoogleTestAdapter/TestAdapter/TestAdapter.csproj +++ b/GoogleTestAdapter/TestAdapter/TestAdapter.csproj @@ -195,6 +195,11 @@ + + True + True + Resources.resx + @@ -212,6 +217,10 @@ Designer GoogleTestAdapterSettings.xsd + + ResXFileCodeGenerator + Resources.Designer.cs + Designer diff --git a/GoogleTestAdapter/TestAdapter/TestDiscoverer.cs b/GoogleTestAdapter/TestAdapter/TestDiscoverer.cs index 1c0745f15..a584591a2 100644 --- a/GoogleTestAdapter/TestAdapter/TestDiscoverer.cs +++ b/GoogleTestAdapter/TestAdapter/TestDiscoverer.cs @@ -1,4 +1,4 @@ -// This file has been modified by Microsoft on 7/2017. +// This file has been modified by Microsoft on 8/2017. using System; using System.Collections.Generic; @@ -12,6 +12,11 @@ namespace GoogleTestAdapter.TestAdapter { + public enum TestPhase + { + TestDiscovery, + TestExecution + } [DefaultExecutorUri(TestExecutor.ExecutorUriString)] [FileExtension(".exe")] public class TestDiscoverer : ITestDiscoverer @@ -47,7 +52,7 @@ public void DiscoverTests(IEnumerable executables, IDiscoveryContext dis CommonFunctions.LogVisualStudioVersion(_logger); _logger.LogInfo(Strings.Instance.TestDiscoveryStarting); - _logger.DebugInfo($"Solution settings: {_settings}"); + _logger.DebugInfo(String.Format(Resources.Settings, _settings)); try { @@ -55,14 +60,14 @@ public void DiscoverTests(IEnumerable executables, IDiscoveryContext dis _discoverer.DiscoverTests(executables, reporter); stopwatch.Stop(); - _logger.LogInfo($"Test discovery completed, overall duration: {stopwatch.Elapsed}"); + _logger.LogInfo(String.Format(Resources.TestDiscoveryCompleted, stopwatch.Elapsed)); } catch (Exception e) { - _logger.LogError($"Exception while discovering tests: {e}"); + _logger.LogError(String.Format(Resources.TestDiscoveryExceptionError, e)); } - CommonFunctions.ReportErrors(_logger, "test discovery", _settings.DebugMode); + CommonFunctions.ReportErrors(_logger, TestPhase.TestDiscovery, _settings.DebugMode); } private bool IsSupportedVisualStudioVersion() @@ -71,10 +76,10 @@ private bool IsSupportedVisualStudioVersion() switch (version) { case VsVersion.Unknown: - _logger.LogWarning($"Could not identify Visual Studio version. {Strings.Instance.ExtensionName} requires at least Visual Studio 2012 Update 1."); + _logger.LogWarning(String.Format(Resources.IdentifyVSError, Strings.Instance.ExtensionName)); return true; case VsVersion.VS2012: - _logger.LogError($"{Strings.Instance.ExtensionName} requires at least Visual Studio 2012 Update 1 - please update your Visual Studio installation."); + _logger.LogError(String.Format(Resources.VS2012Error, Strings.Instance.ExtensionName)); return false; default: return true; diff --git a/GoogleTestAdapter/TestAdapter/TestExecutor.cs b/GoogleTestAdapter/TestAdapter/TestExecutor.cs index 804601d83..fcb60e541 100644 --- a/GoogleTestAdapter/TestAdapter/TestExecutor.cs +++ b/GoogleTestAdapter/TestAdapter/TestExecutor.cs @@ -1,4 +1,4 @@ -// This file has been modified by Microsoft on 6/2017. +// This file has been modified by Microsoft on 8/2017. using System; using System.Linq; @@ -50,10 +50,10 @@ public void RunTests(IEnumerable executables, IRunContext runContext, IF } catch (Exception e) { - _logger.LogError($"Exception while running tests: {e}"); + _logger.LogError(String.Format(Resources.TestRunningException, e)); } - CommonFunctions.ReportErrors(_logger, "test execution", _settings.DebugMode); + CommonFunctions.ReportErrors(_logger, TestPhase.TestExecution, _settings.DebugMode); } public void RunTests(IEnumerable vsTestCasesToRun, IRunContext runContext, IFrameworkHandle frameworkHandle) @@ -64,10 +64,10 @@ public void RunTests(IEnumerable vsTestCasesToRun, IRunContext runCo } catch (Exception e) { - _logger.LogError("Exception while running tests: " + e); + _logger.LogError(String.Format(Resources.TestRunningException, e)); } - CommonFunctions.ReportErrors(_logger, "test execution", _settings.DebugMode); + CommonFunctions.ReportErrors(_logger, TestPhase.TestExecution, _settings.DebugMode); } public void Cancel() @@ -79,7 +79,7 @@ public void Cancel() _canceled = true; _executor?.Cancel(); - _logger.LogInfo("Test execution canceled."); + _logger.LogInfo(Resources.TestExecutionCancelled); } } @@ -103,7 +103,7 @@ private void TryRunTests(IEnumerable executables, IRunContext runContext DoRunTests(testCasesToRun, runContext, frameworkHandle); stopwatch.Stop(); - _logger.LogInfo($"Google Test execution completed, overall duration: {stopwatch.Elapsed}."); + _logger.LogInfo(String.Format(Resources.TestExecutionCompleted, stopwatch.Elapsed)); } private void TryRunTests(IEnumerable vsTestCasesToRun, IRunContext runContext, IFrameworkHandle frameworkHandle) @@ -122,7 +122,7 @@ private void TryRunTests(IEnumerable vsTestCasesToRun, IRunContext r DoRunTests(testCasesToRun, runContext, frameworkHandle); stopwatch.Stop(); - _logger.LogInfo($"Google Test execution completed, overall duration: {stopwatch.Elapsed}."); + _logger.LogInfo(String.Format(Resources.TestExecutionCompleted, stopwatch.Elapsed)); } private Stopwatch StartStopWatchAndInitEnvironment(IRunContext runContext, IFrameworkHandle frameworkHandle) @@ -134,7 +134,7 @@ private Stopwatch StartStopWatchAndInitEnvironment(IRunContext runContext, IFram CommonFunctions.LogVisualStudioVersion(_logger); _logger.LogInfo(Strings.Instance.TestExecutionStarting); - _logger.DebugInfo($"Solution settings: {_settings}"); + _logger.DebugInfo(String.Format(Resources.Settings, _settings)); return stopwatch; } @@ -149,7 +149,7 @@ private bool AbleToRun(IRunContext runContext) { if (!IsVisualStudioProcessAvailable() && runContext.IsBeingDebugged) { - _logger.LogError("Debugging is only possible if GoogleTestAdapter has been installed into Visual Studio - NuGet installation does not support this (and other features such as Visual Studio Options, toolbar, and solution settings)."); + _logger.LogError(Resources.DebuggingMessage); return false; } From 5f9cd8c5d9085d3682276d027e329ff59bbe1b35 Mon Sep 17 00:00:00 2001 From: Rashid Sarwar Date: Fri, 18 Aug 2017 15:51:26 -0700 Subject: [PATCH 2/7] addressing feedback --- .../Core.Tests/GoogleTestDiscovererTests.cs | 4 +++- GoogleTestAdapter/Core/Resources.Designer.cs | 19 +++++++++++---- GoogleTestAdapter/Core/Resources.resx | 23 +++++++++++-------- .../TestExecutorTestsBase.cs | 4 +++- .../TestAdapter/Resources.Designer.cs | 4 ++-- GoogleTestAdapter/TestAdapter/Resources.resx | 6 ++--- 6 files changed, 38 insertions(+), 22 deletions(-) diff --git a/GoogleTestAdapter/Core.Tests/GoogleTestDiscovererTests.cs b/GoogleTestAdapter/Core.Tests/GoogleTestDiscovererTests.cs index 33ebc278b..f14924f9c 100644 --- a/GoogleTestAdapter/Core.Tests/GoogleTestDiscovererTests.cs +++ b/GoogleTestAdapter/Core.Tests/GoogleTestDiscovererTests.cs @@ -1,4 +1,6 @@ -using System; +// This file has been modified by Microsoft on 8/2017. + +using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; diff --git a/GoogleTestAdapter/Core/Resources.Designer.cs b/GoogleTestAdapter/Core/Resources.Designer.cs index 3be5c5cb7..10b0acb55 100644 --- a/GoogleTestAdapter/Core/Resources.Designer.cs +++ b/GoogleTestAdapter/Core/Resources.Designer.cs @@ -115,7 +115,16 @@ internal static string BacktoSolution { } /// - /// Looks up a localized string similar to {0} {1} batch file: Did not find file: {2}. + /// Looks up a localized string similar to batch file. + /// + internal static string BatchFile { + get { + return ResourceManager.GetString("BatchFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} {1} {2}: Did not find file: {3}. /// internal static string BatchFileMissing { get { @@ -124,7 +133,7 @@ internal static string BatchFileMissing { } /// - /// Looks up a localized string similar to {0} {1} batch file returned exit code {2}, executed command: '{3}'. + /// Looks up a localized string similar to {0} {1} {2} returned exit code {3}, executed command: '{4}'. /// internal static string BatchReturnedExitCode { get { @@ -304,7 +313,7 @@ internal static string ExecuteSteps { } /// - /// Looks up a localized string similar to {0} Execution has been canceled: {1}. + /// Looks up a localized string similar to {0} Execution has been cancelled: {1}. /// internal static string ExecutionCancelled { get { @@ -637,7 +646,7 @@ internal static string Results { } /// - /// Looks up a localized string similar to {0} {1} batch file caused exception, message: '{2}', executed command: '{3}'. + /// Looks up a localized string similar to {0} {1} {2} caused exception, message: '{3}', executed command: '{4}'. /// internal static string RunBatchException { get { @@ -709,7 +718,7 @@ internal static string StandardDeviation { } /// - /// Looks up a localized string similar to {0} {1} batch file: Successfully ran '{2}'. + /// Looks up a localized string similar to {0} {1} {2}: Successfully ran '{3}'. /// internal static string SuccessfullyRun { get { diff --git a/GoogleTestAdapter/Core/Resources.resx b/GoogleTestAdapter/Core/Resources.resx index 9a4eb7d4c..a7c29a866 100644 --- a/GoogleTestAdapter/Core/Resources.resx +++ b/GoogleTestAdapter/Core/Resources.resx @@ -141,13 +141,16 @@ Restoring solution settings: {0} {0} represents unlocalized properties of current object + + batch file + - {0} {1} batch file: Did not find file: {2} - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. "Test setup" or "Test teardown"), {2} represents unlocalized file path (e.g c:\test\foo.bat) + {0} {1} {2}: Did not find file: {3} + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. TestSetup or TestTeardown), {2} represents localized string for BatchFile, {3} represents unlocalized file path (e.g c:\test\foo.bat) - {0} {1} batch file returned exit code {2}, executed command: '{3}' - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. "Test setup" or "Test teardown"), {2} represents a number (e.g. 5), {3} represents unlocalized file path (e.g c:\test\foo.bat) + {0} {1} {2} returned exit code {3}, executed command: '{4}' + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. TestSetup or TestTeardown), {2} represents localized string for BatchFile, {3} represents a number (e.g. 5), {4} represents unlocalized file path (e.g c:\test\foo.bat) {0} Collected {1} test result(s) from result XML file {2} @@ -223,7 +226,7 @@ This sentence is continuation of TroubleShooting string. {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents unlocalized directory path (e.g c:\test\dir), {2} represents a unlocalized new line string (e.g "\n") - {0} Execution has been canceled: {1} + {0} Execution has been cancelled: {1} {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents localized exception message (e.g. "Cannot load file") @@ -232,7 +235,7 @@ {0} Execution took {1} - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents unlocalized string for time it took (e.g. "3/1/2008 7:00:00 AM") + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents unlocalized string for time it took (e.g. "0:00:02.0504161") {0} expected durations have been found in actual durations @@ -365,8 +368,8 @@ {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a number (e.g. 5), {2} represents a number (e.g. 5) - {0} {1} batch file caused exception, message: '{2}', executed command: '{3}' - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. "Test setup" or "Test teardown") , {2} represents localized exception message (e.g. "Cannot load file"), {3} represents unlocalized file path (e.g c:\test\foo.bat) + {0} {1} {2} caused exception, message: '{3}', executed command: '{4}' + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. TestSetup or TestTeardown) , {2} represents localized string for BatchFile, {3} represents localized exception message (e.g. "Cannot load file"), {4} represents unlocalized file path (e.g c:\test\foo.bat) {0} Failed to run test executable '{1}': {2} @@ -396,8 +399,8 @@ {0} represents the standardDeviation for statistics to debug output - {0} {1} batch file: Successfully ran '{2}' - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. "Test setup" or "Test teardown"), {2} represents unlocalized file path (e.g c:\test\foo.bat) + {0} {1} {2}: Successfully ran '{3}' + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. TestSetup or TestTeardown), {2} represents localized string for BatchFile, {3} represents unlocalized file path (e.g c:\test\foo.bat) Test case already in analyzer: {0} diff --git a/GoogleTestAdapter/TestAdapter.Tests/TestExecutorTestsBase.cs b/GoogleTestAdapter/TestAdapter.Tests/TestExecutorTestsBase.cs index 3dc72528a..bf016315d 100644 --- a/GoogleTestAdapter/TestAdapter.Tests/TestExecutorTestsBase.cs +++ b/GoogleTestAdapter/TestAdapter.Tests/TestExecutorTestsBase.cs @@ -1,4 +1,6 @@ -using System; +// This file has been modified by Microsoft on 8/2017. + +using System; using System.Linq; using FluentAssertions; using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/GoogleTestAdapter/TestAdapter/Resources.Designer.cs b/GoogleTestAdapter/TestAdapter/Resources.Designer.cs index a180c0674..da1acecfa 100644 --- a/GoogleTestAdapter/TestAdapter/Resources.Designer.cs +++ b/GoogleTestAdapter/TestAdapter/Resources.Designer.cs @@ -124,7 +124,7 @@ internal static string EnableDebugMode { } /// - /// Looks up a localized string similar to The following errors and warnings have occured during {0},{1}:{2}. + /// Looks up a localized string similar to The following errors and warnings have occured during {0} {1}:{2}. /// internal static string ErrorAndWarning { get { @@ -250,7 +250,7 @@ internal static string TestDiscoveryExceptionError { } /// - /// Looks up a localized string similar to Test execution. + /// Looks up a localized string similar to test execution. /// internal static string TestExecution { get { diff --git a/GoogleTestAdapter/TestAdapter/Resources.resx b/GoogleTestAdapter/TestAdapter/Resources.resx index ef9ab63bb..ca0a7c527 100644 --- a/GoogleTestAdapter/TestAdapter/Resources.resx +++ b/GoogleTestAdapter/TestAdapter/Resources.resx @@ -152,8 +152,8 @@ this is used in ErrorAndWarning string - The following errors and warnings have occured during {0},{1}:{2} - {0} represents localized phase of test (e.g. "test discovery"), {1} represents unlocalized hint (e.g. "enable debug mode for more information"), {2} represents a unlocalized new line string (e.g "\n") + The following errors and warnings have occured during {0} {1}:{2} + {0} represents localized phase of test (e.g. TestDiscovery or TestExecution), {1} represents unlocalized hint (e.g. "enable debug mode for more information"), {2} represents a unlocalized new line string (e.g "\n") {0} does not match {1} @@ -180,7 +180,7 @@ test discovery - Test execution + test execution ERROR: {0} From 445dd0e074af89b89d160559747260e13da52641 Mon Sep 17 00:00:00 2001 From: Lukasz Mendakiewicz Date: Tue, 22 Aug 2017 23:25:48 -0700 Subject: [PATCH 3/7] Assorted fit-and-finish --- GoogleTestAdapter/Core/Resources.Designer.cs | 29 +------------------- GoogleTestAdapter/Core/Resources.resx | 20 +++----------- 2 files changed, 5 insertions(+), 44 deletions(-) diff --git a/GoogleTestAdapter/Core/Resources.Designer.cs b/GoogleTestAdapter/Core/Resources.Designer.cs index 10b0acb55..b73276358 100644 --- a/GoogleTestAdapter/Core/Resources.Designer.cs +++ b/GoogleTestAdapter/Core/Resources.Designer.cs @@ -177,15 +177,6 @@ internal static string CommandLineGeneratorError { } } - /// - /// Looks up a localized string similar to {0} Collected {1} test results from console output. - /// - internal static string ConsoleOutput { - get { - return ResourceManager.GetString("ConsoleOutput", resourceCulture); - } - } - /// /// Looks up a localized string similar to Could not terminate process {0} started at {1}: {2}. /// @@ -204,15 +195,6 @@ internal static string CrashTest { } } - /// - /// Looks up a localized string similar to {0} Created {1} test results for tests which were found neither in result XML file nor in console output. - /// - internal static string CreatedResults { - get { - return ResourceManager.GetString("CreatedResults", resourceCulture); - } - } - /// /// Looks up a localized string similar to Created {0} test results for tests which were neither found in result XML file nor in console output. /// @@ -736,7 +718,7 @@ internal static string TestCaseInAnalyzer { } /// - /// Looks up a localized string similar to {0} Test cases seem to not have been run - are you repeating a test run, but tests have changed in the meantime? Test cases:{1}. + /// Looks up a localized string similar to {0} test cases seem to not have been run - are you repeating a test run, but tests have changed in the meantime? Test cases:{1}. /// internal static string TestCaseNotRun { get { @@ -798,15 +780,6 @@ internal static string ThreadExecutionMessage { } } - /// - /// Looks up a localized string similar to {0} Check out Test Adapter for Google Test's trouble shooting section at https://go.microsoft.com/fwlink/?linkid=848168. - /// - internal static string TroubleShooting { - get { - return ResourceManager.GetString("TroubleShooting", resourceCulture); - } - } - /// /// Looks up a localized string similar to Unknown literal. /// diff --git a/GoogleTestAdapter/Core/Resources.resx b/GoogleTestAdapter/Core/Resources.resx index a7c29a866..b8c6c5148 100644 --- a/GoogleTestAdapter/Core/Resources.resx +++ b/GoogleTestAdapter/Core/Resources.resx @@ -139,7 +139,7 @@ Restoring solution settings: {0} - {0} represents unlocalized properties of current object + {0} represents a comma-separated list of setting properties batch file @@ -168,10 +168,6 @@ Exceeded maximum allowed command line length ({0}) after including {1} tests (next string length is {2}) {0} represents a number (e.g. 5), {1} represents a number (e.g. 5), {2} represents a number (e.g. 5) - - {0} Collected {1} test results from console output - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a number (e.g. 5) - Could not terminate process {0} started at {1}: {2} {0} represents an unlocalized process name (e.g notepad.exe), {1} represents unlocalized string for time (e.g. "3/1/2008 7:00:00 AM"), {2} represents localized exception message (e.g. "Cannot load file") @@ -180,10 +176,6 @@ reason is probably a crash of test {0} {0} represents a unlocalized name of test (e.g. foo) - - {0} Created {1} test results for tests which were found neither in result XML file nor in console output - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a number (e.g. 5) - Created {0} test results for tests which were neither found in result XML file nor in console output {0} represents a number (e.g. 5) @@ -290,7 +282,7 @@ No settings configured for test executable '{0}'; running with solution settings: {1} - {0} represents a unlocalized name of executable (e.g. cmd.exe) file, {1} represents unlocalized current object + {0} represents a unlocalized name of executable (e.g. cmd.exe) file, {1} represents a comma-separated list of setting properties Note that no test output will be shown on the test console when executing tests concurrently! @@ -380,7 +372,7 @@ Settings for test executable '{0}': {1} - {0} represents a unlocalized name of executable (e.g. cmd.exe) file, {1} means current object + {0} represents a unlocalized name of executable (e.g. cmd.exe) file, {1} represents a comma-separated list of setting properties Settings for test executable '{0}': {1} @@ -407,7 +399,7 @@ {0} represents an unlocalized string for test name (e.g. "TestSuite1.Test2") - {0} Test cases seem to not have been run - are you repeating a test run, but tests have changed in the meantime? Test cases:{1} + {0} test cases seem to not have been run - are you repeating a test run, but tests have changed in the meantime? Test cases:{1} {0} represents a number (e.g. 5), {1} represents a unlocalized new line string (e.g "\n") @@ -431,10 +423,6 @@ Executing tests on {0} threads {0} represents a number (e.g. 5) - - {0} Check out Test Adapter for Google Test's trouble shooting section at https://go.microsoft.com/fwlink/?linkid=848168 - {0} represents an unlocalized name for thread (e.g. "T001519") - Unknown literal From f0d43ee495ae8e10f2569f7c995612897fc7e058 Mon Sep 17 00:00:00 2001 From: Lukasz Mendakiewicz Date: Wed, 23 Aug 2017 09:32:17 -0700 Subject: [PATCH 4/7] Undo unfinished work for BatchFile resource --- GoogleTestAdapter/Core/Resources.Designer.cs | 17 ++++------------- GoogleTestAdapter/Core/Resources.resx | 19 ++++++++----------- 2 files changed, 12 insertions(+), 24 deletions(-) diff --git a/GoogleTestAdapter/Core/Resources.Designer.cs b/GoogleTestAdapter/Core/Resources.Designer.cs index b73276358..de4505e16 100644 --- a/GoogleTestAdapter/Core/Resources.Designer.cs +++ b/GoogleTestAdapter/Core/Resources.Designer.cs @@ -115,16 +115,7 @@ internal static string BacktoSolution { } /// - /// Looks up a localized string similar to batch file. - /// - internal static string BatchFile { - get { - return ResourceManager.GetString("BatchFile", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} {1} {2}: Did not find file: {3}. + /// Looks up a localized string similar to {0} {1} batch file: Did not find file: {2}. /// internal static string BatchFileMissing { get { @@ -133,7 +124,7 @@ internal static string BatchFileMissing { } /// - /// Looks up a localized string similar to {0} {1} {2} returned exit code {3}, executed command: '{4}'. + /// Looks up a localized string similar to {0} {1} batch file returned exit code {2}, executed command: '{3}'. /// internal static string BatchReturnedExitCode { get { @@ -628,7 +619,7 @@ internal static string Results { } /// - /// Looks up a localized string similar to {0} {1} {2} caused exception, message: '{3}', executed command: '{4}'. + /// Looks up a localized string similar to {0} {1} batch file caused exception, message: '{2}', executed command: '{3}'. /// internal static string RunBatchException { get { @@ -700,7 +691,7 @@ internal static string StandardDeviation { } /// - /// Looks up a localized string similar to {0} {1} {2}: Successfully ran '{3}'. + /// Looks up a localized string similar to {0} {1} batch file: Successfully ran '{2}'. /// internal static string SuccessfullyRun { get { diff --git a/GoogleTestAdapter/Core/Resources.resx b/GoogleTestAdapter/Core/Resources.resx index b8c6c5148..ced37a7ff 100644 --- a/GoogleTestAdapter/Core/Resources.resx +++ b/GoogleTestAdapter/Core/Resources.resx @@ -141,16 +141,13 @@ Restoring solution settings: {0} {0} represents a comma-separated list of setting properties - - batch file - - {0} {1} {2}: Did not find file: {3} - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. TestSetup or TestTeardown), {2} represents localized string for BatchFile, {3} represents unlocalized file path (e.g c:\test\foo.bat) + {0} {1} batch file: Did not find file: {2} + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. TestSetup or TestTeardown), {2} represents unlocalized file path (e.g c:\test\foo.bat) - {0} {1} {2} returned exit code {3}, executed command: '{4}' - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. TestSetup or TestTeardown), {2} represents localized string for BatchFile, {3} represents a number (e.g. 5), {4} represents unlocalized file path (e.g c:\test\foo.bat) + {0} {1} batch file returned exit code {2}, executed command: '{3}' + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. TestSetup or TestTeardown), {2} represents a number (e.g. 5), {3} represents unlocalized file path (e.g c:\test\foo.bat) {0} Collected {1} test result(s) from result XML file {2} @@ -360,8 +357,8 @@ {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a number (e.g. 5), {2} represents a number (e.g. 5) - {0} {1} {2} caused exception, message: '{3}', executed command: '{4}' - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. TestSetup or TestTeardown) , {2} represents localized string for BatchFile, {3} represents localized exception message (e.g. "Cannot load file"), {4} represents unlocalized file path (e.g c:\test\foo.bat) + {0} {1} batch file caused exception, message: '{2}', executed command: '{3}' + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. TestSetup or TestTeardown) , {2} represents localized exception message (e.g. "Cannot load file"), {3} represents unlocalized file path (e.g c:\test\foo.bat) {0} Failed to run test executable '{1}': {2} @@ -391,8 +388,8 @@ {0} represents the standardDeviation for statistics to debug output - {0} {1} {2}: Successfully ran '{3}' - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. TestSetup or TestTeardown), {2} represents localized string for BatchFile, {3} represents unlocalized file path (e.g c:\test\foo.bat) + {0} {1} batch file: Successfully ran '{2}' + {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. TestSetup or TestTeardown), {2} represents unlocalized file path (e.g c:\test\foo.bat) Test case already in analyzer: {0} From 4728980986197e56e826ed6cf5d005ebfe8104f6 Mon Sep 17 00:00:00 2001 From: Lukasz Mendakiewicz Date: Wed, 23 Aug 2017 11:42:54 -0700 Subject: [PATCH 5/7] Fix some resources comments --- GoogleTestAdapter/Core/Resources.resx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GoogleTestAdapter/Core/Resources.resx b/GoogleTestAdapter/Core/Resources.resx index ced37a7ff..b162abed5 100644 --- a/GoogleTestAdapter/Core/Resources.resx +++ b/GoogleTestAdapter/Core/Resources.resx @@ -354,7 +354,7 @@ Test {0}: Expected {1} ms, actual {2} ms - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a number (e.g. 5), {2} represents a number (e.g. 5) + {0} represents an unlocalized name of a test (e.g. foo), {1} represents a number (e.g. 5), {2} represents a number (e.g. 5) {0} {1} batch file caused exception, message: '{2}', executed command: '{3}' @@ -439,6 +439,6 @@ XmlNode could not be parsed: '{0}'. Exception message: {1} - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents localized exception message (e.g. "Cannot load file") + {0} represents an unlocalized name of an XML node, {1} represents localized exception message (e.g. "Cannot load file") \ No newline at end of file From 44506f29212a4834d8729092a8e0190b216dcdb3 Mon Sep 17 00:00:00 2001 From: Lukasz Mendakiewicz Date: Wed, 23 Aug 2017 14:07:37 -0700 Subject: [PATCH 6/7] Remove unused resources --- GoogleTestAdapter/Core/Resources.Designer.cs | 18 ------------------ GoogleTestAdapter/Core/Resources.resx | 8 -------- 2 files changed, 26 deletions(-) diff --git a/GoogleTestAdapter/Core/Resources.Designer.cs b/GoogleTestAdapter/Core/Resources.Designer.cs index de4505e16..3f56ea8d0 100644 --- a/GoogleTestAdapter/Core/Resources.Designer.cs +++ b/GoogleTestAdapter/Core/Resources.Designer.cs @@ -564,15 +564,6 @@ internal static string ReadTestDurationError { } } - /// - /// Looks up a localized string similar to Regex '{0}'. - /// - internal static string Regex { - get { - return ResourceManager.GetString("Regex", resourceCulture); - } - } - /// /// Looks up a localized string similar to Regex '{0}' cannot be parsed: {1}. /// @@ -645,15 +636,6 @@ internal static string SchedulingStats { } } - /// - /// Looks up a localized string similar to Settings for test executable '{0}': {1}. - /// - internal static string Settings { - get { - return ResourceManager.GetString("Settings", resourceCulture); - } - } - /// /// Looks up a localized string similar to Settings for test executable '{0}': {1}. /// diff --git a/GoogleTestAdapter/Core/Resources.resx b/GoogleTestAdapter/Core/Resources.resx index b162abed5..a549e9b5f 100644 --- a/GoogleTestAdapter/Core/Resources.resx +++ b/GoogleTestAdapter/Core/Resources.resx @@ -332,10 +332,6 @@ Could not read test durations: {0} {0} represents localized exception message (e.g. "Cannot load file") - - Regex '{0}' - {0} represents unlocalized regex pattern used (e.g. ab*d+) - Regex '{0}' cannot be parsed: {1} {0} represents unlocalized regex pattern used (e.g. ab*d+), {1} represents localized exception message (e.g. "Cannot load file") @@ -367,10 +363,6 @@ >>> Scheduling statistics <<< - - Settings for test executable '{0}': {1} - {0} represents a unlocalized name of executable (e.g. cmd.exe) file, {1} represents a comma-separated list of setting properties - Settings for test executable '{0}': {1} {0} represents a unlocalized name of executable (e.g. cmd.exe) file, {1} represents an unlocalized settings string From edef637b31a520808652356acbbc9fc8581e9046 Mon Sep 17 00:00:00 2001 From: Lukasz Mendakiewicz Date: Wed, 23 Aug 2017 22:14:03 -0700 Subject: [PATCH 7/7] Additional fixes --- .../Common.Dynamic.GTA/Strings.cs | 2 +- .../Common.Dynamic.TAfGT.csproj | 1 + .../Resources.Designer.cs | 2 +- .../Common.Dynamic.TAfGT/Resources.resx | 3 +- .../Core/GoogleTestDiscoverer.cs | 9 +- .../Core/Helpers/ProcessExecutor.cs | 4 +- .../Core/Helpers/ProcessLauncher.cs | 4 +- .../Core/Helpers/TestProcessLauncher.cs | 4 +- GoogleTestAdapter/Core/Resources.Designer.cs | 178 ++++++++--------- GoogleTestAdapter/Core/Resources.resx | 188 +++++++++--------- .../Core/Runners/PreparingTestRunner.cs | 34 ++-- .../Core/Runners/SequentialTestRunner.cs | 10 +- .../Core/Runners/TestResultCollector.cs | 7 +- .../Core/Settings/SettingsWrapper.cs | 2 +- .../Core/TestCases/MethodSignatureCreator.cs | 2 +- .../Core/TestCases/TestCaseFactory.cs | 9 +- GoogleTestAdapter/DiaResolver/DiaResolver.cs | 2 +- .../DiaResolver/DiaResolver.csproj | 1 + .../DiaResolver/Resources.Designer.cs | 2 +- GoogleTestAdapter/DiaResolver/Resources.resx | 4 +- .../TestExecutorTestsBase.cs | 2 +- .../TestAdapter/CommonFunctions.cs | 10 +- .../Framework/MessageBasedDebuggerAttacher.cs | 2 +- .../TestAdapter/Helpers/TestCaseFilter.cs | 4 +- .../TestAdapter/Resources.Designer.cs | 28 +-- GoogleTestAdapter/TestAdapter/Resources.resx | 36 ++-- .../TestAdapter/TestAdapter.csproj | 1 + .../TestAdapter/TestDiscoverer.cs | 5 - 28 files changed, 259 insertions(+), 297 deletions(-) diff --git a/GoogleTestAdapter/Common.Dynamic.GTA/Strings.cs b/GoogleTestAdapter/Common.Dynamic.GTA/Strings.cs index 596147fd5..811c23b9f 100644 --- a/GoogleTestAdapter/Common.Dynamic.GTA/Strings.cs +++ b/GoogleTestAdapter/Common.Dynamic.GTA/Strings.cs @@ -6,7 +6,7 @@ namespace GoogleTestAdapter.Common public class Strings : IStrings { public string ExtensionName => "Google Test Adapter"; - public string TroubleShootingLink => "Check out Google Test Adapter's trouble shooting section at https://github.com/csoltenborn/GoogleTestAdapter#trouble_shooting"; + public string TroubleShootingLink => "{0}Check out Google Test Adapter's trouble shooting section at https://github.com/csoltenborn/GoogleTestAdapter#trouble_shooting"; public string TestDiscoveryStarting => "Google Test Adapter: Test discovery starting..."; public string TestExecutionStarting => "Google Test Adapter: Test execution starting..."; } diff --git a/GoogleTestAdapter/Common.Dynamic.TAfGT/Common.Dynamic.TAfGT.csproj b/GoogleTestAdapter/Common.Dynamic.TAfGT/Common.Dynamic.TAfGT.csproj index 9ccec6262..06d569892 100644 --- a/GoogleTestAdapter/Common.Dynamic.TAfGT/Common.Dynamic.TAfGT.csproj +++ b/GoogleTestAdapter/Common.Dynamic.TAfGT/Common.Dynamic.TAfGT.csproj @@ -70,6 +70,7 @@ ResXFileCodeGenerator Resources.Designer.cs + Designer diff --git a/GoogleTestAdapter/Common.Dynamic.TAfGT/Resources.Designer.cs b/GoogleTestAdapter/Common.Dynamic.TAfGT/Resources.Designer.cs index 228fb555e..1e990c292 100644 --- a/GoogleTestAdapter/Common.Dynamic.TAfGT/Resources.Designer.cs +++ b/GoogleTestAdapter/Common.Dynamic.TAfGT/Resources.Designer.cs @@ -88,7 +88,7 @@ internal static string TestExecutionStarting { } /// - /// Looks up a localized string similar to Check out Test Adapter for Google Test's trouble shooting section at https://go.microsoft.com/fwlink/?linkid=848168. + /// Looks up a localized string similar to {0}Check out Test Adapter for Google Test's trouble shooting section at https://go.microsoft.com/fwlink/?linkid=848168. /// internal static string TroubleShootingLink { get { diff --git a/GoogleTestAdapter/Common.Dynamic.TAfGT/Resources.resx b/GoogleTestAdapter/Common.Dynamic.TAfGT/Resources.resx index 950c13d80..28ecd4c11 100644 --- a/GoogleTestAdapter/Common.Dynamic.TAfGT/Resources.resx +++ b/GoogleTestAdapter/Common.Dynamic.TAfGT/Resources.resx @@ -127,6 +127,7 @@ Test Adapter for Google Test: Test execution starting... - Check out Test Adapter for Google Test's trouble shooting section at https://go.microsoft.com/fwlink/?linkid=848168 + {0}Check out Test Adapter for Google Test's trouble shooting section at https://go.microsoft.com/fwlink/?linkid=848168 + {0} is empty or a name of a thread followed by space (e.g. "[T0] ") \ No newline at end of file diff --git a/GoogleTestAdapter/Core/GoogleTestDiscoverer.cs b/GoogleTestAdapter/Core/GoogleTestDiscoverer.cs index 5c5783717..c6559e381 100644 --- a/GoogleTestAdapter/Core/GoogleTestDiscoverer.cs +++ b/GoogleTestAdapter/Core/GoogleTestDiscoverer.cs @@ -70,7 +70,7 @@ private static void DiscoverTests(string executable, ITestFrameworkReporter repo Action reportTestCases = tc => { reporter.ReportTestsFound(tc.Yield()); - logger.DebugInfo(String.Format(Resources.AddedTestCase, tc.DisplayName)); + logger.DebugInfo(String.Format(Resources.AddedTestCase, tc.DisplayName)); nrOfTestCases++; }; var factory = new TestCaseFactory(executable, logger, settings, diaResolverFactory); @@ -104,20 +104,19 @@ public bool IsGoogleTestExecutable(string executable, string customRegex = "") _logger.DebugInfo(String.Format(Resources.FileNotFound, executable)); bool matches; - string regexSource, regex; + string regex; if (string.IsNullOrWhiteSpace(customRegex)) { - regexSource = Resources.Default; regex = SettingsWrapper.TestFinderRegex; matches = CompiledTestFinderRegex.IsMatch(executable); + _logger.DebugInfo(String.Format(matches ? Resources.MatchesDefault : Resources.DoesntMatchDefault, executable, regex)); } else { - regexSource = Resources.Custom; regex = customRegex; matches = SafeMatches(executable, customRegex); + _logger.DebugInfo(String.Format(matches ? Resources.MatchesCustom : Resources.DoesntMatchCustom, executable, regex)); } - _logger.DebugInfo(String.Format(matches ? Resources.Matches : Resources.DontMatch, executable, regexSource, regex)); return matches; } diff --git a/GoogleTestAdapter/Core/Helpers/ProcessExecutor.cs b/GoogleTestAdapter/Core/Helpers/ProcessExecutor.cs index 4a4bb2515..ebdb6baff 100644 --- a/GoogleTestAdapter/Core/Helpers/ProcessExecutor.cs +++ b/GoogleTestAdapter/Core/Helpers/ProcessExecutor.cs @@ -1,6 +1,4 @@ -// This file has been modified by Microsoft on 8/2017. - -using System; +using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; diff --git a/GoogleTestAdapter/Core/Helpers/ProcessLauncher.cs b/GoogleTestAdapter/Core/Helpers/ProcessLauncher.cs index 4917df397..2f231f411 100644 --- a/GoogleTestAdapter/Core/Helpers/ProcessLauncher.cs +++ b/GoogleTestAdapter/Core/Helpers/ProcessLauncher.cs @@ -72,12 +72,12 @@ private int LaunchProcess(string workingDirectory, string command, string param, var waiter = new ProcessWaiter(process); if (printTestOutput) { - _logger.LogInfo(String.Format(Resources.OutputOfCommandMessage, command, param)); + _logger.LogInfo(String.Format(Resources.OutputOfCommandMessage, "", command, param)); } ReadTheStream(process, output, printTestOutput, throwIfError); if (printTestOutput) { - _logger.LogInfo(Resources.EndOfOutputMessage); + _logger.LogInfo(String.Format(Resources.EndOfOutputMessage, "")); } return waiter.WaitForExit(); } diff --git a/GoogleTestAdapter/Core/Helpers/TestProcessLauncher.cs b/GoogleTestAdapter/Core/Helpers/TestProcessLauncher.cs index c35b2496f..5869ea951 100644 --- a/GoogleTestAdapter/Core/Helpers/TestProcessLauncher.cs +++ b/GoogleTestAdapter/Core/Helpers/TestProcessLauncher.cs @@ -63,11 +63,11 @@ public static void KillProcess(int processId, ILogger logger) try { process.Kill(); - logger.DebugInfo(String.Format(Resources.KilledProcess, process, startTime.ToShortTimeString())); + logger.DebugInfo(String.Format(Resources.TerminatedProcess, process, startTime.ToShortTimeString())); } catch (Exception e) { - logger.DebugWarning(String.Format(Resources.CouldNotKill, process, startTime.ToShortTimeString(), e.Message)); + logger.DebugWarning(String.Format(Resources.CouldNotTerminate, process, startTime.ToShortTimeString(), e.Message)); } } catch (Exception) diff --git a/GoogleTestAdapter/Core/Resources.Designer.cs b/GoogleTestAdapter/Core/Resources.Designer.cs index 3f56ea8d0..eb49339e7 100644 --- a/GoogleTestAdapter/Core/Resources.Designer.cs +++ b/GoogleTestAdapter/Core/Resources.Designer.cs @@ -79,7 +79,7 @@ internal static string AddedTestCase { } /// - /// Looks up a localized string similar to Test case already in analyzer: {0}. + /// Looks up a localized string similar to {0}Test case already in analyzer: {1}. /// internal static string AlreadyInAnalyzer { get { @@ -106,16 +106,7 @@ internal static string AvgDifference { } /// - /// Looks up a localized string similar to Restoring solution settings: {0}. - /// - internal static string BacktoSolution { - get { - return ResourceManager.GetString("BacktoSolution", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to {0} {1} batch file: Did not find file: {2}. + /// Looks up a localized string similar to {0}{1}: Did not find file: {2}. /// internal static string BatchFileMissing { get { @@ -124,7 +115,7 @@ internal static string BatchFileMissing { } /// - /// Looks up a localized string similar to {0} {1} batch file returned exit code {2}, executed command: '{3}'. + /// Looks up a localized string similar to {0}{1}: Exited with code {2}, executed command: '{3}'. /// internal static string BatchReturnedExitCode { get { @@ -133,7 +124,7 @@ internal static string BatchReturnedExitCode { } /// - /// Looks up a localized string similar to {0} Collected {1} test result(s) from result XML file {2}. + /// Looks up a localized string similar to {0}Collected {1} test result(s) from result XML file {2}. /// internal static string CollectedResults { get { @@ -142,7 +133,7 @@ internal static string CollectedResults { } /// - /// Looks up a localized string similar to Collected {0} test results from console output. + /// Looks up a localized string similar to {0}Collected {1} test results from console output. /// internal static string CollectedResultsFromConsole { get { @@ -169,52 +160,43 @@ internal static string CommandLineGeneratorError { } /// - /// Looks up a localized string similar to Could not terminate process {0} started at {1}: {2}. - /// - internal static string CouldNotKill { - get { - return ResourceManager.GetString("CouldNotKill", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to reason is probably a crash of test {0}. + /// Looks up a localized string similar to Could not list test cases for executable '{0}': process execution failed with exit code {1}. /// - internal static string CrashTest { + internal static string CouldNotListTestCases { get { - return ResourceManager.GetString("CrashTest", resourceCulture); + return ResourceManager.GetString("CouldNotListTestCases", resourceCulture); } } /// - /// Looks up a localized string similar to Created {0} test results for tests which were neither found in result XML file nor in console output. + /// Looks up a localized string similar to Could not terminate process {0} started at {1}: {2}. /// - internal static string CreatedTestResults { + internal static string CouldNotTerminate { get { - return ResourceManager.GetString("CreatedTestResults", resourceCulture); + return ResourceManager.GetString("CouldNotTerminate", resourceCulture); } } /// - /// Looks up a localized string similar to custom. + /// Looks up a localized string similar to reason is probably a crash of test {0}. /// - internal static string Custom { + internal static string CrashTest { get { - return ResourceManager.GetString("Custom", resourceCulture); + return ResourceManager.GetString("CrashTest", resourceCulture); } } /// - /// Looks up a localized string similar to default. + /// Looks up a localized string similar to {0}Created {1} test results for tests which were neither found in result XML file nor in console output. /// - internal static string Default { + internal static string CreatedTestResults { get { - return ResourceManager.GetString("Default", resourceCulture); + return ResourceManager.GetString("CreatedTestResults", resourceCulture); } } /// - /// Looks up a localized string similar to {0} Could not delete test directory '{1}': {2}. + /// Looks up a localized string similar to {0}Could not delete test directory '{1}': {2}. /// internal static string DeleteTestDir { get { @@ -223,34 +205,34 @@ internal static string DeleteTestDir { } /// - /// Looks up a localized string similar to {0} does not match {1} regex {2}. + /// Looks up a localized string similar to {0} does not match custom regex {1}. /// - internal static string DontMatch { + internal static string DoesntMatchCustom { get { - return ResourceManager.GetString("DontMatch", resourceCulture); + return ResourceManager.GetString("DoesntMatchCustom", resourceCulture); } } /// - /// Looks up a localized string similar to <<<<<<<<<<<<<<< End of Output. + /// Looks up a localized string similar to {0} does not match default regex {1}. /// - internal static string EndOfOutputMessage { + internal static string DoesntMatchDefault { get { - return ResourceManager.GetString("EndOfOutputMessage", resourceCulture); + return ResourceManager.GetString("DoesntMatchDefault", resourceCulture); } } /// - /// Looks up a localized string similar to {0} <<<<<<<<<<<<<<< End of Output. + /// Looks up a localized string similar to {0}<<<<<<<<<<<<<<< End of Output. /// - internal static string EndOfOutputWithThreadInfo { + internal static string EndOfOutputMessage { get { - return ResourceManager.GetString("EndOfOutputWithThreadInfo", resourceCulture); + return ResourceManager.GetString("EndOfOutputMessage", resourceCulture); } } /// - /// Looks up a localized string similar to {0} Exception while running tests: {1}. + /// Looks up a localized string similar to {0}Exception while running tests: {1}. /// internal static string ExceptionMessage { get { @@ -268,7 +250,7 @@ internal static string ExceptionResolving { } /// - /// Looks up a localized string similar to {0}: Executable came from another computer and was blocked to help protect this computer.. + /// Looks up a localized string similar to Executable {0} came from another computer and was blocked to help protect this computer.. /// internal static string ExecutableError { get { @@ -277,7 +259,7 @@ internal static string ExecutableError { } /// - /// Looks up a localized string similar to {0} In particular: launch command prompt, change into directory '{1}', and execute the following command to make sure your tests can be run in general.{2}. + /// Looks up a localized string similar to {0}In particular: launch command prompt, change into directory '{1}', and execute the following command to make sure your tests can be run in general.{2}{3} {4}. /// internal static string ExecuteSteps { get { @@ -286,7 +268,7 @@ internal static string ExecuteSteps { } /// - /// Looks up a localized string similar to {0} Execution has been cancelled: {1}. + /// Looks up a localized string similar to {0}Execution has been cancelled: {1}. /// internal static string ExecutionCancelled { get { @@ -295,7 +277,7 @@ internal static string ExecutionCancelled { } /// - /// Looks up a localized string similar to Execution is already running with settings for executable {0}, can not switch to settings for {1}. + /// Looks up a localized string similar to Execution is already running with settings for executable {0}, cannot switch to settings for {1}. /// internal static string ExecutionString { get { @@ -304,7 +286,7 @@ internal static string ExecutionString { } /// - /// Looks up a localized string similar to {0} Execution took {1}. + /// Looks up a localized string similar to {0}Execution took {1}. /// internal static string ExecutionTime { get { @@ -367,7 +349,7 @@ internal static string InvalidFile { } /// - /// Looks up a localized string similar to Invalid regular expression '{0}', exception message: {1}. + /// Looks up a localized string similar to Invalid regular expression "{0}", exception message: {1}. /// internal static string InvalidRegularExpression { get { @@ -376,29 +358,29 @@ internal static string InvalidRegularExpression { } /// - /// Looks up a localized string similar to Terminated process {0} started at {1}. + /// Looks up a localized string similar to Could not find source location for test {0}. /// - internal static string KilledProcess { + internal static string LocationNotFoundError { get { - return ResourceManager.GetString("KilledProcess", resourceCulture); + return ResourceManager.GetString("LocationNotFoundError", resourceCulture); } } /// - /// Looks up a localized string similar to Could not find source location for test {0}. + /// Looks up a localized string similar to {0} matches custom regex {1}. /// - internal static string LocationNotFoundError { + internal static string MatchesCustom { get { - return ResourceManager.GetString("LocationNotFoundError", resourceCulture); + return ResourceManager.GetString("MatchesCustom", resourceCulture); } } /// - /// Looks up a localized string similar to {0} matches {1} regex {2}. + /// Looks up a localized string similar to {0} matches default regex {1}. /// - internal static string Matches { + internal static string MatchesDefault { get { - return ResourceManager.GetString("Matches", resourceCulture); + return ResourceManager.GetString("MatchesDefault", resourceCulture); } } @@ -484,16 +466,7 @@ internal static string OutputFileMissing { } /// - /// Looks up a localized string similar to {0}>>>>>>>>>>>>>>> Output of command '{1} {2}'. - /// - internal static string OutputOfCmdWithThreadInfo { - get { - return ResourceManager.GetString("OutputOfCmdWithThreadInfo", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Output of command. + /// Looks up a localized string similar to Output of command:. /// internal static string OutputOfCommand { get { @@ -502,7 +475,7 @@ internal static string OutputOfCommand { } /// - /// Looks up a localized string similar to >>>>>>>>>>>>>>> Output of command '{0} {1}'. + /// Looks up a localized string similar to {0}>>>>>>>>>>>>>>> Output of command '{1} {2}'. /// internal static string OutputOfCommandMessage { get { @@ -546,15 +519,6 @@ internal static string ProcessExitCode { } } - /// - /// Looks up a localized string similar to Could not list test cases for executable '{0}': process execution failed with exit code {1}. - /// - internal static string ProcessFailed { - get { - return ResourceManager.GetString("ProcessFailed", resourceCulture); - } - } - /// /// Looks up a localized string similar to Could not read test durations: {0}. /// @@ -583,7 +547,7 @@ internal static string RegexTimedOut { } /// - /// Looks up a localized string similar to {0} Reported {1} test results to Visual Studio during test execution, executable: '{2}'. + /// Looks up a localized string similar to {0}Reported {1} test results to Visual Studio during test execution, executable: '{2}'. /// internal static string ReportedResultsToVS { get { @@ -592,7 +556,7 @@ internal static string ReportedResultsToVS { } /// - /// Looks up a localized string similar to {0} Reported {1} test results to Visual Studio, executable: '{2}', duration: {3}. + /// Looks up a localized string similar to {0}Reported {1} test results to Visual Studio, executable: '{2}', duration: {3}. /// internal static string ReportedTestResults { get { @@ -600,6 +564,15 @@ internal static string ReportedTestResults { } } + /// + /// Looks up a localized string similar to Restoring solution settings: {0}. + /// + internal static string RestoringSolutionSettings { + get { + return ResourceManager.GetString("RestoringSolutionSettings", resourceCulture); + } + } + /// /// Looks up a localized string similar to Test {0}: Expected {1} ms, actual {2} ms. /// @@ -610,7 +583,7 @@ internal static string Results { } /// - /// Looks up a localized string similar to {0} {1} batch file caused exception, message: '{2}', executed command: '{3}'. + /// Looks up a localized string similar to {0}{1}: Exception caught, message: '{2}', executed command: '{3}'. /// internal static string RunBatchException { get { @@ -619,7 +592,7 @@ internal static string RunBatchException { } /// - /// Looks up a localized string similar to {0} Failed to run test executable '{1}': {2}. + /// Looks up a localized string similar to {0}Failed to run test executable '{1}': {2}. /// internal static string RunExecutableError { get { @@ -646,7 +619,7 @@ internal static string SettingsMessage { } /// - /// Looks up a localized string similar to SettingsWrapper is already running with settings for an executable on thread '{0}', cannot also be used by thread {1}. + /// Looks up a localized string similar to SettingsWrapper is already running with settings for an executable on thread '{0}', cannot also be used by thread '{1}'. /// internal static string SettingsWrapperString { get { @@ -655,7 +628,7 @@ internal static string SettingsWrapperString { } /// - /// Looks up a localized string similar to {0} Stack trace: {1}{2}. + /// Looks up a localized string similar to {0}Stack trace:{1}{2}. /// internal static string StackTrace { get { @@ -664,7 +637,7 @@ internal static string StackTrace { } /// - /// Looks up a localized string similar to Standard deviation: {0}. + /// Looks up a localized string similar to Standard deviation: {0} ms. /// internal static string StandardDeviation { get { @@ -673,7 +646,7 @@ internal static string StandardDeviation { } /// - /// Looks up a localized string similar to {0} {1} batch file: Successfully ran '{2}'. + /// Looks up a localized string similar to {0}{1}: Successfully ran '{2}'. /// internal static string SuccessfullyRun { get { @@ -681,6 +654,15 @@ internal static string SuccessfullyRun { } } + /// + /// Looks up a localized string similar to Terminated process {0} started at {1}. + /// + internal static string TerminatedProcess { + get { + return ResourceManager.GetString("TerminatedProcess", resourceCulture); + } + } + /// /// Looks up a localized string similar to Test case already in analyzer: {0}. /// @@ -691,7 +673,7 @@ internal static string TestCaseInAnalyzer { } /// - /// Looks up a localized string similar to {0} test cases seem to not have been run - are you repeating a test run, but tests have changed in the meantime? Test cases:{1}. + /// Looks up a localized string similar to {0}{1} test cases seem to not have been run - are you repeating a test run, but tests have changed in the meantime? Test cases:{2}{3}. /// internal static string TestCaseNotRun { get { @@ -700,7 +682,7 @@ internal static string TestCaseNotRun { } /// - /// Looks up a localized string similar to Test whether the following commands can be executed sucessfully on the command line (make sure all required binaries are on the PATH):. + /// Looks up a localized string similar to Test whether the following commands can be executed sucessfully on the command line (make sure all required binaries are on the PATH):{0}{1}. /// internal static string TestCommandCanBeRun { get { @@ -727,20 +709,20 @@ internal static string TestResultParse { } /// - /// Looks up a localized string similar to Test setup. + /// Looks up a localized string similar to Test setup batch file. /// - internal static string TestSetup { + internal static string TestSetupBatchFile { get { - return ResourceManager.GetString("TestSetup", resourceCulture); + return ResourceManager.GetString("TestSetupBatchFile", resourceCulture); } } /// - /// Looks up a localized string similar to Test teardown. + /// Looks up a localized string similar to Test teardown batch file. /// - internal static string TestTeardown { + internal static string TestTeardownBatchFile { get { - return ResourceManager.GetString("TestTeardown", resourceCulture); + return ResourceManager.GetString("TestTeardownBatchFile", resourceCulture); } } @@ -754,7 +736,7 @@ internal static string ThreadExecutionMessage { } /// - /// Looks up a localized string similar to Unknown literal. + /// Looks up a localized string similar to Unknown literal: {0}. /// internal static string UnknownLiteral { get { diff --git a/GoogleTestAdapter/Core/Resources.resx b/GoogleTestAdapter/Core/Resources.resx index a549e9b5f..dbccca410 100644 --- a/GoogleTestAdapter/Core/Resources.resx +++ b/GoogleTestAdapter/Core/Resources.resx @@ -126,8 +126,8 @@ {0} represents an unlocalized test name (e.g. "TestSuite1.Test2") - Test case already in analyzer: {0} - {0} represents an unlocalized test name (e.g. "TestSuite1.Test2") + {0}Test case already in analyzer: {1} + {0} is empty or a name of a thread followed by space (e.g. "[T0] "), {1} represents an unlocalized test name (e.g. "TestSuite1.Test2") Attaching debugger to {0} @@ -137,25 +137,21 @@ Average difference between expected and actual duration: {0} ms {0} represents a number (e.g. 5) - - Restoring solution settings: {0} - {0} represents a comma-separated list of setting properties - - {0} {1} batch file: Did not find file: {2} - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. TestSetup or TestTeardown), {2} represents unlocalized file path (e.g c:\test\foo.bat) + {0}{1}: Did not find file: {2} + {0} is empty or a name of a thread followed by space (e.g. "[T0] "), {1} is TestSetupBatchFile or TestTeardownBatchFile string, {2} represents unlocalized file path (e.g c:\test\foo.bat) - {0} {1} batch file returned exit code {2}, executed command: '{3}' - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. TestSetup or TestTeardown), {2} represents a number (e.g. 5), {3} represents unlocalized file path (e.g c:\test\foo.bat) + {0}{1}: Exited with code {2}, executed command: '{3}' + {0} is empty or a name of a thread followed by space (e.g. "[T0] "), {1} is TestSetupBatchFile or TestTeardownBatchFile string, {2} represents a number (e.g. 5), {3} represents unlocalized file path (e.g c:\test\foo.bat) - {0} Collected {1} test result(s) from result XML file {2} - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a number (e.g. 5), {2} represents unlocalized file path (e.g c:\test\results.xml) + {0}Collected {1} test result(s) from result XML file {2} + {0} is empty or a name of a thread followed by space (e.g. "[T0] "), {1} represents a number (e.g. 5), {2} represents unlocalized file path (e.g c:\test\results.xml) - Collected {0} test results from console output - {0} represents a number (e.g. 5) + {0}Collected {1} test results from console output + {0} is empty or a name of a thread followed by space (e.g. "[T0] "), {1} represents a number (e.g. 5) Command executed: '{0} {1}', working directory: '{2}' @@ -165,66 +161,65 @@ Exceeded maximum allowed command line length ({0}) after including {1} tests (next string length is {2}) {0} represents a number (e.g. 5), {1} represents a number (e.g. 5), {2} represents a number (e.g. 5) - + + Could not list test cases for executable '{0}': process execution failed with exit code {1} + {0} represents an unlocalized name of executable (e.g. cmd.exe) file, {1} is a number + + Could not terminate process {0} started at {1}: {2} {0} represents an unlocalized process name (e.g notepad.exe), {1} represents unlocalized string for time (e.g. "3/1/2008 7:00:00 AM"), {2} represents localized exception message (e.g. "Cannot load file") reason is probably a crash of test {0} - {0} represents a unlocalized name of test (e.g. foo) + {0} represents an unlocalized name of test (e.g. foo) - Created {0} test results for tests which were neither found in result XML file nor in console output - {0} represents a number (e.g. 5) - - - custom - - - default + {0}Created {1} test results for tests which were neither found in result XML file nor in console output + {0} is empty or a name of a thread followed by space (e.g. "[T0] "), {1} represents a number (e.g. 5) - {0} Could not delete test directory '{1}': {2} - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents unlocalized directory path (e.g c:\test\dir), {2} represents localized exception message (e.g. "Cannot load file") + {0}Could not delete test directory '{1}': {2} + {0} is empty or a name of a thread followed by space (e.g. "[T0] "), {1} represents unlocalized directory path (e.g c:\test\dir), {2} represents localized exception message (e.g. "Cannot load file") - - {0} does not match {1} regex {2} - {0} represents an unlocalized name of executable (e.g. cmd.exe) file, {1} represents localized string for regex source (e.g Custom or Default), {2} represents unlocalized string for regular expression (e.g "*a.exe") + + {0} does not match custom regex {1} + {0} represents an unlocalized name of executable (e.g. cmd.exe) file, {1} represents unlocalized string for regular expression (e.g ".*a.exe") - - <<<<<<<<<<<<<<< End of Output + + {0} does not match default regex {1} + {0} represents an unlocalized name of executable (e.g. cmd.exe) file, {1} represents unlocalized string for regular expression (e.g ".*a.exe") - - {0} <<<<<<<<<<<<<<< End of Output - {0} represents an unlocalized name for thread (e.g. "T001519") + + {0}<<<<<<<<<<<<<<< End of Output + {0} is empty or a name of a thread followed by space (e.g. "[T0] ") - {0} Exception while running tests: {1} - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents localized exception message (e.g. "Cannot load file") + {0}Exception while running tests: {1} + {0} is empty or a name of a thread followed by space (e.g. "[T0] "), {1} represents localized exception message (e.g. "Cannot load file") Exception while resolving test locations and traits in {0}\n{1} {0} represents an unlocalized binary name (e.g notepad.exe), {1} represents localized exception message (e.g. "Cannot load file") - {0}: Executable came from another computer and was blocked to help protect this computer. - {0} represents a unlocalized name of executable (e.g. cmd.exe) file + Executable {0} came from another computer and was blocked to help protect this computer. + {0} represents an unlocalized name of executable (e.g. cmd.exe) file - {0} In particular: launch command prompt, change into directory '{1}', and execute the following command to make sure your tests can be run in general.{2} - This sentence is continuation of TroubleShooting string. {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents unlocalized directory path (e.g c:\test\dir), {2} represents a unlocalized new line string (e.g "\n") + {0}In particular: launch command prompt, change into directory '{1}', and execute the following command to make sure your tests can be run in general.{2}{3} {4} + This sentence is continuation of TroubleShootingLink string from Common.Dynamic.TAfGT resources file. {0} is empty or a name of a thread followed by space (e.g. "[T0] "), {1} represents unlocalized directory path (e.g c:\test\dir), {2} represents an unlocalized new line string (e.g "\n"), {3} is a name of an executable (e.g. foo.exe), {4} are parameters passed to the executable (e.g. /bar) - {0} Execution has been cancelled: {1} - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents localized exception message (e.g. "Cannot load file") + {0}Execution has been cancelled: {1} + {0} is empty or a name of a thread followed by space (e.g. "[T0] "), {1} represents localized exception message (e.g. "Cannot load file") - Execution is already running with settings for executable {0}, can not switch to settings for {1} - {0} represents a unlocalized name of executable (e.g. cmd.exe) file, {1} represents a unlocalized name of executable (e.g. cmd.exe) file + Execution is already running with settings for executable {0}, cannot switch to settings for {1} + {0} represents an unlocalized name of executable (e.g. cmd.exe) file, {1} represents an unlocalized name of executable (e.g. cmd.exe) file - {0} Execution took {1} - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents unlocalized string for time it took (e.g. "0:00:02.0504161") + {0}Execution took {1} + {0} is empty or a name of a thread followed by space (e.g. "[T0] "), {1} represents unlocalized string for time it took (e.g. "0:00:02.0504161") {0} expected durations have been found in actual durations @@ -236,11 +231,11 @@ Google Test indicator file found for executable {0} - {0} represents a unlocalized name of executable (e.g. cmd.exe) file + {0} represents an unlocalized name of executable (e.g. cmd.exe) file No Google Test indicator file found for executable {0} - {0} represents a unlocalized name of executable (e.g. cmd.exe) file + {0} represents an unlocalized name of executable (e.g. cmd.exe) file Found {0} test method symbols and {1} trait symbols in binary {2} @@ -248,23 +243,23 @@ Invalid file {0}. {1} - {0} represents an unlocalized file name (e.g. c:\foo.exe.gta.testdurations), {1} represents unlocalized string for exception message + {0} represents an unlocalized file name (e.g. c:\foo.exe.gta.testdurations), {1} represents localized exception message (e.g. "Cannot load file") - Invalid regular expression '{0}', exception message: {1} + Invalid regular expression "{0}", exception message: {1} {0} represents an unlocalized regex (e.g. "abc*d+e*"), {1} represents localized exception message (e.g. "Cannot load file") - - Terminated process {0} started at {1} - {0} represents an unlocalized process name (e.g notepad.exe), {1} represents unlocalized string for time (e.g. "3/1/2008 7:00:00 AM") - Could not find source location for test {0} {0} represents an unlocalized test name (e.g. "TestSuite1.Test2") - - {0} matches {1} regex {2} - {0} represents an unlocalized name of executable (e.g. cmd.exe) file, {1} represents localized string for regex source (e.g Custom or Default), {2} represents unlocalized string for regular expression (e.g "*a.exe") + + {0} matches custom regex {1} + {0} represents an unlocalized name of executable (e.g. cmd.exe) file, {1} represents unlocalized string for regular expression (e.g ".*a.exe") + + + {0} matches default regex {1} + {0} represents an unlocalized name of executable (e.g. cmd.exe) file, {1} represents unlocalized string for regular expression (e.g ".*a.exe") {0} must never be < 0 @@ -279,7 +274,7 @@ No settings configured for test executable '{0}'; running with solution settings: {1} - {0} represents a unlocalized name of executable (e.g. cmd.exe) file, {1} represents a comma-separated list of setting properties + {0} represents an unlocalized name of executable (e.g. cmd.exe) file, {1} represents a comma-separated list of setting properties Note that no test output will be shown on the test console when executing tests concurrently! @@ -298,23 +293,20 @@ Output file does not exist, did your tests crash? - - {0}>>>>>>>>>>>>>>> Output of command '{1} {2}' - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents an unlocalized binary name (e.g notepad.exe), {2} represents unlocalized paramaters to binary (e.g. "--param") - - Output of command + Output of command: + Followed by standard output from the command ran - >>>>>>>>>>>>>>> Output of command '{0} {1}' - {0} represents unlocalized command (e.g. cmd.exe), {1} represents unlocalized paramaters to executable (e.g. "/C exit 2") + {0}>>>>>>>>>>>>>>> Output of command '{1} {2}' + {0} is empty or a name of a thread followed by space (e.g. "[T0] "), {1} represents unlocalized command (e.g. cmd.exe), {2} represents unlocalized paramaters to executable (e.g. "/C exit 2") Parallel execution is selected in options, but tests are executed sequentially because debugger is attached. Could not parse duration in line '{0}' - {0} represents line + {0} represents the line text Could not parse pair '{0}', exception message: {1} @@ -324,10 +316,6 @@ Process has exited with code {0} {0} represents a number (e.g. 5) - - Could not list test cases for executable '{0}': process execution failed with exit code {1} - {0} represents a unlocalized name of executable (e.g. cmd.exe) file, {1} means process exit code - Could not read test durations: {0} {0} represents localized exception message (e.g. "Cannot load file") @@ -341,79 +329,89 @@ {0} represents unlocalized regex pattern used (e.g. ab*d+), {1} represents localized exception message (e.g. "Cannot load file") - {0} Reported {1} test results to Visual Studio during test execution, executable: '{2}' - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a number (e.g. 5), {2} represents a unlocalized name of executable (e.g. cmd.exe) file + {0}Reported {1} test results to Visual Studio during test execution, executable: '{2}' + {0} is empty or a name of a thread followed by space (e.g. "[T0] "), {1} represents a number (e.g. 5), {2} represents an unlocalized name of executable (e.g. cmd.exe) file - {0} Reported {1} test results to Visual Studio, executable: '{2}', duration: {3} - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a number (e.g. 5),{2} represents an unlocalized name of executable (e.g. cmd.exe) file, {3} means stopwatch time + {0}Reported {1} test results to Visual Studio, executable: '{2}', duration: {3} + {0} is empty or a name of a thread followed by space (e.g. "[T0] "), {1} represents a number (e.g. 5), {2} represents an unlocalized name of executable (e.g. cmd.exe) file, {3} means stopwatch time + + + Restoring solution settings: {0} + {0} represents a comma-separated list of setting properties Test {0}: Expected {1} ms, actual {2} ms {0} represents an unlocalized name of a test (e.g. foo), {1} represents a number (e.g. 5), {2} represents a number (e.g. 5) - {0} {1} batch file caused exception, message: '{2}', executed command: '{3}' - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. TestSetup or TestTeardown) , {2} represents localized exception message (e.g. "Cannot load file"), {3} represents unlocalized file path (e.g c:\test\foo.bat) + {0}{1}: Exception caught, message: '{2}', executed command: '{3}' + {0} is empty or a name of a thread followed by space (e.g. "[T0] "), {1} is TestSetupBatchFile or TestTeardownBatchFile string, {2} represents localized exception message (e.g. "Cannot load file"), {3} represents unlocalized file path (e.g c:\test\foo.bat) - {0} Failed to run test executable '{1}': {2} - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a unlocalized name of executable (e.g. cmd.exe) file, {2} represents localized exception message (e.g. "Cannot load file") + {0}Failed to run test executable '{1}': {2} + {0} is empty or a name of a thread followed by space (e.g. "[T0] "), {1} represents an unlocalized name of executable (e.g. cmd.exe) file, {2} represents localized exception message (e.g. "Cannot load file") >>> Scheduling statistics <<< Settings for test executable '{0}': {1} - {0} represents a unlocalized name of executable (e.g. cmd.exe) file, {1} represents an unlocalized settings string + {0} represents an unlocalized name of executable (e.g. cmd.exe) file, {1} represents an unlocalized settings string - SettingsWrapper is already running with settings for an executable on thread '{0}', cannot also be used by thread {1} - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents an unlocalized name for thread (e.g. "T001519") + SettingsWrapper is already running with settings for an executable on thread '{0}', cannot also be used by thread '{1}' + {0} is a name of a thread (e.g. "T0"), {1} is a name of a thread (e.g. "T0") - {0} Stack trace: {1}{2} - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} means new line string, {2} represents unlocalized exception stack + {0}Stack trace:{1}{2} + {0} is empty or a name of a thread followed by space (e.g. "[T0] "), {1} means new line string, {2} represents unlocalized exception stack trace - Standard deviation: {0} + Standard deviation: {0} ms {0} represents the standardDeviation for statistics to debug output - {0} {1} batch file: Successfully ran '{2}' - {0} represents an unlocalized name for thread (e.g. "T001519"), {1} represents a localized name for test mode (e.g. TestSetup or TestTeardown), {2} represents unlocalized file path (e.g c:\test\foo.bat) + {0}{1}: Successfully ran '{2}' + {0} is empty or a name of a thread followed by space (e.g. "[T0] "), {1} is TestSetupBatchFile or TestTeardownBatchFile string, {2} represents unlocalized file path (e.g c:\test\foo.bat) + + + Terminated process {0} started at {1} + {0} represents an unlocalized process name (e.g notepad.exe), {1} represents unlocalized string for time (e.g. "3/1/2008 7:00:00 AM") Test case already in analyzer: {0} {0} represents an unlocalized string for test name (e.g. "TestSuite1.Test2") - {0} test cases seem to not have been run - are you repeating a test run, but tests have changed in the meantime? Test cases:{1} - {0} represents a number (e.g. 5), {1} represents a unlocalized new line string (e.g "\n") + {0}{1} test cases seem to not have been run - are you repeating a test run, but tests have changed in the meantime? Test cases:{2}{3} + {0} is empty or a name of a thread followed by space (e.g. "[T0] "), {1} represents a number (e.g. 5), {2} represents an unlocalized new line string (e.g "\n"), {3} is a new-line separated list of unlocalized test case names - Test whether the following commands can be executed sucessfully on the command line (make sure all required binaries are on the PATH): + Test whether the following commands can be executed sucessfully on the command line (make sure all required binaries are on the PATH):{0}{1} + {0} represents an unlocalized new line string (e.g "\n"), {1} is a new-line separated sequence of commands Test discovery was cancelled after {0} s for executable {1} - {0} represents a number (e.g. 5), {1} represents a unlocalized name of executable (e.g. cmd.exe) file + {0} represents a number (e.g. 5), {1} represents an unlocalized name of executable (e.g. cmd.exe) file Test result file {0} could not be parsed (completely) - your test executable has probably crashed. Exception message: {1} {0} represents unlocalized file path (e.g c:\test\results.xml), {1} represents localized exception message (e.g. "Cannot load file") - - Test setup + + Test setup batch file - - Test teardown + + Test teardown batch file Executing tests on {0} threads {0} represents a number (e.g. 5) - Unknown literal + Unknown literal: {0} + {0} is a name of enum literal Unknown test case status: {0} diff --git a/GoogleTestAdapter/Core/Runners/PreparingTestRunner.cs b/GoogleTestAdapter/Core/Runners/PreparingTestRunner.cs index 10b270600..10025237f 100644 --- a/GoogleTestAdapter/Core/Runners/PreparingTestRunner.cs +++ b/GoogleTestAdapter/Core/Runners/PreparingTestRunner.cs @@ -13,13 +13,14 @@ namespace GoogleTestAdapter.Runners { - public enum TestStatus - { - TestSetup, - TestTeardown - } public class PreparingTestRunner : ITestRunner { + private enum BatchType + { + TestSetup, + TestTeardown + } + private readonly ILogger _logger; private readonly SettingsWrapper _settings; private readonly ITestRunner _innerTestRunner; @@ -61,13 +62,13 @@ public void RunTests(IEnumerable testCasesToRun, string baseDir, string batch = _settings.GetBatchForTestSetup(_solutionDirectory, testDirectory, _threadId); batch = batch == "" ? "" : _solutionDirectory + batch; - SafeRunBatch(TestStatus.TestSetup, _solutionDirectory, batch, isBeingDebugged); + SafeRunBatch(BatchType.TestSetup, _solutionDirectory, batch, isBeingDebugged); _innerTestRunner.RunTests(testCasesToRun, baseDir, workingDir, userParameters, isBeingDebugged, debuggedLauncher, executor); batch = _settings.GetBatchForTestTeardown(_solutionDirectory, testDirectory, _threadId); batch = batch == "" ? "" : _solutionDirectory + batch; - SafeRunBatch(TestStatus.TestTeardown, _solutionDirectory, batch, isBeingDebugged); + SafeRunBatch(BatchType.TestTeardown, _solutionDirectory, batch, isBeingDebugged); stopwatch.Stop(); _logger.DebugInfo(String.Format(Resources.ExecutionTime, _threadName, stopwatch.Elapsed)); @@ -90,31 +91,34 @@ public void Cancel() } - private void SafeRunBatch(TestStatus batchType, string workingDirectory, string batch, bool isBeingDebugged) + private void SafeRunBatch(BatchType batchType, string workingDirectory, string batch, bool isBeingDebugged) { - string locBatchType = (batchType == TestStatus.TestSetup) ? Resources.TestSetup : Resources.TestTeardown; + string batchTypeString = (batchType == BatchType.TestSetup) ? Resources.TestSetupBatchFile : Resources.TestTeardownBatchFile; + if (string.IsNullOrEmpty(batch)) { return; } if (!File.Exists(batch)) { - _logger.LogError(String.Format(Resources.BatchFileMissing, _threadName, locBatchType.ToLower(), batch)); + _logger.LogError(String.Format(Resources.BatchFileMissing, _threadName, batchTypeString, batch)); return; } try { - RunBatch(locBatchType, workingDirectory, batch, isBeingDebugged); + RunBatch(batchType, workingDirectory, batch, isBeingDebugged); } catch (Exception e) { - _logger.LogError(String.Format(Resources.RunBatchException, _threadName, locBatchType, e.Message, batch)); + _logger.LogError(String.Format(Resources.RunBatchException, _threadName, batchTypeString, e.Message, batch)); } } - private void RunBatch(string batchType, string workingDirectory, string batch, bool isBeingDebugged) + private void RunBatch(BatchType batchType, string workingDirectory, string batch, bool isBeingDebugged) { + string batchTypeString = (batchType == BatchType.TestSetup) ? Resources.TestSetupBatchFile : Resources.TestTeardownBatchFile; + int batchExitCode; if (_settings.UseNewTestExecutionFramework) { @@ -129,11 +133,11 @@ private void RunBatch(string batchType, string workingDirectory, string batch, b if (batchExitCode == 0) { - _logger.DebugInfo(String.Format(Resources.SuccessfullyRun, _threadName, batchType, batch)); + _logger.DebugInfo(String.Format(Resources.SuccessfullyRun, _threadName, batchTypeString, batch)); } else { - _logger.LogWarning(String.Format(Resources.BatchReturnedExitCode, _threadName, batchType, batchExitCode, batch)); + _logger.LogWarning(String.Format(Resources.BatchReturnedExitCode, _threadName, batchTypeString, batchExitCode, batch)); } } diff --git a/GoogleTestAdapter/Core/Runners/SequentialTestRunner.cs b/GoogleTestAdapter/Core/Runners/SequentialTestRunner.cs index 6ba53b3b9..2ae691019 100644 --- a/GoogleTestAdapter/Core/Runners/SequentialTestRunner.cs +++ b/GoogleTestAdapter/Core/Runners/SequentialTestRunner.cs @@ -139,8 +139,8 @@ public static void LogExecutionError(ILogger logger, string executable, string w { logger.LogError(String.Format(Resources.RunExecutableError, threadName, executable, exception.Message)); logger.DebugError(String.Format(Resources.StackTrace, threadName, Environment.NewLine, exception.StackTrace)); - logger.LogError($"{threadName}{Strings.Instance.TroubleShootingLink}"); - logger.LogError(String.Format(Resources.ExecuteSteps, threadName, workingDir, Environment.NewLine) + $"{executable} {arguments}"); + logger.LogError(String.Format(Strings.Instance.TroubleShootingLink, threadName)); + logger.LogError(String.Format(Resources.ExecuteSteps, threadName, workingDir, Environment.NewLine, executable, arguments)); } private IEnumerable TryRunTests(string executable, string workingDir, bool isBeingDebugged, @@ -179,7 +179,7 @@ private List RunTestExecutableWithNewFramework(string executable, string !_settings.ParallelTestExecution; if (printTestOutput) - _logger.LogInfo(String.Format(Resources.OutputOfCmdWithThreadInfo, _threadName, executable, arguments.CommandLine)); + _logger.LogInfo(String.Format(Resources.OutputOfCommandMessage, _threadName, executable, arguments.CommandLine)); Action reportOutputAction = line => { @@ -204,7 +204,7 @@ private List RunTestExecutableWithNewFramework(string executable, string streamingParser.Flush(); if (printTestOutput) - _logger.LogInfo(String.Format(Resources.EndOfOutputWithThreadInfo, _threadName)); + _logger.LogInfo(String.Format(Resources.EndOfOutputMessage, _threadName)); var consoleOutput = new List(); new TestDurationSerializer().UpdateTestDurations(streamingParser.TestResults); @@ -213,7 +213,7 @@ private List RunTestExecutableWithNewFramework(string executable, string foreach (TestResult result in streamingParser.TestResults) { if (!_schedulingAnalyzer.AddActualDuration(result.TestCase, (int) result.Duration.TotalMilliseconds)) - _logger.LogWarning($"{_threadName}{String.Format(Resources.AlreadyInAnalyzer, result.TestCase.FullyQualifiedName)}"); + _logger.LogWarning(String.Format(Resources.AlreadyInAnalyzer, _threadName, result.TestCase.FullyQualifiedName)); } return consoleOutput; } diff --git a/GoogleTestAdapter/Core/Runners/TestResultCollector.cs b/GoogleTestAdapter/Core/Runners/TestResultCollector.cs index ef5f19a01..cdf7929f7 100644 --- a/GoogleTestAdapter/Core/Runners/TestResultCollector.cs +++ b/GoogleTestAdapter/Core/Runners/TestResultCollector.cs @@ -77,7 +77,7 @@ private void CollectResultsFromConsoleOutput(StandardOutputTestResultParser cons nrOfCollectedTestResults++; } if (nrOfCollectedTestResults > 0) - _logger.DebugInfo($"{_threadName}{String.Format(Resources.CollectedResultsFromConsole, nrOfCollectedTestResults)}"); + _logger.DebugInfo(String.Format(Resources.CollectedResultsFromConsole, _threadName, nrOfCollectedTestResults)); } private void CreateMissingResults(TestCase[] testCases, TestCase crashedTestCase, List testResults) @@ -97,14 +97,13 @@ private void CreateMissingResults(TestCase[] testCases, TestCase crashedTestCase }); } if (testCases.Length > 0) - _logger.DebugInfo($"{_threadName}{String.Format(Resources.CreatedTestResults, testCases.Length)}"); + _logger.DebugInfo(String.Format(Resources.CreatedTestResults, _threadName, testCases.Length)); } private void ReportSuspiciousTestCases(TestCase[] testCases) { string testCasesAsString = string.Join(Environment.NewLine, testCases.Select(tc => tc.DisplayName)); - _logger.DebugWarning( - $"{_threadName}{String.Format(Resources.TestCaseNotRun, testCases.Length, Environment.NewLine)}{testCasesAsString}"); + _logger.DebugWarning(String.Format(Resources.TestCaseNotRun, _threadName, testCases.Length, Environment.NewLine, testCasesAsString)); } } diff --git a/GoogleTestAdapter/Core/Settings/SettingsWrapper.cs b/GoogleTestAdapter/Core/Settings/SettingsWrapper.cs index adebf8b65..7156a3dc9 100644 --- a/GoogleTestAdapter/Core/Settings/SettingsWrapper.cs +++ b/GoogleTestAdapter/Core/Settings/SettingsWrapper.cs @@ -116,7 +116,7 @@ public void ExecuteWithSettingsForExecutable(string executable, Action action, I if (_currentSettings != _settingsContainer.SolutionSettings) { _currentSettings = _settingsContainer.SolutionSettings; - logger.DebugInfo(String.Format(Resources.BacktoSolution, this)); + logger.DebugInfo(String.Format(Resources.RestoringSolutionSettings, this)); } } } diff --git a/GoogleTestAdapter/Core/TestCases/MethodSignatureCreator.cs b/GoogleTestAdapter/Core/TestCases/MethodSignatureCreator.cs index 73e447699..50aa83a7d 100644 --- a/GoogleTestAdapter/Core/TestCases/MethodSignatureCreator.cs +++ b/GoogleTestAdapter/Core/TestCases/MethodSignatureCreator.cs @@ -21,7 +21,7 @@ internal IEnumerable GetTestMethodSignatures(TestCaseDescriptor descript case TestCaseDescriptor.TestTypes.Simple: return GetTestMethodSignature(descriptor.Suite, descriptor.Name).Yield(); default: - throw new InvalidOperationException($"{Resources.UnknownLiteral} {descriptor.TestType}"); + throw new InvalidOperationException(String.Format(Resources.UnknownLiteral, descriptor.TestType)); } } diff --git a/GoogleTestAdapter/Core/TestCases/TestCaseFactory.cs b/GoogleTestAdapter/Core/TestCases/TestCaseFactory.cs index 953e0a6cd..ca2fdc79a 100644 --- a/GoogleTestAdapter/Core/TestCases/TestCaseFactory.cs +++ b/GoogleTestAdapter/Core/TestCases/TestCaseFactory.cs @@ -149,11 +149,10 @@ private IList NewCreateTestcases(Action reportTestCase, List string dir = Path.GetDirectoryName(_executable); string file = Path.GetFileName(_executable); - string cdToWorkingDir = $@"cd ""{dir}"""; - string listTestsCommand = $"{file} {GoogleTestConstants.ListTestsOption.Trim()}"; + string command = $@"cd ""{dir}""{Environment.NewLine}{file} {GoogleTestConstants.ListTestsOption.Trim()}"; _logger.LogError(String.Format(Resources.TestDiscoveryCancelled, _settings.TestDiscoveryTimeoutInSeconds, _executable)); - _logger.DebugError($"{Resources.TestCommandCanBeRun}{Environment.NewLine}{cdToWorkingDir}{Environment.NewLine}{listTestsCommand}"); + _logger.DebugError(String.Format(Resources.TestCommandCanBeRun, Environment.NewLine, command)); return new List(); } @@ -183,10 +182,10 @@ private bool CheckProcessExitCode(int processExitCode, ICollection stand { if (processExitCode != 0) { - string messsage = String.Format(Resources.ProcessFailed, _executable, processExitCode); + string messsage = String.Format(Resources.CouldNotListTestCases, _executable, processExitCode); messsage += Environment.NewLine + String.Format(Resources.CommandExecuted, _executable, GoogleTestConstants.ListTestsOption.Trim(), Path.GetDirectoryName(_executable)); if (standardOutput.Count(s => !string.IsNullOrEmpty(s)) > 0) - messsage += Environment.NewLine + Resources.OutputOfCommand + ":" + Environment.NewLine + string.Join(Environment.NewLine, standardOutput); + messsage += Environment.NewLine + Resources.OutputOfCommand + Environment.NewLine + string.Join(Environment.NewLine, standardOutput); else messsage += Environment.NewLine + Resources.NoOutput; diff --git a/GoogleTestAdapter/DiaResolver/DiaResolver.cs b/GoogleTestAdapter/DiaResolver/DiaResolver.cs index e255dd7f9..ee958f54d 100644 --- a/GoogleTestAdapter/DiaResolver/DiaResolver.cs +++ b/GoogleTestAdapter/DiaResolver/DiaResolver.cs @@ -93,7 +93,7 @@ private string FindPdbFile(string binary, string pathExtension) string pdb = PeParser.ExtractPdbPath(binary, _logger); if (pdb != null && File.Exists(pdb)) return pdb; - attempts.Add("parsing from executable"); + attempts.Add($"\"{binary}\""); pdb = Path.ChangeExtension(binary, ".pdb"); if (File.Exists(pdb)) diff --git a/GoogleTestAdapter/DiaResolver/DiaResolver.csproj b/GoogleTestAdapter/DiaResolver/DiaResolver.csproj index c0971b948..0d8cc81d5 100644 --- a/GoogleTestAdapter/DiaResolver/DiaResolver.csproj +++ b/GoogleTestAdapter/DiaResolver/DiaResolver.csproj @@ -94,6 +94,7 @@ ResXFileCodeGenerator Resources.Designer.cs + Designer diff --git a/GoogleTestAdapter/DiaResolver/Resources.Designer.cs b/GoogleTestAdapter/DiaResolver/Resources.Designer.cs index ff1e58730..e7c93ab87 100644 --- a/GoogleTestAdapter/DiaResolver/Resources.Designer.cs +++ b/GoogleTestAdapter/DiaResolver/Resources.Designer.cs @@ -61,7 +61,7 @@ internal Resources() { } /// - /// Looks up a localized string similar to Attempts to find PDB {0}. + /// Looks up a localized string similar to Attempts to find PDB: {0}. /// internal static string AttemptsToFind { get { diff --git a/GoogleTestAdapter/DiaResolver/Resources.resx b/GoogleTestAdapter/DiaResolver/Resources.resx index 1019a2f4f..4508571f7 100644 --- a/GoogleTestAdapter/DiaResolver/Resources.resx +++ b/GoogleTestAdapter/DiaResolver/Resources.resx @@ -138,8 +138,8 @@ UnMapAndLoad failed! - Attempts to find PDB {0} - {0} represents unlocalized file path (e.g c:\test\foo.pdb) + Attempts to find PDB: {0} + {0} is a list of locations attempted Parsing PDB file {0} diff --git a/GoogleTestAdapter/TestAdapter.Tests/TestExecutorTestsBase.cs b/GoogleTestAdapter/TestAdapter.Tests/TestExecutorTestsBase.cs index bf016315d..6b8e9a917 100644 --- a/GoogleTestAdapter/TestAdapter.Tests/TestExecutorTestsBase.cs +++ b/GoogleTestAdapter/TestAdapter.Tests/TestExecutorTestsBase.cs @@ -209,7 +209,7 @@ public virtual void RunTests_WithNonexistingSetupBatch_LogsError() RunAndVerifyTests(TestResources.DllTests_ReleaseX86, 1, 1, 0); MockLogger.Verify(l => l.LogError( - It.Is(s => s.Contains(TestSetup.ToLower()))), + It.Is(s => s.Contains(TestSetup))), Times.AtLeastOnce()); } diff --git a/GoogleTestAdapter/TestAdapter/CommonFunctions.cs b/GoogleTestAdapter/TestAdapter/CommonFunctions.cs index e0d119577..85875176e 100644 --- a/GoogleTestAdapter/TestAdapter/CommonFunctions.cs +++ b/GoogleTestAdapter/TestAdapter/CommonFunctions.cs @@ -12,23 +12,29 @@ namespace GoogleTestAdapter.TestAdapter { + public enum TestPhase + { + TestDiscovery, + TestExecution + } + public static class CommonFunctions { public static void ReportErrors(ILogger logger, TestPhase phase, bool isDebugModeEnabled) { - string phaseType = (phase == TestPhase.TestDiscovery) ? Resources.TestDiscovery: Resources.TestExecution; IList errors = logger.GetMessages(Severity.Error, Severity.Warning); if (errors.Count == 0) return; bool hasErrors = logger.GetMessages(Severity.Error).Count > 0; + string phaseString = (phase == TestPhase.TestDiscovery) ? Resources.TestDiscovery : Resources.TestExecution; string hint = isDebugModeEnabled ? "" : Resources.EnableDebugMode; string jointErrors = string.Join(Environment.NewLine, errors); string message = $"{Environment.NewLine}================{Environment.NewLine}" - + String.Format(Resources.ErrorAndWarning, phaseType, hint, Environment.NewLine) + + String.Format(Resources.ErrorAndWarning, phaseString, hint, Environment.NewLine) + jointErrors; if (hasErrors) diff --git a/GoogleTestAdapter/TestAdapter/Framework/MessageBasedDebuggerAttacher.cs b/GoogleTestAdapter/TestAdapter/Framework/MessageBasedDebuggerAttacher.cs index 1e4041c20..7a4248cd4 100644 --- a/GoogleTestAdapter/TestAdapter/Framework/MessageBasedDebuggerAttacher.cs +++ b/GoogleTestAdapter/TestAdapter/Framework/MessageBasedDebuggerAttacher.cs @@ -59,7 +59,7 @@ public bool AttachDebugger(int processId) } catch (Exception e) { - _logger.LogError($"{Resources.CouldNotAttachMessage} {processId}:{Environment.NewLine}{e}"); + _logger.LogError(String.Format(Resources.CouldNotAttachMessage, processId, Environment.NewLine, e)); } return false; } diff --git a/GoogleTestAdapter/TestAdapter/Helpers/TestCaseFilter.cs b/GoogleTestAdapter/TestAdapter/Helpers/TestCaseFilter.cs index 1f0c6cd3d..0d3378417 100644 --- a/GoogleTestAdapter/TestAdapter/Helpers/TestCaseFilter.cs +++ b/GoogleTestAdapter/TestAdapter/Helpers/TestCaseFilter.cs @@ -115,7 +115,7 @@ private ITestCaseFilterExpression GetFilterExpression() } catch (TestPlatformFormatException e) { - _logger.LogError(String.Format(Resources.TestCaseFilter, e.Message)); + _logger.LogError(String.Format(Resources.FilterInvalid, e.Message)); return null; } } @@ -140,7 +140,7 @@ private bool Matches(TestCase testCase, ITestCaseFilterExpression filterExpressi string message = matches ? String.Format(Resources.Matches, testCase.DisplayName, filterExpression.TestCaseFilterValue) - : String.Format(Resources.DontMatch, testCase.DisplayName, filterExpression.TestCaseFilterValue); + : String.Format(Resources.DoesntMatch, testCase.DisplayName, filterExpression.TestCaseFilterValue); _logger.DebugInfo(message); return matches; diff --git a/GoogleTestAdapter/TestAdapter/Resources.Designer.cs b/GoogleTestAdapter/TestAdapter/Resources.Designer.cs index da1acecfa..47df7c58f 100644 --- a/GoogleTestAdapter/TestAdapter/Resources.Designer.cs +++ b/GoogleTestAdapter/TestAdapter/Resources.Designer.cs @@ -61,16 +61,7 @@ internal Resources() { } /// - /// Looks up a localized string similar to Failed attaching debugger to process {0}: {1}. - /// - internal static string AttachDebuggerMessage { - get { - return ResourceManager.GetString("AttachDebuggerMessage", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Could not attach debugger to process. + /// Looks up a localized string similar to Could not attach debugger to process {0}:{1}{2}. /// internal static string CouldNotAttachMessage { get { @@ -108,9 +99,9 @@ internal static string DebuggingMessage { /// /// Looks up a localized string similar to {0} does not match {1}. /// - internal static string DontMatch { + internal static string DoesntMatch { get { - return ResourceManager.GetString("DontMatch", resourceCulture); + return ResourceManager.GetString("DoesntMatch", resourceCulture); } } @@ -205,7 +196,7 @@ internal static string ProcessNotFound { } /// - /// Looks up a localized string similar to Solution settings:. + /// Looks up a localized string similar to Solution settings: {0}. /// internal static string Settings { get { @@ -214,7 +205,7 @@ internal static string Settings { } /// - /// Looks up a localized string similar to Test case filter:. + /// Looks up a localized string similar to Test case filter: {0}. /// internal static string TestCaseFilter { get { @@ -330,15 +321,6 @@ internal static string VS2012Error { } } - /// - /// Looks up a localized string similar to Could not find Visual Studio instance. - /// - internal static string VSInstanceNotFound { - get { - return ResourceManager.GetString("VSInstanceNotFound", resourceCulture); - } - } - /// /// Looks up a localized string similar to Visual Studio version: {0}. /// diff --git a/GoogleTestAdapter/TestAdapter/Resources.resx b/GoogleTestAdapter/TestAdapter/Resources.resx index ca0a7c527..fe6cb3ab7 100644 --- a/GoogleTestAdapter/TestAdapter/Resources.resx +++ b/GoogleTestAdapter/TestAdapter/Resources.resx @@ -132,30 +132,23 @@ Google Test execution completed, overall duration: {0} {0} represents unlocalized duration (e.g. "02:14:18") - - Failed attaching debugger to process {0}: {1} - {0} represents a number (e.g. 5), {1} represents localized exception message (e.g. "Cannot load file") - Exception while running tests: {0} {0} represents localized exception message (e.g. "Cannot load file") - - Could not find Visual Studio instance - Could not find out Visual Studio version: {0} {0} represents localized exception message (e.g. "Cannot load file") (enable debug mode for more information) - this is used in ErrorAndWarning string + Optionally used in ErrorAndWarning string The following errors and warnings have occured during {0} {1}:{2} - {0} represents localized phase of test (e.g. TestDiscovery or TestExecution), {1} represents unlocalized hint (e.g. "enable debug mode for more information"), {2} represents a unlocalized new line string (e.g "\n") + {0} is TestDiscovery or TestExecution string, {1} is empty or EnableDebugMode string, {2} is line break - + {0} does not match {1} {0} represents an unlocalized test name (e.g. "TestSuite1.Test2"), {1} represents an unlocalized test filter value (e.g. "TestCategory=Nightly") @@ -167,10 +160,12 @@ No test case filter provided - Solution settings: + Solution settings: {0} + {0} is unlocalized list of settings - Test case filter: + Test case filter: {0} + {0} is the user-specified filter Visual Studio version: {0} @@ -184,7 +179,7 @@ ERROR: {0} - {0} represents unlocalized error message (e.g. "Cannot load file") + {0} is the error message Unknown enum literal: {0} @@ -192,15 +187,15 @@ Warning: {0} - {0} represents unlocalized warning message (e.g. "Cannot load file") + {0} is the warning message Could not identify Visual Studio version. {0} requires at least Visual Studio 2012 Update 1. - {0} represents unlocalized name for extension (e.g. "Google Test Adaptor") + {0} is ExtensionName string from Common.Dynamic.TAfGT resources file {0} requires at least Visual Studio 2012 Update 1 - please update your Visual Studio installation. - {0} represents unlocalized name for extension (e.g. "Google Test Adaptor") + {0} is ExtensionName string from Common.Dynamic.TAfGT resources file Debugging is only possible if GoogleTestAdapter has been installed into Visual Studio - NuGet installation does not support this (and other features such as Visual Studio Options, toolbar, and solution settings). @@ -214,15 +209,16 @@ {0} represents unlocalized name for trait (e.g. "Test") - Could not attach debugger to process + Could not attach debugger to process {0}:{1}{2} + {0} represents a process id (e.g. "10480"), {1} is a line break, {2} is an exception message Could not attach debugger to process {0}, no error message available - {0} represents a number for executable process Id (e.g. "10480") + {0} represents a process id (e.g. "10480") Debugger attached to process {0}, took {1} ms - {0} represents a number for executable process Id (e.g. "10480"), {1} represents a number (e.g. "12" or "14") + {0} represents a process id (e.g. "10480"), {1} represents a number (e.g. "12" or "14") There might be more information on the problem in Visual Studio's ActivityLog.xml (see e.g. https://blogs.msdn.microsoft.com/visualstudio/2010/02/24/troubleshooting-extensions-with-the-activity-log/) @@ -240,6 +236,6 @@ Unknown Visual Studio version: {0} - {0} represents unlocalized string for Visual Studio version (e.g. "15.0") + {0} is version number (e.g. "15.0") \ No newline at end of file diff --git a/GoogleTestAdapter/TestAdapter/TestAdapter.csproj b/GoogleTestAdapter/TestAdapter/TestAdapter.csproj index 48448a5c8..fe7bd3752 100644 --- a/GoogleTestAdapter/TestAdapter/TestAdapter.csproj +++ b/GoogleTestAdapter/TestAdapter/TestAdapter.csproj @@ -220,6 +220,7 @@ ResXFileCodeGenerator Resources.Designer.cs + Designer diff --git a/GoogleTestAdapter/TestAdapter/TestDiscoverer.cs b/GoogleTestAdapter/TestAdapter/TestDiscoverer.cs index a584591a2..0d1c792b9 100644 --- a/GoogleTestAdapter/TestAdapter/TestDiscoverer.cs +++ b/GoogleTestAdapter/TestAdapter/TestDiscoverer.cs @@ -12,11 +12,6 @@ namespace GoogleTestAdapter.TestAdapter { - public enum TestPhase - { - TestDiscovery, - TestExecution - } [DefaultExecutorUri(TestExecutor.ExecutorUriString)] [FileExtension(".exe")] public class TestDiscoverer : ITestDiscoverer