microsoft/TestAdapterForGoogleTest
forked from csoltenborn/GoogleTestAdapter
Captured source
source ↗microsoft/TestAdapterForGoogleTest
Description: Visual Studio extension that enables support for unit testing with Google Test in the IDE
Language: C#
License: NOASSERTION
Stars: 64
Forks: 46
Open issues: 41
Created: 2017-06-06T18:28:37Z
Pushed: 2026-07-16T05:13:12Z
Default branch: dev17
Fork: yes
Parent repository: csoltenborn/GoogleTestAdapter
Archived: no
README:  
Google Test Adapter / Test Adapter for Google Test
This README details the ‘Google Test Adapter’ GTA and the ‘Test Adapter for Google Test’ TAfGT, and . These test adapters are Visual Studio extensions that provide test discovery and execution of C++ tests written with the Google Test framework.
Microsoft collaborated with the creators of GTA to fork their project and create ‘Test Adapter for Google Test’. These test adapters share many of the same features and any differences will be explicitly labeled with [TAfGT] or [GTA] in this document. GTA may contain more experimental features, whereas all updates to TAfGT must go through Microsoft’s software development cycle.
Features
- Project and item templates for setting up unit tests based on the Google Test framework; the project template provides automatic acquisition and setup of the Google Test framework, making it easy to get started with writing unit tests
- Sequential and [parallel](#parallelization) test execution
- Traits support by means of [custom C++ macros](#trait_macros) and/or [trait assignment by regexes](#trait_regexes)
- Support for value-parameterized, typed, and type-parameterized tests
- Google Test's runtime behavior (handling of exceptions, break on assertion failure) can be controlled via [VS options](#global_settings)
- Most important runtime options can be controlled via [toolbar](#toolbar) without entering VS's options
- Support for all Google Test command line options, including test shuffling and test repetition
- [TFS support](#vstest_console) by means of `VSTest.Console.exe`
- [Support](#test_case_filters) for test case filters
- Failed assertions and SCOPED_TRACEs are linked to their source locations
- Identification of crashed tests
- Test output can be piped to test console
- Execution of [parameterized batch files](#test_setup_and_teardown) for test setup/teardown
- Test discovery using a [custom regex](#test_discovery_regex) (if needed) or an indicator file
- Settings can be [shared via source control](#solution_settings)
- Installable as Visual Studio extension or [GTA] NuGet development dependency
History
- See TAFGT releases
- See GTA releases.
Usage
Installation
The adapters can be installed in several ways:
- Install through the Visual Studio Marketplace at *Tools/Extensions and Updates* - search for *Test Adapter for Google Test* or *Google Test Adapter*.
- Download and launch the VSIX installer from either the Visual Studio Marketplace (TAfGT, GTA) or GitHub
- [GTA only] Add a NuGet dependency to the Google test adapter nuget package to your Google Test projects. Note, however, that Visual Studio integration is limited this way: VS can discover and run tests, but no debugging, options or toolbar will be available; configuration is only possible through solution config files (see below).
After restarting VS, your tests will be displayed in the Test Explorer at build completion time. If no or not all tests show up, have a look at the [troubleshooting section](#trouble_shooting).
Configuration
There are several different ways to configure the adapter:
- The respective *global options* menus:
- [TAfGT] *Tools/Options/Test Adapter for Google Test*
- [GTA] *Tools/Options/Google Test Adapter*
- The toolbar (not available if installed via NuGet). Using the toolbar, you can set the most important runtime options (i.e., *Parallel test execution*, *Break on failure*, *Catch exceptions*, and *Print test output*); this is equivalent to setting...
Excerpt shown — open the source for the full document.