GoogleTestAdapter icon indicating copy to clipboard operation
GoogleTestAdapter copied to clipboard

Test Adapter for Google Test cannot execute tests - VS2022

Open sudheeshps opened this issue 6 months ago • 0 comments

I have found this issue in VS 2022 Community Edition.

VS 2022 build info:

Microsoft Visual Studio Community 2022
Version 17.13.6

Here the issue is that even if Google Test Adapter is installed by VS installer, the binaries are not getting copied to TestPlatform\Extensions folder.

The best way to check is that open the VS 2002 Developer Command Prompt and run the following command: vstest.console.exe /ListExecutors. It shall list Google Test Adapter. But in case of this issue, it will not.

Before fix:

C:\Program Files\Microsoft Visual Studio\2022\Community>vstest.console /ListExecutors VSTest version 17.13.0 (x64)

The following Test Execution Add-Ins are available:

Microsoft.VisualStudio.TestPlatform.Common.ExtensionDecorators.SerialTestRunDecorator
        Uri: executor://CodedWebTestAdapter/v1
Microsoft.VisualStudio.TestPlatform.Common.ExtensionDecorators.SerialTestRunDecorator
        Uri: executor://MSTestAdapter/v1
Microsoft.VisualStudio.TestPlatform.Common.ExtensionDecorators.SerialTestRunDecorator
        Uri: executor://WebTestAdapter/v1
Microsoft.VisualStudio.TestPlatform.Common.ExtensionDecorators.SerialTestRunDecorator
        Uri: executor://CppUnitTestExecutor/v1
Microsoft.VisualStudio.TestPlatform.Common.ExtensionDecorators.SerialTestRunDecorator
        Uri: executor://UAPCppExecutorIdentifier

After fix:

C:\Program Files\Microsoft Visual Studio\2022\Community>vstest.console /ListExecutors VSTest version 17.13.0 (x64)

The following Test Execution Add-Ins are available:

Microsoft.VisualStudio.TestPlatform.Common.ExtensionDecorators.SerialTestRunDecorator
        Uri: executor://TestAdapterForGoogleTest/v1
Microsoft.VisualStudio.TestPlatform.Common.ExtensionDecorators.SerialTestRunDecorator
        Uri: executor://CodedWebTestAdapter/v1
Microsoft.VisualStudio.TestPlatform.Common.ExtensionDecorators.SerialTestRunDecorator
        Uri: executor://MSTestAdapter/v1
Microsoft.VisualStudio.TestPlatform.Common.ExtensionDecorators.SerialTestRunDecorator
        Uri: executor://WebTestAdapter/v1
Microsoft.VisualStudio.TestPlatform.Common.ExtensionDecorators.SerialTestRunDecorator
        Uri: executor://CppUnitTestExecutor/v1
Microsoft.VisualStudio.TestPlatform.Common.ExtensionDecorators.SerialTestRunDecorator
        Uri: executor://UAPCppExecutorIdentifier

Work around:

The workaround I have tried is that copy Google Test Adapter binaries from the following folder: "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions\uyaomxya.2er" (note sure folder name uyaomxya.2er is same for Google Test Adapter extension in all machines) to "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\Extensions\TestPlatform\Extensions" folder.

I tried adding the first folder to PATH variable, but didn't help.

The following are the binaries to be copied:

GoogleTestAdapter.Common.dll
GoogleTestAdapter.Common.Dynamic.dll
GoogleTestAdapter.Core.dll
GoogleTestAdapter.DiaResolver.dll
GoogleTestAdapter.TestAdapter.dll

Once "C:\Program Files\Microsoft Visual Studio\2022\Community>vstest.console /ListExecutors" works as expected, test explorer also runs the tests.

sudheeshps avatar May 05 '25 15:05 sudheeshps