diff --git a/GoogleTestAdapter/Core/Helpers/TestProcessLauncher.cs b/GoogleTestAdapter/Core/Helpers/TestProcessLauncher.cs index 5869ea951..08ee5d7c8 100644 --- a/GoogleTestAdapter/Core/Helpers/TestProcessLauncher.cs +++ b/GoogleTestAdapter/Core/Helpers/TestProcessLauncher.cs @@ -1,4 +1,4 @@ -// This file has been modified by Microsoft on 8/2017. +// This file has been modified by Microsoft on 9/2017. using System; using System.Collections.Generic; @@ -83,8 +83,7 @@ private int LaunchProcessWithDebuggerAttached(string workingDirectory, string co _logger.LogInfo(String.Format(Resources.AttachDebuggerMessage, command)); if (printTestOutput) { - _logger.DebugInfo( - "Note that due to restrictions of the VS Unit Testing framework, the test executable's output can not be displayed in the test console when debugging tests!"); + _logger.DebugInfo(Resources.DebuggerAttachedOutputMessage); } _processId = handle.LaunchProcessWithDebuggerAttached(command, workingDirectory, param, _settings.GetPathExtension(command)); Process process = Process.GetProcessById(_processId.Value); diff --git a/GoogleTestAdapter/Core/Resources.Designer.cs b/GoogleTestAdapter/Core/Resources.Designer.cs index eb49339e7..60fb8945e 100644 --- a/GoogleTestAdapter/Core/Resources.Designer.cs +++ b/GoogleTestAdapter/Core/Resources.Designer.cs @@ -123,6 +123,51 @@ internal static string BatchReturnedExitCode { } } + /// + /// Looks up a localized string similar to Misc. + /// + internal static string CategoryMiscName { + get { + return ResourceManager.GetString("CategoryMiscName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parallelization. + /// + internal static string CategoryParallelizationName { + get { + return ResourceManager.GetString("CategoryParallelizationName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Runtime behavior. + /// + internal static string CategoryRuntimeBehaviorName { + get { + return ResourceManager.GetString("CategoryRuntimeBehaviorName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test execution. + /// + internal static string CategoryTestExecutionName { + get { + return ResourceManager.GetString("CategoryTestExecutionName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Regexes for trait assignment. + /// + internal static string CategoryTraitsName { + get { + return ResourceManager.GetString("CategoryTraitsName", resourceCulture); + } + } + /// /// Looks up a localized string similar to {0}Collected {1} test result(s) from result XML file {2}. /// @@ -186,6 +231,15 @@ internal static string CrashTest { } } + /// + /// Looks up a localized string similar to !! This test has probably CRASHED !!. + /// + internal static string CrashText { + get { + return ResourceManager.GetString("CrashText", resourceCulture); + } + } + /// /// 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. /// @@ -195,6 +249,15 @@ internal static string CreatedTestResults { } } + /// + /// Looks up a localized string similar to Note that due to restrictions of the VS Unit Testing framework, the test executable's output can not be displayed in the test console when debugging tests!. + /// + internal static string DebuggerAttachedOutputMessage { + get { + return ResourceManager.GetString("DebuggerAttachedOutputMessage", resourceCulture); + } + } + /// /// Looks up a localized string similar to {0}Could not delete test directory '{1}': {2}. /// @@ -204,6 +267,43 @@ internal static string DeleteTestDir { } } + /// + /// Looks up a localized string similar to {0} - directory containing the test executable. + /// + internal static string DescriptionOfExecutableDirPlaceHolder { + get { + return ResourceManager.GetString("DescriptionOfExecutableDirPlaceHolder", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} - path of a directory which can be used by the tests + ///{1} - id of the thread executing the current tests. + /// + internal static string DescriptionOfPlaceholdersForBatches { + get { + return ResourceManager.GetString("DescriptionOfPlaceholdersForBatches", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} - executable containing the tests. + /// + internal static string DescriptionOfPlaceholdersForExecutables { + get { + return ResourceManager.GetString("DescriptionOfPlaceholdersForExecutables", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} - directory of the solution (only available inside Visual Studio). + /// + internal static string DescriptionOfSolutionDirPlaceHolder { + get { + return ResourceManager.GetString("DescriptionOfSolutionDirPlaceHolder", resourceCulture); + } + } + /// /// Looks up a localized string similar to {0} does not match custom regex {1}. /// @@ -456,6 +556,460 @@ internal static string NumberOfTestsRunningMessage { } } + /// + /// Looks up a localized string similar to Additional test execution parameters. + /// + internal static string OptionAdditionalTestExecutionParams { + get { + return ResourceManager.GetString("OptionAdditionalTestExecutionParams", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Additional parameters for Google Test executable. Placeholders:. + /// + internal static string OptionAdditionalTestExecutionParamsDescription { + get { + return ResourceManager.GetString("OptionAdditionalTestExecutionParamsDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test setup batch file. + /// + internal static string OptionBatchForTestSetup { + get { + return ResourceManager.GetString("OptionBatchForTestSetup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Batch file to be executed before test execution. If tests are executed in parallel, the batch file will be executed once per thread. Placeholders:. + /// + internal static string OptionBatchForTestSetupDescription { + get { + return ResourceManager.GetString("OptionBatchForTestSetupDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test teardown batch file. + /// + internal static string OptionBatchForTestTeardown { + get { + return ResourceManager.GetString("OptionBatchForTestTeardown", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Batch file to be executed after test execution. If tests are executed in parallel, the batch file will be executed once per thread. Placeholders:. + /// + internal static string OptionBatchForTestTeardownDescription { + get { + return ResourceManager.GetString("OptionBatchForTestTeardownDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Break on failure. + /// + internal static string OptionBreakOnFailure { + get { + return ResourceManager.GetString("OptionBreakOnFailure", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If enabled, a potentially attached debugger will catch assertion failures and automatically drop into interactive mode. + ///Google Test option: {0}. + /// + internal static string OptionBreakOnFailureDescription { + get { + return ResourceManager.GetString("OptionBreakOnFailureDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Catch exceptions. + /// + internal static string OptionCatchExceptions { + get { + return ResourceManager.GetString("OptionCatchExceptions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Google Test catches exceptions by default; the according test fails and test execution continues. Choosing false lets exceptions pass through, allowing the debugger to catch them. + ///Google Test option: {0}. + /// + internal static string OptionCatchExceptionsDescription { + get { + return ResourceManager.GetString("OptionCatchExceptionsDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Print debug info. + /// + internal static string OptionDebugMode { + get { + return ResourceManager.GetString("OptionDebugMode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If true, debug output will be printed to the test console.. + /// + internal static string OptionDebugModeDescription { + get { + return ResourceManager.GetString("OptionDebugModeDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parallel test execution. + /// + internal static string OptionEnableParallelTestExecution { + get { + return ResourceManager.GetString("OptionEnableParallelTestExecution", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parallel test execution is achieved by means of different threads, each of which is assigned a number of tests to be executed. The threads will then sequentially invoke the necessary executables to produce the according test results.. + /// + internal static string OptionEnableParallelTestExecutionDescription { + get { + return ResourceManager.GetString("OptionEnableParallelTestExecutionDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Terminate processes on cancel. + /// + internal static string OptionKillProcessesOnCancel { + get { + return ResourceManager.GetString("OptionKillProcessesOnCancel", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If true, running test executables are actively terminated if the test execution is canceled. Note that terminating a test process might have all kinds of side effects; in particular, Google Test will not be able to perform any shutdown tasks.. + /// + internal static string OptionKillProcessesOnCancelDescription { + get { + return ResourceManager.GetString("OptionKillProcessesOnCancelDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Maximum number of threads. + /// + internal static string OptionMaxNrOfThreads { + get { + return ResourceManager.GetString("OptionMaxNrOfThreads", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Maximum number of threads to be used for test execution (0: one thread for each processor).. + /// + internal static string OptionMaxNrOfThreadsDescription { + get { + return ResourceManager.GetString("OptionMaxNrOfThreadsDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Number of test repetitions. + /// + internal static string OptionNrOfTestRepetitions { + get { + return ResourceManager.GetString("OptionNrOfTestRepetitions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Tests will be run for the selected number of times (-1: infinite). + ///Google Test option: {0}. + /// + internal static string OptionNrOfTestRepetitionsDescription { + get { + return ResourceManager.GetString("OptionNrOfTestRepetitionsDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parse symbol information. + /// + internal static string OptionParseSymbolInformation { + get { + return ResourceManager.GetString("OptionParseSymbolInformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parse debug symbol information for test executables to obtain source location information and traits (defined via the macros in GTA_Traits.h). + ///If this is set to false, step 2 of traits discovery will be left out and only traits regexes will be effective.. + /// + internal static string OptionParseSymbolInformationDescription { + get { + return ResourceManager.GetString("OptionParseSymbolInformationDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to PATH extension. + /// + internal static string OptionPathExtension { + get { + return ResourceManager.GetString("OptionPathExtension", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If non-empty, the content will be appended to the PATH variable of the test execution and discovery processes. + ///Example: C:\MyBins;{0}\MyOtherBins; + ///Placeholders:. + /// + internal static string OptionPathExtensionDescription { + get { + return ResourceManager.GetString("OptionPathExtensionDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Print test output. + /// + internal static string OptionPrintTestOutput { + get { + return ResourceManager.GetString("OptionPrintTestOutput", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Print the output of the Google Test executable(s) to the Tests Output window.. + /// + internal static string OptionPrintTestOutputDescription { + get { + return ResourceManager.GetString("OptionPrintTestOutputDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Also run disabled tests. + /// + internal static string OptionRunDisabledTests { + get { + return ResourceManager.GetString("OptionRunDisabledTests", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If true, all (selected) tests will be run, even if they have been disabled. + ///Google Test option: {0}. + /// + internal static string OptionRunDisabledTestsDescription { + get { + return ResourceManager.GetString("OptionRunDisabledTestsDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Show release notes after update. + /// + internal static string OptionShowReleaseNotes { + get { + return ResourceManager.GetString("OptionShowReleaseNotes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If true, a dialog with release notes is shown after the extension has been updated.. + /// + internal static string OptionShowReleaseNotesDescription { + get { + return ResourceManager.GetString("OptionShowReleaseNotesDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shuffle tests per execution. + /// + internal static string OptionShuffleTests { + get { + return ResourceManager.GetString("OptionShuffleTests", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If true, tests will be executed in random order. Note that a true randomized order is only given when executing all tests in non-parallel fashion. Otherwise, the test excutables will most likely be executed more than once - random order is than restricted to the according executions. + ///Google Test option: {0}. + /// + internal static string OptionShuffleTestsDescription { + get { + return ResourceManager.GetString("OptionShuffleTestsDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shuffle tests: Seed. + /// + internal static string OptionShuffleTestsSeed { + get { + return ResourceManager.GetString("OptionShuffleTestsSeed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 0: Seed is computed from system time, 1<=n<={0}: The given seed is used. See note of option '{1}'. + ///Google Test option: {2}. + /// + internal static string OptionShuffleTestsSeedDescription { + get { + return ResourceManager.GetString("OptionShuffleTestsSeedDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Regex for test discovery. + /// + internal static string OptionTestDiscoveryRegex { + get { + return ResourceManager.GetString("OptionTestDiscoveryRegex", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If non-empty, this regex will be used to discover the Google Test executables containing your tests. + ///Default regex: {0}. + /// + internal static string OptionTestDiscoveryRegexDescription { + get { + return ResourceManager.GetString("OptionTestDiscoveryRegexDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test discovery timeout in s. + /// + internal static string OptionTestDiscoveryTimeoutInSeconds { + get { + return ResourceManager.GetString("OptionTestDiscoveryTimeoutInSeconds", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Number of seconds after which test discovery will be assumed to have failed. 0: Infinite timeout. + /// + internal static string OptionTestDiscoveryTimeoutInSecondsDescription { + get { + return ResourceManager.GetString("OptionTestDiscoveryTimeoutInSecondsDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test name separator. + /// + internal static string OptionTestNameSeparator { + get { + return ResourceManager.GetString("OptionTestNameSeparator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Test names produced by Google Test might contain the character '/', which makes Visual Studio cut the name after the '/' if the Test Explorer window is not wide enough. This option's value, if non-empty, will replace the '/' character to avoid that behavior. Note that '\', ' ', '|', and '-' produce the same behavior ('.', '_', ':', and '::' are known to work). Note also that traits regexes are evaluated against the tests' display names (and must thus be consistent with this option).. + /// + internal static string OptionTestNameSeparatorDescription { + get { + return ResourceManager.GetString("OptionTestNameSeparatorDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Timestamp output. + /// + internal static string OptionTimestampOutput { + get { + return ResourceManager.GetString("OptionTimestampOutput", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If true, a timestamp is added to test and debug output.. + /// + internal static string OptionTimestampOutputDescription { + get { + return ResourceManager.GetString("OptionTimestampOutputDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Allows to override/add traits for testcases matching a regex. Traits are build up in 3 phases. First, traits are assigned to tests according to the 'Traits before' option. Next, the tests' traits (defined via the macros in GTA_Traits.h) are added to the tests, overriding traits from phase 1 with new values. Finally, the 'Traits after' option is evaluated, again in an overriding manner. + ///Syntax: {0} separates the regex from the traits, the trait's name and value are separated by {1} and each pair of regex an [rest of string was truncated]";. + /// + internal static string OptionTraitsDescription { + get { + return ResourceManager.GetString("OptionTraitsDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to After test discovery. + /// + internal static string OptionTraitsRegexesAfter { + get { + return ResourceManager.GetString("OptionTraitsRegexesAfter", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Before test discovery. + /// + internal static string OptionTraitsRegexesBefore { + get { + return ResourceManager.GetString("OptionTraitsRegexesBefore", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Use new test execution framework (experimental). + /// + internal static string OptionUseNewTestExecutionFramework { + get { + return ResourceManager.GetString("OptionUseNewTestExecutionFramework", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Make use of the new test execution framework. Advantages: test crash detection and test output printing also work in debug mode.. + /// + internal static string OptionUseNewTestExecutionFrameworkDescription { + get { + return ResourceManager.GetString("OptionUseNewTestExecutionFrameworkDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Working directory. + /// + internal static string OptionWorkingDir { + get { + return ResourceManager.GetString("OptionWorkingDir", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If non-empty, will set the working directory for running the tests (default: {0}) + ///Example: {1}\MyTestDir + ///Placeholders:. + /// + internal static string OptionWorkingDirDescription { + get { + return ResourceManager.GetString("OptionWorkingDirDescription", resourceCulture); + } + } + /// /// Looks up a localized string similar to Output file does not exist, did your tests crash?. /// @@ -699,6 +1253,15 @@ internal static string TestDiscoveryCancelled { } } + /// + /// Looks up a localized string similar to Test output:. + /// + internal static string TestOutput { + get { + return ResourceManager.GetString("TestOutput", 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}. /// diff --git a/GoogleTestAdapter/Core/Resources.resx b/GoogleTestAdapter/Core/Resources.resx index dbccca410..0b6703a94 100644 --- a/GoogleTestAdapter/Core/Resources.resx +++ b/GoogleTestAdapter/Core/Resources.resx @@ -145,6 +145,21 @@ {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) + + Misc + + + Parallelization + + + Runtime behavior + + + Test execution + + + Regexes for trait assignment + {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) @@ -173,14 +188,38 @@ reason is probably a crash of test {0} {0} represents an unlocalized name of test (e.g. foo) + + !! This test has probably CRASHED !! + The exclamation points and all-caps are for emphasis. + {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) + + Note that due to restrictions of the VS Unit Testing framework, the test executable's output can not be displayed in the test console when debugging tests! + {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} - directory containing the test executable + {0} represents a directory containing a test executable + + + {0} - path of a directory which can be used by the tests +{1} - id of the thread executing the current tests + {0} represents a directory. {1} represents a thread id. + + + {0} - executable containing the tests + {0} represents the path of a test executable + + + {0} - directory of the solution (only available inside Visual Studio) + {0} represents a directory containing a solution file + {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") @@ -290,6 +329,182 @@ Running {0} tests... {0} represents a number (e.g. 5) + + Additional test execution parameters + + + Additional parameters for Google Test executable. Placeholders: + Followed by a list of placeholders. + + + Test setup batch file + + + Batch file to be executed before test execution. If tests are executed in parallel, the batch file will be executed once per thread. Placeholders: + Followed by a list of placeholders. + + + Test teardown batch file + + + Batch file to be executed after test execution. If tests are executed in parallel, the batch file will be executed once per thread. Placeholders: + Followed by a list of placeholders. + + + Break on failure + + + If enabled, a potentially attached debugger will catch assertion failures and automatically drop into interactive mode. +Google Test option: {0} + {0} represents a command-line flag. + + + Catch exceptions + + + Google Test catches exceptions by default; the according test fails and test execution continues. Choosing false lets exceptions pass through, allowing the debugger to catch them. +Google Test option: {0} + {0} represents a command-line flag. + + + Print debug info + + + If true, debug output will be printed to the test console. + + + Parallel test execution + + + Parallel test execution is achieved by means of different threads, each of which is assigned a number of tests to be executed. The threads will then sequentially invoke the necessary executables to produce the according test results. + + + Terminate processes on cancel + + + If true, running test executables are actively terminated if the test execution is canceled. Note that terminating a test process might have all kinds of side effects; in particular, Google Test will not be able to perform any shutdown tasks. + + + Maximum number of threads + + + Maximum number of threads to be used for test execution (0: one thread for each processor). + + + Number of test repetitions + + + Tests will be run for the selected number of times (-1: infinite). +Google Test option: {0} + {0} represents a command-line flag. + + + Parse symbol information + + + Parse debug symbol information for test executables to obtain source location information and traits (defined via the macros in GTA_Traits.h). +If this is set to false, step 2 of traits discovery will be left out and only traits regexes will be effective. + + + PATH extension + PATH represents an environment variable and should not be localized + + + If non-empty, the content will be appended to the PATH variable of the test execution and discovery processes. +Example: C:\MyBins;{0}\MyOtherBins; +Placeholders: + {0} represents a directory. Followed by a list of placeholders. + + + Print test output + + + Print the output of the Google Test executable(s) to the Tests Output window. + + + Also run disabled tests + + + If true, all (selected) tests will be run, even if they have been disabled. +Google Test option: {0} + {0} represents a command-line flag. + + + Show release notes after update + + + If true, a dialog with release notes is shown after the extension has been updated. + + + Shuffle tests per execution + + + If true, tests will be executed in random order. Note that a true randomized order is only given when executing all tests in non-parallel fashion. Otherwise, the test excutables will most likely be executed more than once - random order is than restricted to the according executions. +Google Test option: {0} + {0} represents a command-line flag. + + + Shuffle tests: Seed + + + 0: Seed is computed from system time, 1<=n<={0}: The given seed is used. See note of option '{1}'. +Google Test option: {2} + {0} is an integer representing the maximum value of a seed. {1} represents the localized name of another option. {2} represents a command-line flag. + + + Regex for test discovery + + + If non-empty, this regex will be used to discover the Google Test executables containing your tests. +Default regex: {0} + {0} represents a regular expression + + + Test discovery timeout in s + "s" stands for seconds + + + Number of seconds after which test discovery will be assumed to have failed. 0: Infinite timeout + + + Test name separator + + + Test names produced by Google Test might contain the character '/', which makes Visual Studio cut the name after the '/' if the Test Explorer window is not wide enough. This option's value, if non-empty, will replace the '/' character to avoid that behavior. Note that '\', ' ', '|', and '-' produce the same behavior ('.', '_', ':', and '::' are known to work). Note also that traits regexes are evaluated against the tests' display names (and must thus be consistent with this option). + + + Timestamp output + + + If true, a timestamp is added to test and debug output. + + + Allows to override/add traits for testcases matching a regex. Traits are build up in 3 phases. First, traits are assigned to tests according to the 'Traits before' option. Next, the tests' traits (defined via the macros in GTA_Traits.h) are added to the tests, overriding traits from phase 1 with new values. Finally, the 'Traits after' option is evaluated, again in an overriding manner. +Syntax: {0} separates the regex from the traits, the trait's name and value are separated by {1} and each pair of regex and trait is separated by {2}. +Example: MySuite\.*{0}Type{1}Small{2}MySuite2\.*|MySuite3\.*{0}Type{1}Medium + {0} represents a string used to separate a regex from its traits. {1} represents a string used to separate names and values. {2} represents a string used to separate regexs. + + + After test discovery + + + Before test discovery + + + Use new test execution framework (experimental) + + + Make use of the new test execution framework. Advantages: test crash detection and test output printing also work in debug mode. + + + Working directory + + + If non-empty, will set the working directory for running the tests (default: {0}) +Example: {1}\MyTestDir +Placeholders: + {0} represents the default value of the working directory. {1} represents the directory containing the solution file. Followed by a list of placeholders. + Output file does not exist, did your tests crash? @@ -395,6 +610,10 @@ Test discovery was cancelled after {0} s for executable {1} {0} represents a number (e.g. 5), {1} represents an unlocalized name of executable (e.g. cmd.exe) file + + Test output: + Followed by the output of a test case + 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") diff --git a/GoogleTestAdapter/Core/Settings/SettingsWrapper.cs b/GoogleTestAdapter/Core/Settings/SettingsWrapper.cs index 7156a3dc9..680dc54b9 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 8/2017. +// This file has been modified by Microsoft on 9/2017. using System; using System.Collections.Generic; @@ -198,15 +198,11 @@ public static string ReplacePlaceholders(string userParameters, string executabl } - public const string CategoryTestExecutionName = "Test execution"; - public const string CategoryTraitsName = "Regexes for trait assignment"; - public const string CategoryRuntimeBehaviorName = "Runtime behavior"; - public const string CategoryParallelizationName = "Parallelization"; - public const string CategoryMiscName = "Misc"; - - public const string PageGeneralName = "General"; - public const string PageParallelizationName = CategoryParallelizationName; - public const string PageGoogleTestName = "Google Test"; + public static readonly string CategoryTestExecutionName = Resources.CategoryTestExecutionName; + public static readonly string CategoryTraitsName = Resources.CategoryTraitsName; + public static readonly string CategoryRuntimeBehaviorName = Resources.CategoryRuntimeBehaviorName; + public static readonly string CategoryParallelizationName = Resources.CategoryParallelizationName; + public static readonly string CategoryMiscName = Resources.CategoryMiscName; public const string SolutionDirPlaceholder = "$(SolutionDir)"; public const string TestDirPlaceholder = "$(TestDir)"; @@ -214,55 +210,49 @@ public static string ReplacePlaceholders(string userParameters, string executabl public const string ExecutablePlaceholder = "$(Executable)"; public const string ExecutableDirPlaceholder = "$(ExecutableDir)"; - private const string DescriptionOfSolutionDirPlaceHolder = - SolutionDirPlaceholder + " - directory of the solution (only available inside VS)"; + private static readonly string DescriptionOfSolutionDirPlaceHolder = + string.Format(Resources.DescriptionOfSolutionDirPlaceHolder, SolutionDirPlaceholder); - private const string DescriptionOfExecutableDirPlaceHolder = - ExecutableDirPlaceholder + " - directory containing the test executable"; + private static readonly string DescriptionOfExecutableDirPlaceHolder = + string.Format(Resources.DescriptionOfExecutableDirPlaceHolder, ExecutableDirPlaceholder); - private const string DescriptionOfPlaceholdersForBatches = - TestDirPlaceholder + " - path of a directory which can be used by the tests\n" + - ThreadIdPlaceholder + " - id of thread executing the current tests\n" + - DescriptionOfSolutionDirPlaceHolder; + private static readonly string DescriptionOfPlaceholdersForBatches = + string.Format(Resources.DescriptionOfPlaceholdersForBatches, TestDirPlaceholder, ThreadIdPlaceholder) + + "\n" + DescriptionOfSolutionDirPlaceHolder; - private const string DescriptionOfPlaceholdersForExecutables = + private static readonly string DescriptionOfPlaceholdersForExecutables = DescriptionOfPlaceholdersForBatches + "\n" + - ExecutablePlaceholder + " - executable containing the tests\n" + - DescriptionOfExecutableDirPlaceHolder; + string.Format(Resources.DescriptionOfPlaceholdersForExecutables, ExecutablePlaceholder) + + "\n" + DescriptionOfExecutableDirPlaceHolder; #region GeneralOptionsPage public virtual string DebuggingNamedPipeId => _currentSettings.DebuggingNamedPipeId; - public const string OptionUseNewTestExecutionFramework = "Use new test execution framework (experimental)"; + public static readonly string OptionUseNewTestExecutionFramework = Resources.OptionUseNewTestExecutionFramework; public const bool OptionUseNewTestExecutionFrameworkDefaultValue = true; - public const string OptionUseNewTestExecutionFrameworkDescription = - "Make use of the new test execution framework. Advantages: test crash detection and test output printing also work in debug mode."; + public static readonly string OptionUseNewTestExecutionFrameworkDescription = Resources.OptionUseNewTestExecutionFrameworkDescription; public virtual bool UseNewTestExecutionFramework => _currentSettings.UseNewTestExecutionFramework ?? OptionUseNewTestExecutionFrameworkDefaultValue; - public const string OptionPrintTestOutput = "Print test output"; + public static readonly string OptionPrintTestOutput = Resources.OptionPrintTestOutput; public const bool OptionPrintTestOutputDefaultValue = false; - public const string OptionPrintTestOutputDescription = - "Print the output of the Google Test executable(s) to the Tests Output window."; + public static readonly string OptionPrintTestOutputDescription = Resources.OptionPrintTestOutputDescription; public virtual bool PrintTestOutput => _currentSettings.PrintTestOutput ?? OptionPrintTestOutputDefaultValue; - public const string OptionTestDiscoveryRegex = "Regex for test discovery"; + public static readonly string OptionTestDiscoveryRegex = Resources.OptionTestDiscoveryRegex; public const string OptionTestDiscoveryRegexDefaultValue = ""; - public const string OptionTestDiscoveryRegexDescription = - "If non-empty, this regex will be used to discover the Google Test executables containing your tests.\nDefault regex: " - + TestFinderRegex; + public static readonly string OptionTestDiscoveryRegexDescription = string.Format(Resources.OptionTestDiscoveryRegexDescription, TestFinderRegex); public virtual string TestDiscoveryRegex => _currentSettings.TestDiscoveryRegex ?? OptionTestDiscoveryRegexDefaultValue; - public const string OptionTestDiscoveryTimeoutInSeconds = "Test discovery timeout in s"; + public static readonly string OptionTestDiscoveryTimeoutInSeconds = Resources.OptionTestDiscoveryTimeoutInSeconds; public const int OptionTestDiscoveryTimeoutInSecondsDefaultValue = 30; - public const string OptionTestDiscoveryTimeoutInSecondsDescription = - "Number of seconds after which test discovery will be assumed to have failed. 0: Infinite timeout"; + public static readonly string OptionTestDiscoveryTimeoutInSecondsDescription = Resources.OptionTestDiscoveryTimeoutInSecondsDescription; public virtual int TestDiscoveryTimeoutInSeconds { get @@ -276,20 +266,20 @@ public virtual int TestDiscoveryTimeoutInSeconds { } - public const string OptionWorkingDir = "Working directory"; + public static readonly string OptionWorkingDir = Resources.OptionWorkingDir; public const string OptionWorkingDirDefaultValue = ExecutableDirPlaceholder; - public const string OptionWorkingDirDescription = - "If non-empty, will set the working directory for running the tests (default: " + DescriptionOfExecutableDirPlaceHolder + ").\nExample: " + SolutionDirPlaceholder + "\\MyTestDir\nPlaceholders:\n" - + DescriptionOfExecutableDirPlaceHolder + "\n" + DescriptionOfSolutionDirPlaceHolder; + public static readonly string OptionWorkingDirDescription = + string.Format(Resources.OptionWorkingDirDescription, DescriptionOfExecutableDirPlaceHolder, SolutionDirPlaceholder) + + "\n" + DescriptionOfExecutableDirPlaceHolder + "\n" + DescriptionOfSolutionDirPlaceHolder; public virtual string WorkingDir => _currentSettings.WorkingDir ?? OptionWorkingDirDefaultValue; - public const string OptionPathExtension = "PATH extension"; + public static readonly string OptionPathExtension = Resources.OptionPathExtension; public const string OptionPathExtensionDefaultValue = ""; - public const string OptionPathExtensionDescription = - "If non-empty, the content will be appended to the PATH variable of the test execution and discovery processes.\nExample: C:\\MyBins;" + ExecutableDirPlaceholder + "\\MyOtherBins;\nPlaceholders:\n" - + DescriptionOfExecutableDirPlaceHolder; + public static readonly string OptionPathExtensionDescription = + string.Format(Resources.OptionPathExtensionDescription, ExecutableDirPlaceholder) + + "\n" + DescriptionOfExecutableDirPlaceHolder; public virtual string PathExtension => _currentSettings.PathExtension ?? OptionPathExtensionDefaultValue; @@ -298,21 +288,13 @@ public virtual int TestDiscoveryTimeoutInSeconds { public const string TraitsRegexesRegexSeparator = "///"; public const string TraitsRegexesTraitSeparator = ","; public const string OptionTraitsRegexesDefaultValue = ""; - public const string OptionTraitsDescription = "Allows to override/add traits for testcases matching a regex. Traits are build up in 3 phases: 1st, traits are assigned to tests according to the 'Traits before' option. 2nd, the tests' traits (defined via the macros in GTA_Traits.h) are added to the tests, overriding traits from phase 1 with new values. 3rd, the 'Traits after' option is evaluated, again in an overriding manner.\nSyntax: " - + TraitsRegexesRegexSeparator + - " separates the regex from the traits, the trait's name and value are separated by " - + TraitsRegexesTraitSeparator + - " and each pair of regex and trait is separated by " - + TraitsRegexesPairSeparator + ".\nExample: " + - @"MySuite\.*" - + TraitsRegexesRegexSeparator + "Type" - + TraitsRegexesTraitSeparator + "Small" - + TraitsRegexesPairSeparator + - @"MySuite2\.*|MySuite3\.*" - + TraitsRegexesRegexSeparator + "Type" - + TraitsRegexesTraitSeparator + "Medium"; - - public const string OptionTraitsRegexesBefore = "Before test discovery"; + public static readonly string OptionTraitsDescription = string.Format( + Resources.OptionTraitsDescription, + TraitsRegexesRegexSeparator, + TraitsRegexesTraitSeparator, + TraitsRegexesPairSeparator); + + public static readonly string OptionTraitsRegexesBefore = Resources.OptionTraitsRegexesBefore; public virtual List TraitsRegexesBefore { @@ -323,7 +305,7 @@ public virtual List TraitsRegexesBefore } } - public const string OptionTraitsRegexesAfter = "After test discovery"; + public static readonly string OptionTraitsRegexesAfter = Resources.OptionTraitsRegexesAfter; public virtual List TraitsRegexesAfter { @@ -335,77 +317,70 @@ public virtual List TraitsRegexesAfter } - public const string OptionTestNameSeparator = "Test name separator"; + public static readonly string OptionTestNameSeparator = Resources.OptionTestNameSeparator; public const string OptionTestNameSeparatorDefaultValue = ""; - public const string OptionTestNameSeparatorDescription = - "Test names produced by Google Test might contain the character '/', which makes VS cut the name after the '/' if the test explorer window is not wide enough. This option's value, if non-empty, will replace the '/' character to avoid that behavior. Note that '\\', ' ', '|', and '-' produce the same behavior ('.', '_', ':', and '::' are known to work - there might be more). Note also that traits regexes are evaluated against the tests' display names (and must thus be consistent with this option)."; + public static readonly string OptionTestNameSeparatorDescription = Resources.OptionTestNameSeparatorDescription; public virtual string TestNameSeparator => _currentSettings.TestNameSeparator ?? OptionTestNameSeparatorDefaultValue; - public const string OptionParseSymbolInformation = "Parse symbol information"; + public static readonly string OptionParseSymbolInformation = Resources.OptionParseSymbolInformation; public const bool OptionParseSymbolInformationDefaultValue = true; - public const string OptionParseSymbolInformationDescription = - "Parse debug symbol information for test executables to obtain source location information and traits (defined via the macros in GTA_Traits.h).\n" + - "If this is set to false step 2 of traits discovery will be left out and only traits regexes will be effective."; + public static readonly string OptionParseSymbolInformationDescription = Resources.OptionParseSymbolInformationDescription; public virtual bool ParseSymbolInformation => _currentSettings.ParseSymbolInformation ?? OptionParseSymbolInformationDefaultValue; - public const string OptionDebugMode = "Print debug info"; + public static readonly string OptionDebugMode = Resources.OptionDebugMode; public const bool OptionDebugModeDefaultValue = false; - public const string OptionDebugModeDescription = - "If true, debug output will be printed to the test console."; + public static readonly string OptionDebugModeDescription = Resources.OptionDebugModeDescription; public virtual bool DebugMode => _currentSettings.DebugMode ?? OptionDebugModeDefaultValue; - public const string OptionTimestampOutput = "Timestamp output"; + public static readonly string OptionTimestampOutput = Resources.OptionTimestampOutput; public const bool OptionTimestampOutputDefaultValue = false; - public const string OptionTimestampOutputDescription = - "If true, a timestamp is added to test and debug output."; + public static readonly string OptionTimestampOutputDescription = Resources.OptionTimestampOutputDescription; public virtual bool TimestampOutput => _currentSettings.TimestampOutput ?? OptionTimestampOutputDefaultValue; - public const string OptionShowReleaseNotes = "Show release notes after update"; + public static readonly string OptionShowReleaseNotes = Resources.OptionShowReleaseNotes; public const bool OptionShowReleaseNotesDefaultValue = true; - public const string OptionShowReleaseNotesDescription = - "If true, a dialog with release notes is shown after the extension has been updated."; + public static readonly string OptionShowReleaseNotesDescription = Resources.OptionShowReleaseNotesDescription; public virtual bool ShowReleaseNotes => _currentSettings.ShowReleaseNotes ?? OptionShowReleaseNotesDefaultValue; - public const string OptionAdditionalTestExecutionParams = "Additional test execution parameters"; + public static readonly string OptionAdditionalTestExecutionParams = Resources.OptionAdditionalTestExecutionParams; public const string OptionAdditionalTestExecutionParamsDefaultValue = ""; - public const string OptionAdditionalTestExecutionParamsDescription = - "Additional parameters for Google Test executable. Placeholders:\n" - + DescriptionOfPlaceholdersForExecutables; + public static readonly string OptionAdditionalTestExecutionParamsDescription = + Resources.OptionAdditionalTestExecutionParamsDescription + + "\n" + DescriptionOfPlaceholdersForExecutables; public virtual string AdditionalTestExecutionParam => _currentSettings.AdditionalTestExecutionParam ?? OptionAdditionalTestExecutionParamsDefaultValue; - public const string OptionBatchForTestSetup = "Test setup batch file"; + public static readonly string OptionBatchForTestSetup = Resources.OptionBatchForTestSetup; public const string OptionBatchForTestSetupDefaultValue = ""; - public const string OptionBatchForTestSetupDescription = - "Batch file to be executed before test execution. If tests are executed in parallel, the batch file will be executed once per thread. Placeholders:\n" - + DescriptionOfPlaceholdersForBatches; + public static readonly string OptionBatchForTestSetupDescription = + Resources.OptionBatchForTestSetupDescription + + "\n" + DescriptionOfPlaceholdersForBatches; public virtual string BatchForTestSetup => _currentSettings.BatchForTestSetup ?? OptionBatchForTestSetupDefaultValue; - public const string OptionBatchForTestTeardown = "Test teardown batch file"; + public static readonly string OptionBatchForTestTeardown = Resources.OptionBatchForTestTeardown; public const string OptionBatchForTestTeardownDefaultValue = ""; - public const string OptionBatchForTestTeardownDescription = - "Batch file to be executed after test execution. If tests are executed in parallel, the batch file will be executed once per thread. Placeholders:\n" - + DescriptionOfPlaceholdersForBatches; + public static readonly string OptionBatchForTestTeardownDescription = + Resources.OptionBatchForTestTeardownDescription + + "\n" + DescriptionOfPlaceholdersForBatches; public virtual string BatchForTestTeardown => _currentSettings.BatchForTestTeardown ?? OptionBatchForTestTeardownDefaultValue; - public const string OptionKillProcessesOnCancel = "Kill processes on cancel"; + public static readonly string OptionKillProcessesOnCancel = Resources.OptionKillProcessesOnCancel; public const bool OptionKillProcessesOnCancelDefaultValue = false; - public const string OptionKillProcessesOnCancelDescription = - "If true, running test executables are actively killed if the test execution is canceled. Note that killing a test process might have all kinds of side effects; in particular, Google Test will not be able to perform any shutdown tasks."; + public static readonly string OptionKillProcessesOnCancelDescription = Resources.OptionKillProcessesOnCancelDescription; public virtual bool KillProcessesOnCancel => _currentSettings.KillProcessesOnCancel ?? OptionKillProcessesOnCancelDefaultValue; @@ -413,18 +388,16 @@ public virtual List TraitsRegexesAfter #region ParallelizationOptionsPage - public const string OptionEnableParallelTestExecution = "Parallel test execution"; + public static readonly string OptionEnableParallelTestExecution = Resources.OptionEnableParallelTestExecution; public const bool OptionEnableParallelTestExecutionDefaultValue = false; - public const string OptionEnableParallelTestExecutionDescription = - "Parallel test execution is achieved by means of different threads, each of which is assigned a number of tests to be executed. The threads will then sequentially invoke the necessary executables to produce the according test results."; + public static readonly string OptionEnableParallelTestExecutionDescription = Resources.OptionEnableParallelTestExecutionDescription; public virtual bool ParallelTestExecution => _currentSettings.ParallelTestExecution ?? OptionEnableParallelTestExecutionDefaultValue; - public const string OptionMaxNrOfThreads = "Maximum number of threads"; + public static readonly string OptionMaxNrOfThreads = Resources.OptionMaxNrOfThreads; public const int OptionMaxNrOfThreadsDefaultValue = 0; - public const string OptionMaxNrOfThreadsDescription = - "Maximum number of threads to be used for test execution (0: one thread for each processor)."; + public static readonly string OptionMaxNrOfThreadsDescription = Resources.OptionMaxNrOfThreadsDescription; public virtual int MaxNrOfThreads { @@ -443,38 +416,34 @@ public virtual int MaxNrOfThreads #region GoogleTestOptionsPage - public const string OptionCatchExceptions = "Catch exceptions"; + public static readonly string OptionCatchExceptions = Resources.OptionCatchExceptions; public const bool OptionCatchExceptionsDefaultValue = true; - public const string OptionCatchExceptionsDescription = - "Google Test catches exceptions by default; the according test fails and test execution continues. Choosing false lets exceptions pass through, allowing the debugger to catch them.\n" - + "Google Test option:" + GoogleTestConstants.CatchExceptions; + public static readonly string OptionCatchExceptionsDescription = + string.Format(Resources.OptionCatchExceptionsDescription, GoogleTestConstants.CatchExceptions); public virtual bool CatchExceptions => _currentSettings.CatchExceptions ?? OptionCatchExceptionsDefaultValue; - public const string OptionBreakOnFailure = "Break on failure"; + public static readonly string OptionBreakOnFailure = Resources.OptionBreakOnFailure; public const bool OptionBreakOnFailureDefaultValue = false; - public const string OptionBreakOnFailureDescription = - "If enabled, a potentially attached debugger will catch assertion failures and automatically drop into interactive mode.\n" - + "Google Test option:" + GoogleTestConstants.BreakOnFailure; + public static readonly string OptionBreakOnFailureDescription = + string.Format(Resources.OptionBreakOnFailureDescription, GoogleTestConstants.BreakOnFailure); public virtual bool BreakOnFailure => _currentSettings.BreakOnFailure ?? OptionBreakOnFailureDefaultValue; - public const string OptionRunDisabledTests = "Also run disabled tests"; + public static readonly string OptionRunDisabledTests = Resources.OptionRunDisabledTests; public const bool OptionRunDisabledTestsDefaultValue = false; - public const string OptionRunDisabledTestsDescription = - "If true, all (selected) tests will be run, even if they have been disabled.\n" - + "Google Test option:" + GoogleTestConstants.AlsoRunDisabledTestsOption; + public static readonly string OptionRunDisabledTestsDescription = + string.Format(Resources.OptionRunDisabledTestsDescription, GoogleTestConstants.AlsoRunDisabledTestsOption); public virtual bool RunDisabledTests => _currentSettings.RunDisabledTests ?? OptionRunDisabledTestsDefaultValue; - public const string OptionNrOfTestRepetitions = "Number of test repetitions"; + public static readonly string OptionNrOfTestRepetitions = Resources.OptionNrOfTestRepetitions; public const int OptionNrOfTestRepetitionsDefaultValue = 1; - public const string OptionNrOfTestRepetitionsDescription = - "Tests will be run for the selected number of times (-1: infinite).\n" - + "Google Test option:" + GoogleTestConstants.NrOfRepetitionsOption; + public static readonly string OptionNrOfTestRepetitionsDescription = + string.Format(Resources.OptionNrOfTestRepetitionsDescription, GoogleTestConstants.NrOfRepetitionsOption); public virtual int NrOfTestRepetitions { @@ -490,23 +459,21 @@ public virtual int NrOfTestRepetitions } - public const string OptionShuffleTests = "Shuffle tests per execution"; + public static readonly string OptionShuffleTests = Resources.OptionShuffleTests; public const bool OptionShuffleTestsDefaultValue = false; - public const string OptionShuffleTestsDescription = - "If true, tests will be executed in random order. Note that a true randomized order is only given when executing all tests in non-parallel fashion. Otherwise, the test excutables will most likely be executed more than once - random order is than restricted to the according executions.\n" - + "Google Test option:" + GoogleTestConstants.ShuffleTestsOption; + public static readonly string OptionShuffleTestsDescription = + string.Format(Resources.OptionShuffleTestsDescription, GoogleTestConstants.ShuffleTestsOption); public virtual bool ShuffleTests => _currentSettings.ShuffleTests ?? OptionShuffleTestsDefaultValue; - public const string OptionShuffleTestsSeed = "Shuffle tests: Seed"; + public static readonly string OptionShuffleTestsSeed = Resources.OptionShuffleTestsSeed; public const int OptionShuffleTestsSeedDefaultValue = GoogleTestConstants.ShuffleTestsSeedDefaultValue; - public const string OptionShuffleTestsSeedDescription = "0: Seed is computed from system time, 1<=n<=" - + GoogleTestConstants.ShuffleTestsSeedMaxValueAsString - + ": The given seed is used. See note of option '" - + OptionShuffleTests - + "'.\n" - + "Google Test option:" + GoogleTestConstants.ShuffleTestsSeedOption; + public static readonly string OptionShuffleTestsSeedDescription = string.Format( + Resources.OptionShuffleTestsSeedDescription, + GoogleTestConstants.ShuffleTestsSeedMaxValueAsString, + Resources.OptionShuffleTests, + GoogleTestConstants.ShuffleTestsSeedOption); public virtual int ShuffleTestsSeed { diff --git a/GoogleTestAdapter/Core/TestResults/StandardOutputTestResultParser.cs b/GoogleTestAdapter/Core/TestResults/StandardOutputTestResultParser.cs index 15c4b79f8..1e32e64bf 100644 --- a/GoogleTestAdapter/Core/TestResults/StandardOutputTestResultParser.cs +++ b/GoogleTestAdapter/Core/TestResults/StandardOutputTestResultParser.cs @@ -1,4 +1,4 @@ -// This file has been modified by Microsoft on 8/2017. +// This file has been modified by Microsoft on 9/2017. using System; using System.Collections.Generic; @@ -16,7 +16,7 @@ public class StandardOutputTestResultParser public const string Failed = "[ FAILED ]"; public const string Passed = "[ OK ]"; - public const string CrashText = "!! This test has probably CRASHED !!"; + public static readonly string CrashText = Resources.CrashText; /// /// 1000 ticks = 0.1ms to make sure VS shows "<1ms" diff --git a/GoogleTestAdapter/Core/TestResults/StreamingStandardOutputTestResultParser.cs b/GoogleTestAdapter/Core/TestResults/StreamingStandardOutputTestResultParser.cs index e4bdc5526..45550a1d5 100644 --- a/GoogleTestAdapter/Core/TestResults/StreamingStandardOutputTestResultParser.cs +++ b/GoogleTestAdapter/Core/TestResults/StreamingStandardOutputTestResultParser.cs @@ -1,4 +1,4 @@ -// This file has been modified by Microsoft on 8/2017. +// This file has been modified by Microsoft on 9/2017. using System; using System.Collections.Generic; @@ -158,7 +158,7 @@ private TestResult CreateTestResult() CrashedTestCase = testCase; string message = StandardOutputTestResultParser.CrashText; - message += errorMsg == "" ? "" : $"\nTest output:\n\n{errorMsg}"; + message += errorMsg == "" ? "" : ("\n" + Resources.TestOutput + $"\n\n{errorMsg}"); TestResult result = StandardOutputTestResultParser.CreateFailedTestResult( testCase, TimeSpan.FromMilliseconds(0), diff --git a/GoogleTestAdapter/TestAdapter/Resources.Designer.cs b/GoogleTestAdapter/TestAdapter/Resources.Designer.cs index 47df7c58f..8499ed310 100644 --- a/GoogleTestAdapter/TestAdapter/Resources.Designer.cs +++ b/GoogleTestAdapter/TestAdapter/Resources.Designer.cs @@ -60,6 +60,16 @@ internal Resources() { } } + /// + /// Looks up a localized string similar to Solution test settings file could not be parsed, check file: {0} + ///Exception: {1}. + /// + internal static string CantParseSettings { + get { + return ResourceManager.GetString("CantParseSettings", resourceCulture); + } + } + /// /// Looks up a localized string similar to Could not attach debugger to process {0}:{1}{2}. /// @@ -195,6 +205,15 @@ internal static string ProcessNotFound { } } + /// + /// Looks up a localized string similar to RunSettingsDocument does not contain a RunSettings node! Canceling settings merging.... + /// + internal static string RunSettingsMissingNode { + get { + return ResourceManager.GetString("RunSettingsMissingNode", resourceCulture); + } + } + /// /// Looks up a localized string similar to Solution settings: {0}. /// @@ -204,6 +223,15 @@ internal static string Settings { } } + /// + /// Looks up a localized string similar to Solution test settings file found at '{0}', but does not contain {1} node. + /// + internal static string SolutionFoundButMissingNode { + get { + return ResourceManager.GetString("SolutionFoundButMissingNode", resourceCulture); + } + } + /// /// Looks up a localized string similar to Test case filter: {0}. /// diff --git a/GoogleTestAdapter/TestAdapter/Resources.resx b/GoogleTestAdapter/TestAdapter/Resources.resx index fe6cb3ab7..09698c624 100644 --- a/GoogleTestAdapter/TestAdapter/Resources.resx +++ b/GoogleTestAdapter/TestAdapter/Resources.resx @@ -238,4 +238,16 @@ Unknown Visual Studio version: {0} {0} is version number (e.g. "15.0") + + Solution test settings file could not be parsed, check file: {0} +Exception: {1} + {0} represents the path to a solution test settings file. {1} represents a textual summary of an exception, likely non-localized. + + + RunSettingsDocument does not contain a RunSettings node! Canceling settings merging... + + + Solution test settings file found at '{0}', but does not contain {1} node + {0} represents the path to a solution test settings file. {1} represents the non-localized name of an XML node. + \ No newline at end of file diff --git a/GoogleTestAdapter/TestAdapter/Settings/RunSettingsService.cs b/GoogleTestAdapter/TestAdapter/Settings/RunSettingsService.cs index 5102fb48a..871ed5679 100644 --- a/GoogleTestAdapter/TestAdapter/Settings/RunSettingsService.cs +++ b/GoogleTestAdapter/TestAdapter/Settings/RunSettingsService.cs @@ -1,4 +1,4 @@ -// This file has been modified by Microsoft on 6/2017. +// This file has been modified by Microsoft on 9/2017. using EnvDTE; using GoogleTestAdapter.Settings; @@ -37,7 +37,7 @@ public IXPathNavigable AddRunSettings(IXPathNavigable runSettingDocument, Debug.Assert(runSettingsNavigator != null, "userRunSettingsNavigator == null!"); if (!runSettingsNavigator.MoveToChild(Constants.RunSettingsName, "")) { - logger.Log(MessageLevel.Warning, "RunSettingsDocument does not contain a RunSettings node! Canceling settings merging..."); + logger.Log(MessageLevel.Warning, Resources.RunSettingsMissingNode); return runSettingsNavigator; } @@ -72,7 +72,7 @@ public IXPathNavigable AddRunSettings(IXPathNavigable runSettingDocument, } else { - logger.Log(MessageLevel.Warning, $"Solution test settings file found at '{solutionRunSettingsFile}', but does not contain {Constants.RunSettingsName} node"); + logger.Log(MessageLevel.Warning, string.Format(Resources.SolutionFoundButMissingNode, solutionRunSettingsFile, Constants.RunSettingsName)); } } } @@ -80,7 +80,7 @@ public IXPathNavigable AddRunSettings(IXPathNavigable runSettingDocument, catch (Exception e) { logger.Log(MessageLevel.Warning, - $"Solution test settings file could not be parsed, check file: {solutionRunSettingsFile}{Environment.NewLine}Exception: {e}"); + string.Format(Resources.CantParseSettings, solutionRunSettingsFile, e)); } foreach (var projectSettings in settingsContainer.ProjectSettings) diff --git a/GoogleTestAdapter/VsPackage.GTA/OptionsPages/GeneralOptionsDialogPage.cs b/GoogleTestAdapter/VsPackage.GTA/OptionsPages/GeneralOptionsDialogPage.cs index 38f3e75e3..5edb22d56 100644 --- a/GoogleTestAdapter/VsPackage.GTA/OptionsPages/GeneralOptionsDialogPage.cs +++ b/GoogleTestAdapter/VsPackage.GTA/OptionsPages/GeneralOptionsDialogPage.cs @@ -1,16 +1,15 @@ -// This file has been modified by Microsoft on 6/2017. +// This file has been modified by Microsoft on 9/2017. using GoogleTestAdapter.Settings; -using System.ComponentModel; namespace GoogleTestAdapter.VsPackage.OptionsPages { public partial class GeneralOptionsDialogPage : NotifyingDialogPage { - [Category(SettingsWrapper.CategoryMiscName)] - [DisplayName(SettingsWrapper.OptionShowReleaseNotes)] - [Description(SettingsWrapper.OptionShowReleaseNotesDescription)] + [LocalizedCategory("CategoryMiscName")] + [LocalizedDisplayName("OptionShowReleaseNotes")] + [LocalizedDescription("OptionShowReleaseNotesDescription")] public bool ShowReleaseNotes { get { return _showReleaseNotes; } diff --git a/GoogleTestAdapter/VsPackage.Shared/GoogleTestExtensionOptionsPage.cs b/GoogleTestAdapter/VsPackage.Shared/GoogleTestExtensionOptionsPage.cs index c08efb52f..0c40173ee 100644 --- a/GoogleTestAdapter/VsPackage.Shared/GoogleTestExtensionOptionsPage.cs +++ b/GoogleTestAdapter/VsPackage.Shared/GoogleTestExtensionOptionsPage.cs @@ -1,4 +1,4 @@ -// This file has been modified by Microsoft on 7/2017. +// This file has been modified by Microsoft on 9/2017. using GoogleTestAdapter.Settings; using GoogleTestAdapter.TestAdapter.Settings; @@ -23,9 +23,9 @@ namespace GoogleTestAdapter.VsPackage [InstalledProductRegistration("#110", "#112", "1.0", IconResourceID = 400)] // Info on this package for Help/About [Guid(PackageGuidString)] [SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1650:ElementDocumentationMustBeSpelledCorrectly", Justification = "pkgdef, VS and vsixmanifest are valid VS terms")] - [ProvideOptionPage(typeof(GeneralOptionsDialogPage), OptionsCategoryName, SettingsWrapper.PageGeneralName, 0, 0, true)] - [ProvideOptionPage(typeof(ParallelizationOptionsDialogPage), OptionsCategoryName, SettingsWrapper.PageParallelizationName, 0, 0, true)] - [ProvideOptionPage(typeof(GoogleTestOptionsDialogPage), OptionsCategoryName, SettingsWrapper.PageGoogleTestName, 0, 0, true)] + [ProvideOptionPage(typeof(GeneralOptionsDialogPage), OptionsCategoryName, "General", 110, 501, true)] + [ProvideOptionPage(typeof(ParallelizationOptionsDialogPage), OptionsCategoryName, "Parallelization", 110, 502, true)] + [ProvideOptionPage(typeof(GoogleTestOptionsDialogPage), OptionsCategoryName, "Google Test", 110, 503, true)] [ProvideAutoLoad(UIContextGuids.SolutionExists)] [ProvideMenuResource("Menus.ctmenu", 1)] public sealed partial class GoogleTestExtensionOptionsPage : Package, IGoogleTestExtensionOptionsPage, IDisposable diff --git a/GoogleTestAdapter/VsPackage.Shared/OptionsPages/GeneralOptionsDialogPage.cs b/GoogleTestAdapter/VsPackage.Shared/OptionsPages/GeneralOptionsDialogPage.cs index e616ff4b4..21e70c619 100644 --- a/GoogleTestAdapter/VsPackage.Shared/OptionsPages/GeneralOptionsDialogPage.cs +++ b/GoogleTestAdapter/VsPackage.Shared/OptionsPages/GeneralOptionsDialogPage.cs @@ -1,9 +1,8 @@ -// This file has been modified by Microsoft on 7/2017. +// This file has been modified by Microsoft on 9/2017. using GoogleTestAdapter.Helpers; using GoogleTestAdapter.Settings; using System; -using System.ComponentModel; using System.Diagnostics.CodeAnalysis; namespace GoogleTestAdapter.VsPackage.OptionsPages @@ -14,9 +13,9 @@ public partial class GeneralOptionsDialogPage : NotifyingDialogPage { #region Test execution - [Category(SettingsWrapper.CategoryTestExecutionName)] - [DisplayName(SettingsWrapper.OptionTestDiscoveryRegex)] - [Description(SettingsWrapper.OptionTestDiscoveryRegexDescription)] + [LocalizedCategory("CategoryTestExecutionName")] + [LocalizedDisplayName("OptionTestDiscoveryRegex")] + [LocalizedDescription("OptionTestDiscoveryRegexDescription")] public string TestDiscoveryRegex { get { return _testDiscoveryRegex; } @@ -28,9 +27,9 @@ public string TestDiscoveryRegex } private string _testDiscoveryRegex = SettingsWrapper.OptionTestDiscoveryRegexDefaultValue; - [Category(SettingsWrapper.CategoryTestExecutionName)] - [DisplayName(SettingsWrapper.OptionTestDiscoveryTimeoutInSeconds)] - [Description(SettingsWrapper.OptionTestDiscoveryTimeoutInSecondsDescription)] + [LocalizedCategory("CategoryTestExecutionName")] + [LocalizedDisplayName("OptionTestDiscoveryTimeoutInSeconds")] + [LocalizedDescription("OptionTestDiscoveryTimeoutInSecondsDescription")] public int TestDiscoveryTimeoutInSeconds { get { return _testDiscoveryTimeoutInSeconds; } @@ -43,9 +42,9 @@ public int TestDiscoveryTimeoutInSeconds } private int _testDiscoveryTimeoutInSeconds = SettingsWrapper.OptionTestDiscoveryTimeoutInSecondsDefaultValue; - [Category(SettingsWrapper.CategoryTestExecutionName)] - [DisplayName(SettingsWrapper.OptionWorkingDir)] - [Description(SettingsWrapper.OptionWorkingDirDescription)] + [LocalizedCategory("CategoryTestExecutionName")] + [LocalizedDisplayName("OptionWorkingDir")] + [LocalizedDescription("OptionWorkingDirDescription")] public string WorkingDir { get { return _workingDirectory; } @@ -53,9 +52,9 @@ public string WorkingDir } private string _workingDirectory = SettingsWrapper.OptionWorkingDirDefaultValue; - [Category(SettingsWrapper.CategoryTestExecutionName)] - [DisplayName(SettingsWrapper.OptionPathExtension)] - [Description(SettingsWrapper.OptionPathExtensionDescription)] + [LocalizedCategory("CategoryTestExecutionName")] + [LocalizedDisplayName("OptionPathExtension")] + [LocalizedDescription("OptionPathExtensionDescription")] public string PathExtension { get { return _pathExtension; } @@ -63,9 +62,9 @@ public string PathExtension } private string _pathExtension = SettingsWrapper.OptionPathExtensionDefaultValue; - [Category(SettingsWrapper.CategoryTestExecutionName)] - [DisplayName(SettingsWrapper.OptionAdditionalTestExecutionParams)] - [Description(SettingsWrapper.OptionAdditionalTestExecutionParamsDescription)] + [LocalizedCategory("CategoryTestExecutionName")] + [LocalizedDisplayName("OptionAdditionalTestExecutionParams")] + [LocalizedDescription("OptionAdditionalTestExecutionParamsDescription")] public string AdditionalTestExecutionParams { get { return _additionalTestExecutionParams; } @@ -73,9 +72,9 @@ public string AdditionalTestExecutionParams } private string _additionalTestExecutionParams = SettingsWrapper.OptionAdditionalTestExecutionParamsDefaultValue; - [Category(SettingsWrapper.CategoryTestExecutionName)] - [DisplayName(SettingsWrapper.OptionBatchForTestSetup)] - [Description(SettingsWrapper.OptionBatchForTestSetupDescription)] + [LocalizedCategory("CategoryTestExecutionName")] + [LocalizedDisplayName("OptionBatchForTestSetup")] + [LocalizedDescription("OptionBatchForTestSetupDescription")] public string BatchForTestSetup { get { return _batchForTestSetup; } @@ -83,9 +82,9 @@ public string BatchForTestSetup } private string _batchForTestSetup = SettingsWrapper.OptionBatchForTestSetupDefaultValue; - [Category(SettingsWrapper.CategoryTestExecutionName)] - [DisplayName(SettingsWrapper.OptionBatchForTestTeardown)] - [Description(SettingsWrapper.OptionBatchForTestTeardownDescription)] + [LocalizedCategory("CategoryTestExecutionName")] + [LocalizedDisplayName("OptionBatchForTestTeardown")] + [LocalizedDescription("OptionBatchForTestTeardownDescription")] public string BatchForTestTeardown { get { return _batchForTestTeardown; } @@ -93,9 +92,9 @@ public string BatchForTestTeardown } private string _batchForTestTeardown = SettingsWrapper.OptionBatchForTestTeardownDefaultValue; - [Category(SettingsWrapper.CategoryTestExecutionName)] - [DisplayName(SettingsWrapper.OptionKillProcessesOnCancel)] - [Description(SettingsWrapper.OptionKillProcessesOnCancelDescription)] + [LocalizedCategory("CategoryTestExecutionName")] + [LocalizedDisplayName("OptionKillProcessesOnCancel")] + [LocalizedDescription("OptionKillProcessesOnCancelDescription")] public bool KillProcessesOnCancel { get { return _killProcessesOnCancel; } @@ -107,9 +106,9 @@ public bool KillProcessesOnCancel #region Traits - [Category(SettingsWrapper.CategoryTraitsName)] - [DisplayName(SettingsWrapper.OptionTraitsRegexesBefore)] - [Description(SettingsWrapper.OptionTraitsDescription)] + [LocalizedCategory("CategoryTraitsName")] + [LocalizedDisplayName("OptionTraitsRegexesBefore")] + [LocalizedDescription("OptionTraitsDescription")] public string TraitsRegexesBefore { get { return _traitsRegexesBefore; } @@ -121,9 +120,9 @@ public string TraitsRegexesBefore } private string _traitsRegexesBefore = SettingsWrapper.OptionTraitsRegexesDefaultValue; - [Category(SettingsWrapper.CategoryTraitsName)] - [DisplayName(SettingsWrapper.OptionTraitsRegexesAfter)] - [Description(SettingsWrapper.OptionTraitsDescription)] + [LocalizedCategory("CategoryTraitsName")] + [LocalizedDisplayName("OptionTraitsRegexesAfter")] + [LocalizedDescription("OptionTraitsDescription")] public string TraitsRegexesAfter { get { return _traitsRegexesAfter; } @@ -139,9 +138,9 @@ public string TraitsRegexesAfter #region Misc - [Category(SettingsWrapper.CategoryMiscName)] - [DisplayName(SettingsWrapper.OptionUseNewTestExecutionFramework)] - [Description(SettingsWrapper.OptionUseNewTestExecutionFrameworkDescription)] + [LocalizedCategory("CategoryMiscName")] + [LocalizedDisplayName("OptionUseNewTestExecutionFramework")] + [LocalizedDescription("OptionUseNewTestExecutionFrameworkDescription")] public bool UseNewTestExecutionFramework2 { get { return _useNewTestExecutionFramework; } @@ -149,9 +148,9 @@ public bool UseNewTestExecutionFramework2 } private bool _useNewTestExecutionFramework = SettingsWrapper.OptionUseNewTestExecutionFrameworkDefaultValue; - [Category(SettingsWrapper.CategoryMiscName)] - [DisplayName(SettingsWrapper.OptionPrintTestOutput)] - [Description(SettingsWrapper.OptionPrintTestOutputDescription)] + [LocalizedCategory("CategoryMiscName")] + [LocalizedDisplayName("OptionPrintTestOutput")] + [LocalizedDescription("OptionPrintTestOutputDescription")] public bool PrintTestOutput { get { return _printTestOutput; } @@ -159,9 +158,9 @@ public bool PrintTestOutput } private bool _printTestOutput = SettingsWrapper.OptionPrintTestOutputDefaultValue; - [Category(SettingsWrapper.CategoryMiscName)] - [DisplayName(SettingsWrapper.OptionTestNameSeparator)] - [Description(SettingsWrapper.OptionTestNameSeparatorDescription)] + [LocalizedCategory("CategoryMiscName")] + [LocalizedDisplayName("OptionTestNameSeparator")] + [LocalizedDescription("OptionTestNameSeparatorDescription")] public string TestNameSeparator { get { return _testNameSeparator; } @@ -174,9 +173,9 @@ public string TestNameSeparator } private string _testNameSeparator = SettingsWrapper.OptionTestNameSeparatorDefaultValue; - [Category(SettingsWrapper.CategoryMiscName)] - [DisplayName(SettingsWrapper.OptionParseSymbolInformation)] - [Description(SettingsWrapper.OptionParseSymbolInformationDescription)] + [LocalizedCategory("CategoryMiscName")] + [LocalizedDisplayName("OptionParseSymbolInformation")] + [LocalizedDescription("OptionParseSymbolInformationDescription")] public bool ParseSymbolInformation { get { return _parseSymbolInformation; } @@ -184,9 +183,9 @@ public bool ParseSymbolInformation } private bool _parseSymbolInformation = SettingsWrapper.OptionParseSymbolInformationDefaultValue; - [Category(SettingsWrapper.CategoryMiscName)] - [DisplayName(SettingsWrapper.OptionDebugMode)] - [Description(SettingsWrapper.OptionDebugModeDescription)] + [LocalizedCategory("CategoryMiscName")] + [LocalizedDisplayName("OptionDebugMode")] + [LocalizedDescription("OptionDebugModeDescription")] public bool DebugMode { get { return _debugMode; } @@ -194,9 +193,9 @@ public bool DebugMode } private bool _debugMode = SettingsWrapper.OptionDebugModeDefaultValue; - [Category(SettingsWrapper.CategoryMiscName)] - [DisplayName(SettingsWrapper.OptionTimestampOutput)] - [Description(SettingsWrapper.OptionTimestampOutputDescription)] + [LocalizedCategory("CategoryMiscName")] + [LocalizedDisplayName("OptionTimestampOutput")] + [LocalizedDescription("OptionTimestampOutputDescription")] public bool TimestampOutput { get { return _timestampOutput; } diff --git a/GoogleTestAdapter/VsPackage.Shared/OptionsPages/GoogleTestOptionsDialogPage.cs b/GoogleTestAdapter/VsPackage.Shared/OptionsPages/GoogleTestOptionsDialogPage.cs index a9004ddda..c30486015 100644 --- a/GoogleTestAdapter/VsPackage.Shared/OptionsPages/GoogleTestOptionsDialogPage.cs +++ b/GoogleTestAdapter/VsPackage.Shared/OptionsPages/GoogleTestOptionsDialogPage.cs @@ -1,8 +1,7 @@ -// This file has been modified by Microsoft on 6/2017. +// This file has been modified by Microsoft on 9/2017. using GoogleTestAdapter.Settings; using System; -using System.ComponentModel; namespace GoogleTestAdapter.VsPackage.OptionsPages { @@ -11,9 +10,9 @@ public class GoogleTestOptionsDialogPage : NotifyingDialogPage { #region Runtime behavior - [Category(SettingsWrapper.CategoryRuntimeBehaviorName)] - [DisplayName(SettingsWrapper.OptionCatchExceptions)] - [Description(SettingsWrapper.OptionCatchExceptionsDescription)] + [LocalizedCategory("CategoryRuntimeBehaviorName")] + [LocalizedDisplayName("OptionCatchExceptions")] + [LocalizedDescription("OptionCatchExceptionsDescription")] public bool CatchExceptions { get { return _catchExceptions; } @@ -21,9 +20,9 @@ public bool CatchExceptions } private bool _catchExceptions = SettingsWrapper.OptionCatchExceptionsDefaultValue; - [Category(SettingsWrapper.CategoryRuntimeBehaviorName)] - [DisplayName(SettingsWrapper.OptionBreakOnFailure)] - [Description(SettingsWrapper.OptionBreakOnFailureDescription)] + [LocalizedCategory("CategoryRuntimeBehaviorName")] + [LocalizedDisplayName("OptionBreakOnFailure")] + [LocalizedDescription("OptionBreakOnFailureDescription")] public bool BreakOnFailure { get { return _breakOnFailure; } @@ -35,9 +34,9 @@ public bool BreakOnFailure #region Test execution - [Category(SettingsWrapper.CategoryTestExecutionName)] - [DisplayName(SettingsWrapper.OptionRunDisabledTests)] - [Description(SettingsWrapper.OptionRunDisabledTestsDescription)] + [LocalizedCategory("CategoryTestExecutionName")] + [LocalizedDisplayName("OptionRunDisabledTests")] + [LocalizedDescription("OptionRunDisabledTestsDescription")] public bool RunDisabledTests { get { return _runDisabledTests; } @@ -45,9 +44,9 @@ public bool RunDisabledTests } private bool _runDisabledTests = SettingsWrapper.OptionRunDisabledTestsDefaultValue; - [Category(SettingsWrapper.CategoryTestExecutionName)] - [DisplayName(SettingsWrapper.OptionNrOfTestRepetitions)] - [Description(SettingsWrapper.OptionNrOfTestRepetitionsDescription)] + [LocalizedCategory("CategoryTestExecutionName")] + [LocalizedDisplayName("OptionNrOfTestRepetitions")] + [LocalizedDescription("OptionNrOfTestRepetitionsDescription")] public int NrOfTestRepetitions { get { return _nrOfTestRepetitions; } @@ -60,9 +59,9 @@ public int NrOfTestRepetitions } private int _nrOfTestRepetitions = SettingsWrapper.OptionNrOfTestRepetitionsDefaultValue; - [Category(SettingsWrapper.CategoryTestExecutionName)] - [DisplayName(SettingsWrapper.OptionShuffleTests)] - [Description(SettingsWrapper.OptionShuffleTestsDescription)] + [LocalizedCategory("CategoryTestExecutionName")] + [LocalizedDisplayName("OptionShuffleTests")] + [LocalizedDescription("OptionShuffleTestsDescription")] public bool ShuffleTests { get { return _shuffleTests; } @@ -70,9 +69,9 @@ public bool ShuffleTests } private bool _shuffleTests = SettingsWrapper.OptionShuffleTestsDefaultValue; - [Category(SettingsWrapper.CategoryTestExecutionName)] - [DisplayName(SettingsWrapper.OptionShuffleTestsSeed)] - [Description(SettingsWrapper.OptionShuffleTestsSeedDescription)] + [LocalizedCategory("CategoryTestExecutionName")] + [LocalizedDisplayName("OptionShuffleTestsSeed")] + [LocalizedDescription("OptionShuffleTestsSeedDescription")] public int ShuffleTestsSeed { get { return _shuffleTestsSeed; } diff --git a/GoogleTestAdapter/VsPackage.Shared/OptionsPages/LocalizedCategoryAttribute.cs b/GoogleTestAdapter/VsPackage.Shared/OptionsPages/LocalizedCategoryAttribute.cs new file mode 100644 index 000000000..0580a3985 --- /dev/null +++ b/GoogleTestAdapter/VsPackage.Shared/OptionsPages/LocalizedCategoryAttribute.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. + +using System.ComponentModel; +using GoogleTestAdapter.Settings; + +namespace GoogleTestAdapter.VsPackage.OptionsPages +{ + class LocalizedCategoryAttribute : CategoryAttribute + { + private readonly string ResourceName; + + public LocalizedCategoryAttribute(string resourceName) + : base() + { + this.ResourceName = resourceName; + } + + protected override string GetLocalizedString(string value) + { + return (string)typeof(SettingsWrapper).GetField(ResourceName).GetValue(null); + } + } +} diff --git a/GoogleTestAdapter/VsPackage.Shared/OptionsPages/LocalizedDescriptionAttribute.cs b/GoogleTestAdapter/VsPackage.Shared/OptionsPages/LocalizedDescriptionAttribute.cs new file mode 100644 index 000000000..efe28cbb6 --- /dev/null +++ b/GoogleTestAdapter/VsPackage.Shared/OptionsPages/LocalizedDescriptionAttribute.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. + +using System.ComponentModel; +using GoogleTestAdapter.Settings; + +namespace GoogleTestAdapter.VsPackage.OptionsPages +{ + class LocalizedDescriptionAttribute : DescriptionAttribute + { + private readonly string ResourceName; + + public LocalizedDescriptionAttribute(string resourceName) + : base() + { + this.ResourceName = resourceName; + } + + public override string Description + { + get { return (string)typeof(SettingsWrapper).GetField(ResourceName).GetValue(null); } + } + } +} diff --git a/GoogleTestAdapter/VsPackage.Shared/OptionsPages/LocalizedDisplayNameAttribute.cs b/GoogleTestAdapter/VsPackage.Shared/OptionsPages/LocalizedDisplayNameAttribute.cs new file mode 100644 index 000000000..f800ca9b7 --- /dev/null +++ b/GoogleTestAdapter/VsPackage.Shared/OptionsPages/LocalizedDisplayNameAttribute.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT license. + +using System.ComponentModel; +using GoogleTestAdapter.Settings; + +namespace GoogleTestAdapter.VsPackage.OptionsPages +{ + class LocalizedDisplayNameAttribute : DisplayNameAttribute + { + private readonly string ResourceName; + + public LocalizedDisplayNameAttribute(string resourceName) + : base() + { + this.ResourceName = resourceName; + } + + public override string DisplayName + { + get { return (string)typeof(SettingsWrapper).GetField(ResourceName).GetValue(null); } + } + } +} diff --git a/GoogleTestAdapter/VsPackage.Shared/OptionsPages/ParallelizationOptionsDialogPage.cs b/GoogleTestAdapter/VsPackage.Shared/OptionsPages/ParallelizationOptionsDialogPage.cs index 43b8cee23..c7020a761 100644 --- a/GoogleTestAdapter/VsPackage.Shared/OptionsPages/ParallelizationOptionsDialogPage.cs +++ b/GoogleTestAdapter/VsPackage.Shared/OptionsPages/ParallelizationOptionsDialogPage.cs @@ -1,17 +1,16 @@ -// This file has been modified by Microsoft on 6/2017. +// This file has been modified by Microsoft on 9/2017. using GoogleTestAdapter.Settings; using System; -using System.ComponentModel; namespace GoogleTestAdapter.VsPackage.OptionsPages { public class ParallelizationOptionsDialogPage : NotifyingDialogPage { - [Category(SettingsWrapper.CategoryParallelizationName)] - [DisplayName(SettingsWrapper.OptionEnableParallelTestExecution)] - [Description(SettingsWrapper.OptionEnableParallelTestExecutionDescription)] + [LocalizedCategory("CategoryParallelizationName")] + [LocalizedDisplayName("OptionEnableParallelTestExecution")] + [LocalizedDescription("OptionEnableParallelTestExecutionDescription")] public bool EnableParallelTestExecution { get { return _enableParallelTestExecution; } @@ -19,9 +18,9 @@ public bool EnableParallelTestExecution } private bool _enableParallelTestExecution = SettingsWrapper.OptionEnableParallelTestExecutionDefaultValue; - [Category(SettingsWrapper.CategoryParallelizationName)] - [DisplayName(SettingsWrapper.OptionMaxNrOfThreads)] - [Description(SettingsWrapper.OptionMaxNrOfThreadsDescription)] + [LocalizedCategory("CategoryParallelizationName")] + [LocalizedDisplayName("OptionMaxNrOfThreads")] + [LocalizedDescription("OptionMaxNrOfThreadsDescription")] public int MaxNrOfThreads { get { return _maxNrOfThreads; } diff --git a/GoogleTestAdapter/VsPackage.Shared/VsPackage.Shared.projitems b/GoogleTestAdapter/VsPackage.Shared/VsPackage.Shared.projitems index 1d835066b..ba789921c 100644 --- a/GoogleTestAdapter/VsPackage.Shared/VsPackage.Shared.projitems +++ b/GoogleTestAdapter/VsPackage.Shared/VsPackage.Shared.projitems @@ -25,6 +25,9 @@ Component + + + Component diff --git a/GoogleTestAdapter/VsPackage.TAfGT/Resources/VSPackage.resx b/GoogleTestAdapter/VsPackage.TAfGT/Resources/VSPackage.resx index e9d69787f..d35349059 100644 --- a/GoogleTestAdapter/VsPackage.TAfGT/Resources/VSPackage.resx +++ b/GoogleTestAdapter/VsPackage.TAfGT/Resources/VSPackage.resx @@ -1,5 +1,64 @@  + @@ -58,14 +117,26 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Test Adapter for Google Test Enables Visual Studio's testing tools with unit tests written for Google Test. The use terms and Third Party Notices are available in the extension installation directory. + ..\..\Resources\Icons\Icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + General + The name of page of options + + + Parallelization + The name of page of options + + + Google Test + The name of page of options. Google Test is the name of a library and should not be localized. + \ No newline at end of file