GoogleTestAddin

GoogleTestAddin is an Add-In for Visual Studio 2010. It makes it easier to execute/debug googletest
functions by selecting them. You'll no longer have to set the command arguments of your test application.

The output of the googletest console application is redirected to the a additional Visual Studio output window.
The benefit here is, that if any test fails then the information about the failed test is written to the output where it
can be double clicked to jump to the source line.

How to install the Add-In on Visual Studio 2010

Place the two files GoogleTestAddIn.AddIn and GoogleTestAddin.dll into the following folder:

C:\Users\<Username>\Documents\Visual Studio 2010\Addins

 Start Visual Studio 2010 and the Add-In can be found listed under Tools -> Add-in Manager.          

How to install the Add-In on Visual Studio 2008

Place the two files GoogleTestAddIn.AddIn and GoogleTestAddin.dll into the following folder:

C:\Users\<Username>\Documents\Visual Studio 2008\Addins

 Start Visual Studio 2008 and the Add-In can be found listed under Tools -> Add-in Manager.   


 

The Add-In adds three buttons to the toolbar of Visual Studio 2008/10 and adds three items to the
code context menu of Visual Studio 2008/10. They are activated only when a C++ project is loaded.

 Buttons added by the Add-in

The function behind this three buttons/items is:

  1. Execute all test and redirect the output to the “GoggleTest” output pane in Visual Studio.
  2. Execute the selected test or test function and redirect the output to the “GoggleTest” output pane in Visual Studio.
  3. Debug the selected test or test function. At this mode the output is not redirected to the output pane.
 

How to use the Addin with Visual Studio 2008/10

In your test code you will use the following to define a test function:

TEST ( TestName, TestFunction )
{
     
      EXPECT_EQ( … );
     
}

Or

TEST_F ( CTestClass, TestFunction )
{
     
      EXPECT_EQ( … );
     
}

Now you can select which part of the tests should be  executed/debugged with the following selections:

 

TEST ( TestName, TestFunction )

Executes/Debug only the function TestFunction within the test TestName.
Calls the test application with the option --gtest_filter=TestName.TestFunction

TEST ( TestName, TestFunction )

Executes/Debug all functions within the test TestName.
Calls the test application with the option --gtest_filter=TestName.*

 

The following output is generated by the Add-in:

Output of the GoogleTest Add-in

Output with failed test:

Output of a failed test

Thats it.

 

Last edited May 4, 2012 at 10:10 PM by Ovaron95, version 6

Comments

padames Mar 18, 2013 at 9:47 PM 
Running MSVS 2010 on Windows 7 Enterprise 64-bit the application stopped working when I tried to use it the second day. The error message I get when pressing the buttons says "The specified executable is not a valid application for this OS platform." ?!
It worked well right after installation though.
Any ideas how to fix it?

sinaja Aug 22, 2012 at 3:29 PM 
version 6 does not load into VS2010. I followed the instructions, on startup VS states the AddIn did not load correctly, and then disables it. Any ideas?