I’m trying to run a google test created from visual studio so that it filters by a given trait [i.e. *UnitTest*]
We use Visual studio 2019 and FinalBuilder 8 to run our build routine but since the update we can’t discover c++ tests properly nor filter them.
here are some logs of different runs with different parameters:
VsTest.Console - v2019
This option doesn’t run any test…
Run VSTest.Console [ "C:\dev\investigations\google_test_example_nuget\x64-Debug\bin\google_test_example_nuget.exe" ]
Status:
Date: 17/03/2020
Time: 10:39:53:209
End: 10:39:54:828
Duration: 00:00:01:619
Action Messages:
Checking for TFS environment...
Executing external process: C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe
Starting Directory: C:\dev\investigations\google_test_example_nuget\x64-Debug\bin\
Parameters: C:\dev\investigations\google_test_example_nuget\x64-Debug\bin\google_test_example_nuget.exe /platform:"x64" /framework:Framework45 /logger:trx
Output from C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe
Microsoft (R) Test Execution Command Line Tool Version 16.5.0
Copyright (c) Microsoft Corporation. All rights reserved.
Starting test execution, please wait...
A total of 1 test files matched the specified pattern.
No test is available in C:\dev\investigations\google_test_example_nuget\x64-Debug\bin\google_test_example_nuget.exe. Make sure that test discoverer & executors are registered and platform & framework version settings are appropriate and try again.
Results File: C:\dev\investigations\google_test_example_nuget\x64-Debug\bin\TestResults\Pietro_DEVINT-PC_2020-03-17_10_39_54.trx
Additionally, path to test adapters can be specified using /TestAdapterPath command. Example /TestAdapterPath:<pathToCustomAdapters>.
VsTest.Console - v2019 - /usevsixextensions:true
This option just crashes
Run VSTest.Console [ "C:\dev\investigations\google_test_example_nuget\x64-Debug\bin\google_test_example_nuget.exe" ]
Status:
Date: 17/03/2020
Time: 10:25:36:330
End: 10:25:36:976
Duration: 00:00:00:646
Action Messages:
Checking for TFS environment...
Executing external process: C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe
Starting Directory: C:\dev\investigations\google_test_example_nuget\x64-Debug\bin\
Parameters: C:\dev\investigations\google_test_example_nuget\x64-Debug\bin\google_test_example_nuget.exe /usevsixextensions:true /platform:"x64" /framework:Framework45 /logger:trx
Output from C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe
Microsoft (R) Test Execution Command Line Tool Version 16.5.0
Copyright (c) Microsoft Corporation. All rights reserved.
/UseVsixExtensions is getting deprecated. Please use /TestAdapterPath instead.
Failed to find the list of installed unit test extensions. Reason: System.ArgumentNullException: Value cannot be null.
Parameter name: type
at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
at System.Activator.CreateInstance(Type type, Object[] args)
at Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework.VSExtensionManager.GetTestExtensionsInternal(String extensionType)
at Microsoft.VisualStudio.TestPlatform.Common.ExtensionFramework.VSExtensionManager.GetUnitTestExtensions()
Action Failed
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe returned : 1
Proposed solution
Add the option to specify the /TestAdapterPath:<pathToCustomAdapters>
parameter (include instructions to which exact folder it needs to be pointing at please) since none of the current options seem to cater for the latest VisualStudio