bneumann / CppUTest-Test-Adapter

A test adapter for Visual Studio Code for the C/C++ Unit Test framework CppUTest.
MIT License
16 stars 7 forks source link

Reloading list of available tests does not work when additional executable is added to the search path #25

Closed lokimon closed 2 years ago

lokimon commented 2 years ago

Hitting the "Refresh" button in the extension does not reload the list of available tests.

Steps to reproduce

  1. Build 1 unit test executable
  2. Start Visual Studio Code
  3. Display Test Extension
  4. Notice that 1 unit test is visible
  5. Build a different unit test
  6. Hit the refresh button.
  7. Only shows the 1 unit test that was visible.

It should reload any that match the "cpputestExplorer.testExecutable" with wildcards.

It would be awesome if there was even a watcher on that list to see if any were added or have changed automatically.

bneumann commented 2 years ago

Do you mean adding a new executable or adding a new test inside an existing executable?

The file watcher is currently switched off. Would be easy to reintegrate it

lokimon commented 2 years ago

A new executable that was created and should be added to the list. Currently have to shut down Visual Studio Code and reopen.

bneumann commented 2 years ago

Ah, yeah saw that and ignored it for now because the configuration of VS code does not refresh automatically. So when you add a new executable to the list it won't show up unless you restart the editor. Haven't had the time to check why that is

bneumann commented 2 years ago

I already started implementing a file watcher that automatically reloads the tests whenever the executable changed: https://github.com/bneumann/CppUTest-Test-Adapter/tree/feat/FileWatcher That's also where I saw the effects of vscode not updating settings variables

fuchse-ego commented 2 years ago

Hi, I'd really like to have that feature. Is this branch ready to be tested?

bneumann commented 2 years ago

Hi all, I slacked a bit on this project. Last time I checked the new test api from vscode offered a reload on changed tests. That means I need to port from the test explorer to test api. If you want you can check the branch but I am almost sure it won't work even if the tests are recognised.

bneumann commented 2 years ago

Did some work on the FileWatcher branch and ported it over to the Test API. Nice stuff by the way. You can now at least rediscover tests and it should actually take all found files into account. But i am going to test it properly

jgonzalezdr commented 2 years ago

This issue was fixed by #28. Now new executables are automatically detected when reloading or running tests.

@bneumann Having also automatic test executable change detection will be a great improvement, I'm looking forward to check that :-)

bneumann commented 2 years ago

Prerelease 1.0.6 and the corresponding release 1.0.8 are out now