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.
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.
Place the two files GoogleTestAddIn.AddIn and
GoogleTestAddin.dll into the following folder:
C:\Users\<Username>\Documents\Visual Studio 2008\Addins
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.
The function behind this three buttons/items is:
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 with failed test: