I have an executable Entrance.exe
and a library lib.dll
compiled&linked with /PROFILE
options (with cl.exe
on Windows), Entrance.exe
uses functions from lib.dll
. Now I want to deploy CI/CD pipelines to collect test coverage data automatically. I want to make use of vstest.console.exe
but don’t know how to run it with proper options. I tried
vstest.console.exe "Entrance.exe" /InIsolation /EnableCodeCoverage
but it doesn’t work, saying no tests found in Entrance.exe.
Actually the executable is neither a test driver nor a test executor, just an executable for normal use. I don’t have a specific executable for testing and I don’t want to do that. So I wonder if I want to run an executable normally and collect coverage data, how should I use vstest.console
.
I ever used llvm, it generates profraw
file as long as I run the executable. Can vstest.console
achieve this?
I feel that this is possible, since the necessary code pieces to collect coverage data are already injected by the compiler if I assign /PROFILE
option to it.