Google Test Adapter

Free

Unit Test Adapter for Google Test (gtest).

(12) Review
Visual Studio
2012
Download (3,336)
1/15/2014
1.1
View
E-mail Twitter del.icio.us Digg Facebook
Add to favorites
Description
Reviews (12)
Q and A (12)
Sign in to write a review
Sort by:

by Takashi Harada | April 16 2013

by markusl0 | March 13 2013

by adam_sc | February 09 2013

by Darren Vine | January 19 2013

An excellent plugin with one or two kinks to be ironed out (v1.1) but otherwise does exactly what it says.

by Petter S | January 18 2013

Very good initiative!

by Billy.Oneal | December 31 2012

Great extension. It would be awesome if there was a switch to pass --gtest_catch_exceptions=0 to the unit test binary when one right clicks on a test and hits "debug selected test(s)". (Or other similar switches)

by Harrison Ting | December 18 2012

Did not discover tests for me (I'm on Visual Studio 2012).

by E. Vakili | November 07 2012

I think this is a start, of course a good start. But are you ready to publish/share the source code in codeplex or elsewhere?

by Willy Scheibel | November 06 2012

Its easy to install and to use.
Finding tests works nice and the test overview shows useful information.

by BlackLynx | November 06 2012

Awesome! Just what I needed.

by NobodysNightmare | November 06 2012

works like a charm

by ArnoNym | November 06 2012

Sign in to start a discussion


  • Is this project still alive?
    3 Posts | Last post January 15, 2014
    • Now it's near one year past without any bugfix or other enhancement. MS has enhanced the test explorer with groups but without to jump to the test source when click on him in the explorer, this will be less usefully. The same when a failed test is reported.
      When the adapter is no longer developed by the founder please make public the source. When still under development, please give a feedback with a forecast when you release the next version.
      
      Best regards
      Alfred
      
    • Hi Alfred. You might want to try this one http://visualstudiogallery.msdn.microsoft.com/9dd47c21-97a6-4369-b326-c562678066f0
    • Sorry guys :-)
      
      I did this project as a quick hack for an university project last year and never finished it, because since then I've not used gtest again. It looks like Markus' adapter is working well and is updated fairly often, therefore I'm suggesting that everyone should use his adapter!
      
      If anyone is interested on how to write such an adapter I can publish the source code, but I think Markus' GitHub page should give you all you need!
  • Navigation
    2 Posts | Last post August 21, 2013
    • I only have one problem with this, and it is the fact that you can't double click on a test and navigate to the source line where that test is. Would be very good if that was actually available.
      
      The source of the test always seems to just be the testing executable.
      
      When using the MS native c++ testing framework, you can jump to the source line from the test explorer.
    • Hi. Could you try this extension instead http://visualstudiogallery.msdn.microsoft.com/9dd47c21-97a6-4369-b326-c562678066f0 ?
  • Doesn't work "open test" at Test Explorer
    8 Posts | Last post August 21, 2013
    • Actually great work, guys!
      But I have some problem to discover source code of failed test from anywhere in Test Explorer (where displayed Source: %TestName% line %LineOfFailedTest% and Message: ...%SourceFileOfFailedTest%:line)
      What should I do to go to source by clicking in Test Explorer?
      
    • In addition, now when I click on those links it will send me to RT_MANIFEST of executable that contains failed test.
    • Thanks for your feedback :-)
      
      You should be able to jump into the source code of the test either by click on the "Source" line or via the context menu "Open test". Judging from your second comment it looks like the plugin is struggling to find the .pdb file. Currently the plugin searches in no other location than the default location(s) (which is in the same directory as the test executable). If no .pdb information is found, the plugin redirects you to the RT_MANIFEST - I will remove this ;-)
      Do you generate any .pdb file on build? Do you build in release mode? Can you send me a test solution?
    • I have the same problem. The .pdb file is generated and is placed beside the test project output. But the Source link or the Menu bring me to .exe resources.
    • Same RT_MANIFEST / pdb issue for me. I use CMake "out of source" build so all build files are in different location than the default one. (basically in /build sub-directory of the project directory). Would be awesome if this could be fixed.
      
      Anyway, awesome stuff. Thanks!
    • Are there any other solutions for this issue. I got the same problem and didn't get fixed so far.
      I even have this issue when compiling "gtest" Sotution of googletest.googlecode.com/files/gtest-1.6.0.zip in my VS 2012 Ulitmate with update 3 on Win7 x64. I
      - downloaded this file,
      - started the solution in VS2012,
      - let the projects be converted,
      - added _VARIADIC_MAX=10 in all C++/Preprocessor project configs to compile with VS2012 compiler,
      - made "$(SolutionDir)/$(Configuration)/" the Output and Intermediate Directory so all files can be found in one directory (see hint in other comments, regarding finding pdb file),
      - compiled and
      - run all test successfully. 
      In the project "gtest_uninttest" there are some disabled tests that give me the yellow warning sign in Test Explorer. When I then use "Open Test" (F12) or click on the link near "Source", I only see the RT_MANIFEST information.
      
      What am I doing wrong here?
    • I don't know, wheather this is normal, but after "Source:" the string shows me a link pointing to my exe file. In my sample the link is called "test.exe line 1".
      I think at this position there should be given a link to my source file directly.
    • Hello everyone. The RT_MANIFEST problem is fixed in another Visual Studio extension which can be found here: http://visualstudiogallery.msdn.microsoft.com/9dd47c21-97a6-4369-b326-c562678066f0
  • Visual Studio 2013 Support
    1 Posts | Last post July 05, 2013
    • For those want to use this plugin with VS2013 preview.
      You have to patch the vsixmanifest.
      * rename the .vsix extension to .zip and unzip
      * edit the file extension.vsixmanifest and replace the InstallationTargets nodes with : 
      <InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[11.0,12.0]" />
      <InstallationTarget Version="[11.0,12.0]" Id="Microsoft.VisualStudio.Ultimate" />
          <InstallationTarget Version="[11.0,12.0]" Id="Microsoft.VisualStudio.Premium" />
      * finally zip the files and reset the extension to vsix.
  • How to view the test output?
    2 Posts | Last post May 14, 2013
    • Is it possible to view the test output anywhere? When running a single test it would be really useful to be able to see what that test actually wrote to the console output somewhere.
    • Oh, and when debugging a single test it would be really nice if you could configure it to break on the first line of the test.
  • Doesn't pick up debug path
    2 Posts | Last post April 08, 2013
    • Because we're using Qt our command line app requires a Qt DLL to run (QtCore4.dll). The app runs fine because we extend PATH in in Settings->Debugging->Environment:
          PATH=$(QTDIR)\bin;(PATH)
      But Test Explorer doesn't seem to do this and so we get an error dialog. We have to add QTDIR to PATH in the PC environment to fix this.
      
      Is this a problem in your adapter or Visual Studio 2012? Are you planning to post your source anywhere so we can see if it's possible to fix this?
      
    • I would also find a solution for this very helpful.
  • Discovering Unit Tests Issue
    1 Posts | Last post February 22, 2013
    • I've been having some problems discovering unit tests. In one project it worked. In the other it did not. Here's what caused my problem:
      
      The output directory ( == $(OutDir) ) I used originally contained '\\..', for some reason this didn't launch the unit test project. No idea if this is an issue with vs or with the adapter, but after making sure I had only a single backslash, all worked perfectly fine.
  • Don't use getchar()
    1 Posts | Last post February 10, 2013
    • In the sample code I had, the main() function ends with:
          std::getchar(); // keep console window open until Return keystroke
      I found that Visual Studio kept running the executable in the background and it never terminates, so my tests never show up and I can't recompile the executable. Removing getchar() fixes this problem.
      
  • Discoverer not Discovering
    6 Posts | Last post January 19, 2013
    • I cannot get this plugin to recognize any Google tests.
      
      What prerequisites are there for this plugin?  I'm thinking things like:
      - VC project version?
      - VC project type (console vs windowed app)?
      - Google Test version?
      - Specific test macro to use?
    • Same: I have two solutions where one works flawlessly and in the other, no Google tests are found. I can't right away detect any difference between those. It can't be specific macros, because then they wouldn't work in both solutions. Also, having or not having a file with a main function doesn't make a difference. It also doesn't make a difference which Default Processor Architecture is set in the "Test" menu. 
      
      Both solutions are native C++ (STL) libraries (and the tests command line application(s)) created using cmake. 
      
      Any idea why it doesn't work for one of the solutions?
      
      
      
    • It does not recognize any tests for me either.
      
      I'm using Visual Studio 2012.
    • Yet another solution. Here, The tests are discovered but while running, an exception happens. I can run all tests from the command line by starting the test executable. Here is the output of google test adapter (I replaced a portion of the paths with "..." here for readability). The mentioned tmp file is not written.
      
      ========== Discover test finished: 13 found (0:00:09,5387497) ==========
      ------ Run test started ------
      Starting all tests of test executable E:\Projects\...\MyTests.exe.
      Discovered total of 13 tests in test executable E:\Projects\...\MyTests.exe.
      Report file of running tests of test executable E:\Projects\...\MyTests.exe will be E:\Temp\tmp8DED.tmp.
      An exception occurred while invoking executor 'executor://googletestexecutor/v2': Root element is missing.
      ========== Run test finished: 0 run (0:00:01,3506249) ==========
      
    • Same issue for me, I cannot get any tests discovered from a solution.
      Does any one have a simple working solution to share?
    • An exception occurred while invoking executor 'executor://googletestexecutor/v2': Root element is missing.
      
      is also my issue.  This happens when I hit Run All.  Detection isn't an issue but I still have to run my tests in Guitar to check that they all run.
  • Bug in the test discoverer
    1 Posts | Last post January 09, 2013
    • Hi Lukas!
      
      I found out the problem why it might happen that your adapter is unable to discover the tests from executable.
      
      It seems that you are searching for the string "This program contains tests written using Google Test" in the resulting output to check whether there are GTest tests or not. However, some of us are using gtest with a dynamic linkage, not static, which means that the string never exists in the executable, but only in gtestgmock.dll.
      
      Simple workaround is to include printf("This program contains tests written using Google Test");
      
      Would it be possible to share the source at github to ease the debugging and involving the community in improving this adapter further?:-)
      
      Regards,
      Markus
1 - 10 of 12 Items