brobeson / ctest-lab

A CTest extension for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=brobeson.ctest-lab
MIT License
1 stars 1 forks source link

Refresh handler #3

Closed PhilipNelson5 closed 2 years ago

PhilipNelson5 commented 2 years ago

implement a refresh handler and use it to replace discover tests

When a refresh handler is present, a refresh button will appear in the test UI panel and will be called when the button is clicked. The handler returns a promise that resolves when tests are refreshed, informing the UI to stop progress animations.

The refresh handler is provided a cancellation token which gives the user with the ability to cancel the operation. This is the reason to keep the call to ctest as an async spawn instead of syncronous. When cancellation is requested, the asynchronous process can be signaled to stop. I tested this by replacing the call to ctest with sleep infinity which I was able to cancel in the UI and get a nice error message in the output window.