I have problems to get my gtest runing in my build pipeline. My solution works well to build and run test case in Visual Studio 2017. On the DevOps environment I use .Net Desktop setup with minor modification. The build task work fine as well in pipeline.
I try use default VSTest task, but I'm not sure it right task for run Google Test that is create with Visual Studio project from VS IDE.
Build pipline yml script
# .NET Desktop
trigger:
- master
# Install build environment
pool:
vmImage: 'windows-latest'
name: Hosted VS2017
variables:
solution: '**/*.sln'
buildPlatform: 'x86'
buildConfiguration: 'Debug'
steps:
- task: NuGetCommand@2
inputs:
restoreSolution: '$(solution)'
# Build VS solutions including gtest project.
- task: VSBuild@1
inputs:
solution: '$(solution)'
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
# Run gTest, this task not working see log below.
- task: VSTest@2
inputs:
platform: '$(buildPlatform)'
configuration: '$(buildConfiguration)'
VSTest log output
Running tests using vstest.console.exe runner.
======================================================
Test selector : Test assemblies
Test filter criteria : null
Search folder : d:\a\1\s
VisualStudio version selected for test execution : latest
Attempting to find vstest.console from a visual studio installation with version [16.0,17.0).
Attempting to find vstest.console from a visual studio build tools installation with version [16.0,17.0).
Attempting to find vstest.console from a visual studio installation with version [15.0,16.0).
Run in parallel : false
Run in isolation : false
Path to custom adapters : null
Other console options : null
Code coverage enabled : false
Diagnostics enabled : false
SystemVssConnection exists true
Run the tests locally using vstest.console.exe
========================================================
##[warning]No test assemblies found matching the pattern: **\*test*.dll,!**\*TestAdapter.dll,!**\obj\**.