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.

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

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


  • Analyzing Code Coverage in Build Service with GoogleTestRunner and GTEST
    1 Posts | Last post Wed 6:10 PM
    • 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
      
      
      
  • Running with VS 2015 Preview
    1 Posts | Last post Wed 1:10 PM
    • 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
  • 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.
1 - 10 of 35 Items