Google Test Adapter

Free

Unit Test Adapter for Google Test (gtest).

(12) Review
Visual Studio
2012
Download (1,149)
11/6/2012
1.1
View
E-mail Twitter del.icio.us Digg Facebook
Add To Favorites
Description
Reviews (12)
Q and A (10)
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


  • How to view the test output?
    2 Posts | Last Post Tue 8:25 PM
    • 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.
  • Navigation
    1 Posts | Last Post February 27, 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.
  • 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
  • Source code
    1 Posts | Last Post December 02, 2012
    • Great work!
      
      Please publish somewhere source code of your GoogleTestAdapter.dll, this would be great. I want create Unit Test Adapter, but today only this article contain some sort of information on this topic http://blogs.msdn.com/b/bhuvaneshwari/archive/2012/03/13/authoring-a-new-visual-studio-test-adapter.aspx
  • Doesn't work "open test" at Test Explorer
    4 Posts | Last Post November 21, 2012
    • 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.
  • Minor points
    2 Posts | Last Post November 15, 2012
    • Congratulations! For a long time I was waiting that someone brings up a usable VS integration for gtest&gmock. After the first day of use some points what I'm recognize.
      
      a. Jump to test don't work. Michael has already reported.
      b. Maybe it's possible to add to the full qualified name in TestCase the project name. The display name let how it is.
      c. Warnings from gmock are missing. This happens also in the VS output when the testee runs. In a cmd wnd they are viewed.
      d. One time happens that my exe where are the unit tests, was loaded by the VS and the linker cant create after the output. The very strange was that the exe was after a VS restart again loaded. Without any testrun. In the first I was thinking this happens then I was terminate the UT-Exe when I was debugging a test. After I delete the UT-Exe in the explorer when the VS was closed and this "repair" it. But I repeat this several times and it works. I will watch this. Maybe I can reproduce. When not more good. :-)
      
      Thanks for the usefully test adapter!
      
    • Thanks for your feedback :-)
      
      a. See my reply!
      b. Sounds like a good idea, thank you for the suggestion.
      c. The plugin parses the XML result file. These files do not include any warnings... maybe we should suggest this as a improvement at http://groups.google.com/group/googletestframework...
      d. Tell me if you can reproduce the error, but I had similar problems with ever-running executables in other testing frameworks of VS, too. Maybe it is a VS problem?
      
      Thank you!