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.

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

by Jakob van Bethlehem | July 27 2015

Found this nice adapter, but can't use it because the regular expression used to match tests is overly strict. I don't want to rename all my 100s of tests. Please make the regular expression configurable, or allow the word 'Test' to either appear at the beginning or ending of the executable name.

by Arkady Shapkin | July 17 2015

by Tommy Santerre | March 21 2015

Great work, makes it much easier to work with gtest.

by Kim Gentes | March 11 2015

An excellent adapter. Works precisely as you expect. Thank you!

by Dmitry N Zolotarev | February 25 2015

Great tool!

by John Digital | February 14 2015

Works great. To get started you need to download and install Google Test from google's website.
Instructions are here: https://www.youtube.com/watch?v=n1OL800IcXI
Then use these instructions to have the results of google test show up in "Test Explorer" inside of the VS IDE. https://github.com/markusl/GoogleTestRunner

by Unril | November 08 2014

Works just fine. If you use it with Qt do not forget to add path to Qt dll files to PATH variable or copy required dlls and pdbs to the folder with executable. Without it this runner will not work.

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


  • Reduce warning level of debug messages
    1 Posts | Last post Fri 1:37 PM
    • Change Request: When the GoogleTest Runner is looking for symbols in a test executable, it outputs messages like:
      
      Loading symbols from <my>.exe
      From <my>.exe, found <n> symbols in <n> ms
      
      These messages are set as warnings, which, also makes them appear as warnings in automated build systems like TFS. Would it be possible to reduce their level from warning to debug or informational? This would remove the "warnings" , which makes it easier to make sure that new warnings are not being added due to less clutter.
  • Error message while it reads the results
    4 Posts | Last post Wed 3:04 PM
    • I'm suddenly getting this error, is that due to a bug in the extension? The error seem to indicate problems parsing the XML result file:
      
      ------ Run test started ------
      Found 33 tests, resolving symbols
      Loading symbols from C:\Users\Thomas\SourceTree\SUbD\Test\SUbD_UnitTest.exe
      From C:\Users\Thomas\SourceTree\SUbD\Test\SUbD_UnitTest.exe, found 33 symbols in 71 ms
      In C:\Users\Thomas\SourceTree\SUbD\Test, running: C:\Users\Thomas\SourceTree\SUbD\Test\SUbD_UnitTest.exe  --gtest_output="xml:C:\Users\Thomas\AppData\Local\Temp\tmp9313.tmp" 
      Root element is missing.
         at System.Xml.XmlTextReaderImpl.Throw(Exception e)
         at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
         at System.Xml.XmlTextReaderImpl.Read()
         at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
         at System.Xml.Linq.XDocument.Parse(String text, LoadOptions options)
         at GoogleTestRunner.ResultParser.getResults(IMessageLogger logger, String outputPath, FSharpList`1 testCases)
         at GoogleTestRunner.GoogleTestExecutor.runOnce(IFrameworkHandle framework, IRunContext runContext, FSharpList`1 allCases, FSharpList`1 cases, String executable, Boolean runAll)
         at GoogleTestRunner.GoogleTestExecutor.runTests(FSharpList`1 allCases, IEnumerable`1 cases, IRunContext runContext, IFrameworkHandle framework, Boolean runAll)
      No test is available in C:\Users\Thomas\SourceTree\SUbD\Test\SUbD_UnitTest.exe. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.
      ========== Run test finished: 0 run (0:00:08.1626713) ==========
    • `tmp9313.tmp` turned out to be empty.
    • I had the exact same problem and it was caused by the fact that the character set of my test project was set to UNICODE. Changing it to multibyte character set solved the problem (project->properties->general->character set).
      
      To get the Google test runner to work I also had to change the signature of the auto generated main method to int _tmain(int argc, char *argv[]).
    • As ThomThom noted, if something causes the gtest executable to exit during test execution the output xml file is empty. I experienced the issue with a regular C++ assert (from assert.h). It would be nice if the test runner was expanded to create a xml file with an appropriate error message, e.g. "Test exited before writing xml output", or something like that.
  • Support for Visual Studio 2015
    2 Posts | Last post July 22, 2015
    • I noticed this Extension doesn't support VS2015, and I can't find a copy that does. Is this coming soon?
    • If you do not want to wait for a new build, you can also get it working with Visual Studio 2015 by editing the extension manifest manually:
      - Download the ".vsix" file (link above)
      - Unpack the file (it's just a ZIP)
      - Edit the file 'extension.vsixmanifest' and
      - Replace the <InstallationTarget> with the following: <InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[14.0,]" />
      - Create a ZIP archive including all files and change the file extension back to ".vsix"
      - Double-click to install
      
      This way, I got it working in Visual Studio 2015.
  • Navigation issue with TEST_P under x64
    1 Posts | Last post April 27, 2015
    • I have a solution compiled under x64. Parameter tests (TEST_P) are executed, but the Source: entry contains either "TestBody" (when << is defined for the parameter struc) or nothing (when not) and the navigation to the source code does not work. For TEST_F everything works as expected. 
      
      Any idea what could be the reason? Changing the Default Processor Architecture under Test => Test Settings did not help.
  • Analyzing Code Coverage in Build Service with GoogleTestRunner and GTEST
    2 Posts | Last post March 11, 2015
    • I have this adapter running and works well. But I want to have this incorporated into my build process. Not just the unit test execution but the Code Coverage analysis as well.
      
      There are plenty of places in MSDN documentation that point to the ability to customize the build service to both run your unit tests and to turn on code coverage analysis during that process.
      
      BUT I cannot find how I might configure my NON-Team version of Visual Studio 2013 (Premium) to run and analyze my GTEST unit tests. I have them running in a post-build step run now, but I want them to run and analyze for code coverage.  Of course, I can run them in the Test Explorer, but I want them incorporated into the build process.
      
      Help...
      
      Just FYI here is the stuff I have read already.
      
      the "Analyzing code coverage in the build service" section in https://msdn.microsoft.com/en-us/library/dd537628.aspx
      
      This separate help https://msdn.microsoft.com/en-us/library/jj159524.aspx
      
      
      The https://msdn.microsoft.com/en-us/library/jj155796.aspx for customizing command line.
      
      And various places that help explain customize run settings in a build definition
      
      https://msdn.microsoft.com/en-us/library/jj159530.aspx
      
      https://msdn.microsoft.com/en-us/library/jj635153.aspx
      
      
      
    • I figured out how to do the code coverage via command line directly (once the GoogleTestRunner plugin is installed).  This allows you to put it in the build process as well.
      
      You must use the vstest.console.exe command, with the extension and code coverage switches. Here is an example of how that works--
      vstest.console.exe YourTest.exe /UseVsixExtensions:true /EnableCodeCoverage /Settings:test.runsettings /inIsolation
      
      Using that format, everything works properly.
      
      NOTE: you must have Visual Studio Premium or Ultimate for this to work (I am using this *without* TFS)
      
      
      Kim
      
  • Running with VS 2015 Preview
    1 Posts | Last post March 04, 2015
    • Will this run with the 2015 Preview?  I don't see it in the Extension Manager.  
  • Failure with C# projects
    1 Posts | Last post February 26, 2015
    • 1) Create new C# console project with *test* name: "semtest"
      2) Implement Program.cs:
      namespace semtest
      {
          class Program
          {
              static void Main(string[] args)
              {
                  Console.ReadKey();
              }
          }
      }
      3) Test Explorer hangs.
      4) Build fails with message like () because semtest.exe is locked with GoogleTest Runner.
      
      ==
      Disable extension? I Cant! I have a C++ project in my solution (with tests)!
      ==
      There is a solution?
      
      ==
      Thanks!
  • i want to use it with vs2012
    1 Posts | Last post December 11, 2014
    • https://github.com/markusl/GoogleTestRunner/blob/master/Latest_VS2012_package/GoogleTestRunner.vsix
      there is no extension, do you have any plan to support vs2012 ?
      or if you support, where should i get it ?
  • Custom test definition
    3 Posts | Last post November 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.
    • kgt
      Thank you jablonski43, rename to xxTest.exe solved also my problem.
  • No longer found in 'Extensions and Updates' in VS2012 professional
    2 Posts | Last post November 03, 2014
    • Dear Markus,
      
      First of all: Thank you for this great extension. It helps a lot during for our daily business.
      Unfortunately we found out yesterday that the plugin is neither listed in VS2012 extension gallery (VS2012 won't find it) nor is installable manually.
      
      Is it still working for VS2012?
      If not: Can I get an old version?
      
      Best regards,
      Joerg
    • Joerg, I had the same problem and I found the latest working extension for 2012 on github: 
      
      https://github.com/markusl/GoogleTestRunner/blob/master/Latest_VS2012_package/GoogleTestRunner.vsix
1 - 10 of 38 Items