GoogleTest Runner

Free

Visual Studio 2013 extension for running C++ unit tests written with GoogleTest framework. Unit Test Runner (Adapter) for Google Test (gtest) unit testing framework.

(8) Review
Visual Studio
2013
Download (4,845)
4/8/2014
1.7.1
E-mail Twitter del.icio.us Digg Facebook
Add to favorites
Description
Reviews (8)
Q and A (30)
Sign in to write a review
Sort by:

by WalkingCat | April 23 2014

by Dmitri Nesteruk | April 15 2014

It works, which is all that you need from it.

by Joerg Schw | December 17 2013

Great! Just what I needed to integrate running the tests within visual studio - without misusing the post-build step.

by Patrik Olesen | October 24 2013

A very nice small tool that does what it says. It would been nice if the error printouts were linked to the editor

by Szymon Gatner | September 12 2013

Great tool. Better than competition because properly jumps to test code when double-clicking test name in the panel.

by tscott98 | September 11 2013

This is a useful front-end to the google test framework. Does as advertised.

by svaha1728 | September 10 2013

This is a great addition to the VS Test Runner! Thank you so much!

by Layl Conway | September 10 2013

Does exactly what it says, though you'll have to install a specific package if you're using VS2013 Preview.

Sign in to start a discussion


  • Running a test via vstest.console.exe
    2 Posts | Last post September 23, 2014
    • Hi Markus, 
      
      Fabulous extension!  Works great from within Visual Studio!  I like it so much, I'm trying to get it to work from a visual studio online build, which I've been unsuccessful so far.  From what I've been able to gather, it appears to use vstest.console.exe to execute the tests with an adapter path specified.   
      
      Have you been able to run a local googletest executable via vstest.console.exe passing in the /TestAdapterPath:<PathToGooglTestRunnerBins> parameter? I'm finding that it's not able to discover the tests for some reason.  On my development machine with the vsix installed, I can run vstest.console.exe /UseVsixExtensions:true /ListDiscoverers and this shows the GoogleTestRunner.GoogleTestDiscoverer.  However running /ListDiscoverers with the TestAdapterPath does *not* show the discoverer.  
      
      Any idea what might be going on here?  
      
      Thanks,
      Drew
      
      
    • Hi Drew.
      
      I once tried the Visual Studio online, too, but couldn't get it working right away. Currently I don't have the required time and interest to investigate this further, but if you or someone else figures out if there's a problem in the GoogleTest Runner, I'm happy to apply any pull requests and build an update.
      
      Best Regards,
      Markus
  • Passing parameters to test executable
    2 Posts | Last post September 23, 2014
    • Hi Markus,
      
      My test binary accepts various command-line parameters, like log level or log file location which I want to pass when I run the test.
      
      Is there way to do it?
      (I understand that UT should be self-contained with only boolean result, but gtest is convenient for other kinds of tests too).
      
      Thanks for great extension!
      
    • I'm sorry, but unfortunately it is not possible in the framework Microsoft provides for unit testing adapters. Could you possibly read the information from a configuration file?
      
      Regards,
      Markus
  • Value parameterized tests
    7 Posts | Last post September 14, 2014
    • Hi Markus!
      Thank you for the great implementation of the test adapter.
      
      I have two problems with the adapter.
      We use GTest 1.7 and some parameterized tests are not detected as run. In the tree they are viewed and in the xml output file they are, but no result is viewed and an error message in the output window appears.
      Message in the Test Output Window
      Coudln't find result for VerifyStoreFailDetected_param/StoreRetConsidered4Numbers_fixCRatedNetConfig._IsSetINIResultConsidered_ResultFollowSetINIResult/6  # GetParam() = (000000013F7566F8, false)
      In the Xml file exists.
      <testcase name="_IsSetINIResultConsidered_ResultFollowSetINIResult/6" value_param="(000000013F8866F8, false)" status="run" time="0" classname="VerifyStoreFailDetected_param/StoreRetConsidered4Numbers_fixCRatedNetConfig" />
      
      A 2nd one. When the test are in an exe and all tests should run, it is really necessary to specify they all in the command line? This produces not running test cases. With the “global” run all it works but take much more longer time.
      
      Thank you for the help.
      
    • Hi Alfred.
      
      Could you provide a complete, buildable solution for me to test with? I tried with simple cases of value-parametrized tests and the extension worked nicely.
    • Hi Markus!
      Thank you for investigate my problem.
      
      In the packet gmock-1.7.0 is under gmock-1.7.0\msvc\2010 the test project located. With small modification it can be compiled in vs2012.
      1.	To all three projects I have add to the preprocessor definitions _VARIADIC_MAX=10;
      2.	When compile some warnings appears, but the exe with the tests will run. Don’t be worry some tests take s “little” longer.
      3.	It’s possible to run the test form the test explorer, but for all parameterized tests is the result reported as missing. In the temorary xml output they are.
      I hope this will help! When not please tell me and I will create a project with not so much tests.
      
      Best reagards
      Alfred
      
    • Markus,
      
      I believe that Alfred4822's first issue is because he is using Gtest 1.7.0. The output strings for parametrized tests are formatted differently in the newest release and the Google Test Runner parsing code doesn't recognize this new format.
      
      Old:
      ParameterizedCutOnStateEarlyOffTimers/CutOnStateEarlyOffTimersTest.CutOnStateEarlyOffTimers/0
      
      New:
      ParameterizedCutOnStateEarlyOffTimers/CutOnStateEarlyOffTimersTest.CutOnStateEarlyOffTimers/0  # GetParam() = (false, 0, 0)
      
      I tried to look/edit your source code at https://github.com/markusl/GoogleTestRunner but you don't include or mention which F# libraries you are using (default set from MS isn't correct). References to FSharp.Core, .Data, and .Data.DesignTime are unresolved.
      
      
    • I got your source to build. VS2012 SDK wasn't enough. Also had to pull down FSharp.Data from here: http://fsharp.github.io/FSharp.Data/
      
      Also, your project specifically references FSharp.Core 4.3.1.0 which I believe is only included with VS2013. So I had to dumb down the reference to the FSharp.Core 4.3.0 that was installed with the SDK.
    • Hello and thanks for this great plug-in! I ran into this problem when running more than one parameterized tests in one go. Only the first test gets executed and it seems to be because gtest does not interpret the command line --getest_filter parameter due to the "# GetParam() .." statements. Are there any suggested workarounds?
    • As a work around, I modified (argc, argv) in my test program's main() before passing them to InitGoogleTest, removing the "# GetParam() .." parts. 
  • Doesn't detect tests
    1 Posts | Last post September 04, 2014
    • I can't get the test runner to detect my tests, using VS2013 Ultimate. Is the only requirement that the exe is named [Tt]est[s].exe, or are there any other catches?
      
      Does the project type matter? Does it matter where the exe is located?
      
      Cheers.
  • Running tests without solution build
    1 Posts | Last post July 07, 2014
    • Hi, Markus
      
      How can I start tests without solution building. I have about 160 projects at my solution, and even building after rebuild is very long operation. I want to use that test which I have right now. How can I find this setting?
  • .runsettings setting is not persisted
    1 Posts | Last post June 18, 2014
    • I do not know if this has anything to do with this extension, microsofts test framework, or the fact that i use CMake to create my solutions, but i have the following problem:
      I cannot get Visual Studio to save which runsettings file to use for code coverage. I have tried adding the .runsettings file to the solution, but it does not change anything.
      When reading online, it seems as if it should just work.
  • Custom test definition
    2 Posts | Last post June 06, 2014
    • I have added this define in my code
      #define R2_TEST_F(test_case_name, test_name)\
        TEST_F(test_case_name, test_name) { test_name <GTEST_TEST_CLASS_NAME_(test_case_name, test_name)> (this); }
      
      - Is there a way for your extension to detect this as a test?
      - Is your source code available if i want to patch it to detect my custom test definition?
      
      Otherwise, your extension works very well for normal google test.
      
      Thanks
    • I found your source code on github.
      Problem was : I had one test exe that was named test_xxxxxx.exe and it needed to be named xxxxx_test.exe to be detected by your extension.
  • Config file for test regex
    2 Posts | Last post May 16, 2014
    • It would be nice if we could change what the regex is looking for. I'm in an environment where all unittests end with UT.exe. If there was a config, or setting for what the parser looks for that would be great. Also making this part of the immediate description that having test.exe on the name of the unittest would have saved some time and unnecessary debugging.
    • I cloned the code and altered it so it checks for a different regex and it works. It would be nice if this was configurable though. It would break some of the assumptions in your unittests but it would be a nice flexibility option.
      
      Great work though, I love the extension!
  • Cannot Install plugin v1.7.1 in VS 2012 Premium
    3 Posts | Last post May 08, 2014
    • I recently tried upgrading from the v1.6.1 to v1.7.1 on a system with VS 2010 and 2012 Update 3. The installer exits with the error "This extension is not installable on any currently installed products. Did you stop supporting 2012?
      
      Install log follows:
      
      5/7/2014 10:19:04 AM - Microsoft VSIX Installer
      5/7/2014 10:19:04 AM - -------------------------------------------
      5/7/2014 10:19:04 AM - Initializing Install...
      5/7/2014 10:19:04 AM - Extension Details...
      5/7/2014 10:19:04 AM - 	Identifier      : GoogleTestRunner.Lindqvist.bbec4f9a-83fc-496a-9424-5bcfaa63f685
      5/7/2014 10:19:04 AM - 	Name            : GoogleTest Runner
      5/7/2014 10:19:04 AM - 	Author          : Markus Lindqvist
      5/7/2014 10:19:04 AM - 	Version         : 1.7.1
      5/7/2014 10:19:04 AM - 	Description     : Visual Studio 2013 extension for running C++ unit tests written with GoogleTest framework.
      Unit Test Runner (Adapter) for Google Test (gtest) unit testing framework.
      5/7/2014 10:19:04 AM - 	Locale          : en-US
      5/7/2014 10:19:04 AM - 	MoreInfoURL     : http://code.google.com/p/googletest/
      5/7/2014 10:19:04 AM - 	InstalledByMSI  : False
      5/7/2014 10:19:04 AM - 	SupportedFrameworkVersionRange : 4.5
      5/7/2014 10:19:04 AM - 	Supported Products : 
      5/7/2014 10:19:04 AM - 		Microsoft.VisualStudio.Pro
      5/7/2014 10:19:04 AM - 			Version : [12.0,13.0)
      5/7/2014 10:19:04 AM - 	References      : 
      5/7/2014 10:19:04 AM - Searching for applicable products...
      5/7/2014 10:19:04 AM - Found installed product - Microsoft Visual Studio 2010 Professional
      5/7/2014 10:19:04 AM - Found installed product - Microsoft Visual Studio Premium 2012
      5/7/2014 10:19:04 AM - Found installed product - Microsoft Visual Studio Professional 2012
      5/7/2014 10:19:04 AM - Found installed product - Microsoft LightSwitch for Visual Studio 2012
      5/7/2014 10:19:04 AM - Found installed product - Microsoft Visual Studio 2012 Shell (Integrated)
      5/7/2014 10:19:04 AM - Found install
    • Apologies the log got truncated
      
      5/7/2014 10:19:04 AM - Found installed product - Global Location
      5/7/2014 10:19:04 AM - VSIXInstaller.NoApplicableSKUsException: This extension is not installable on any currently installed products.
         at VSIXInstaller.App.InitializeInstall()
         at System.Threading.Tasks.Task.InnerInvoke()
         at System.Threading.Tasks.Task.Execute()
    • Latest release for VS2012 can be found here: https://github.com/markusl/GoogleTestRunner/blob/master/Latest_VS2012_package/GoogleTestRunner.vsix
      
      I'm not planning to continue building the extension package for that version any more.
      
      Regards,
      Markus
  • Multiple test projects within MS Solution.
    3 Posts | Last post May 08, 2014
    • Has anyone tried running multiple test projects ?
      Within my project it is only discovering tests for one of the projects.
      If I rename this file via Studio, then tests are not discovered.
      
      I will investigate further by creating a simpler solution/project file.
    • My mistake
      The project name I was not correct. It must be called ...[Tt]est.exe or ...[Tt]ests.exe.
      Maybe some rules like this should be documented somewhere.
    • It is actually written on the 'DESCRIPTION' tab for this Visual Studio extension;)
      
      Good you found it finally!
      
      Regards,
      Markus
1 - 10 of 30 Items