OpenCppCoverage / OpenCppCoveragePlugin

Official Visual Studio Plugin for OpenCppCoverage
GNU General Public License v3.0
67 stars 28 forks source link

Removing the "Press any key to continue" prompt? #14

Closed ocornut closed 5 years ago

ocornut commented 6 years ago

Hello,

I am currently toying with OpenCppCoverage (which is wonderful, and even more so the presence of a Visual Studio plugin! thank you everyone involved!) and have feedback to make. When I run the plugin at the end of my process it is stopping on a "Press any key to continue..." prompt:

[info] ----------------------------------------------------
[info] Coverage binary generated in file: C:\Users\Omar\AppData\Local\Temp\quxkwpsz.lxv
[info] ----------------------------------------------------
Press any key to continue...

Which ironically seems to requires a Enter press to continue (other keys don't work). I find this prompt extremely annoying as it prevents me from running OpenCppCoverage quickly and seeing the result in Visual Studio immediately.

I have noticed this was added intentionally as part of the main package to support the plugin mode: https://github.com/OpenCppCoverage/OpenCppCoverage/blob/2e280a5bda2d67789d6b60f8f8c0de6038a41314/OpenCppCoverage/OpenCppCoverage.cpp#L200

if (options->IsPlugingModeEnabled())
{
  std::cout << "Press any key to continue... ";
  std::cin.get();
}

My request/suggestion would be to add a checkbox on the plugin side to disable this prompt. The prompt seems tied to the --plugin command-line argument which appears to only be used for that specific thing at the moment.

Regards, Omar

OpenCppCoverage commented 6 years ago

Hello,

I added this feature to let the user see the tests result. The ideal solution is described here but it requires a lot of time and not planned yet. I will try to add a checkbox to disable the prompt in the next release.

Note: If you cannot wait, you can compile the plugin and remove the line builder.Append(" " + PluginFlag + " "); in OpenCppCoverageCmdLine.cs.

OpenCppCoverage

ocornut commented 6 years ago

Thanks for your answer. Yes, I’ll try to recompile without passing the flag.

I added this feature to let the user see the tests result.

In this case I am happy seeing the visual studio gui version of the results (to confirm “progress” when expanding my potential test suite).

michalfita commented 5 years ago

People like me who use Test Adaptor for Google Test probably don't care about results when they run Coverage Check from the plugin. Hence, I vote for the tick box.

OpenCppCoverage commented 5 years ago

Hello,

OpenCppCoverage plugin version 0.9.7.0 should fixes this issue. When you execute the command Run OpenCppCoverage the program output and the message Press any key to continue are not displayed. Please see documentation for further explanation.

OpenCppCoverage.

ocornut commented 4 years ago

Thank you for the change, very much appreciated!

rajarathinam commented 1 year ago

Hello,

I am using version 0.9.9.0, but still i see the 'Press any key to continue" option when i execute from commandline.

What should be the 'plugin=?" in config file?

I'm executing the the below line in cmd.exe "C:\Program Files\OpenCppCoverage\OpenCppCoverage.exe" --config_file=D:\OneClickCoverageTool\config.txt -- D:\git\ap\test\bin64\IGSIunittest_dbg.exe

I would like to remove the ' Press any key to continue', so that i can run the multiple unittests and get complete coverage,