Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continuous run not working when dependsOn file is changed #448

Closed
5 tasks done
sargon2 opened this issue Sep 25, 2024 · 1 comment
Closed
5 tasks done

Continuous run not working when dependsOn file is changed #448

sargon2 opened this issue Sep 25, 2024 · 1 comment

Comments

@sargon2
Copy link

sargon2 commented Sep 25, 2024

Checklist

  • The issue is about this extension and NOT about a fork.
  • Checked the ALL the SUPPORT document.
  • The latest version of the extension was used.
  • It is not related to remote-vscode or I checked the following issue
  • Imagine yourself into my position and think how hard to debug the issue without insufficient information.
    I understand that you have privacy concerns and I expect you to understand that this extension is developed for free.
    Thanks.

Describe the bug

I have a C++ project using CMake with Ninja and catch2. I have configured advancedExecutables:

    "testMate.cpp.test.advancedExecutables": [
        {
            "pattern": "build-output/**/*{test,Test,TEST}*",
            "dependsOn": [
                "source/**/*"
            ],
            "catch2": {
                "testGrouping": {
                    "groupBySource": {
                        "label": "${sourceRelPath[2:]}",
                        "groupUngroupedTo": "Unable to determine source file",
                    }
                }
            }
        }
    ],

Here's the behavior I'm seeing:

  • Tests run fine in CMake outside of vscode.
  • When I make changes to a source file, save it, and click the little "Refresh Tests" button in the "Testing" panel, the TestMate tests show up and are correct. They also re-run if "continuous run" is enabled.
  • When I click the "run" button in the Testing panel, the tests run correctly.
  • When I hit F7 to rebuild, my test executable is successfully rebuilt, and TestMate detects this change. It desaturates test results, waits for the build to complete, and once the build completes TestMate correctly refreshes and re-runs tests (with "Continuous Run" selected).
  • When I make a change in a source file and save the file, no build is run. TestMate detects that the file was changed, and desaturates all test results. Then nothing happens -- no rediscovery is run and no tests are run.

I would like the test I'm editing to re-run when I save it. Is this possible? TestMate advertises it supports auto-running when a dependsOn file is changed, and that's what I'd like to happen.

From TestMate's perspective, I'd just like to automatically run a "Refresh Tests" (which also rebuilds and re-runs tests) when a dependsOn file is changed.

Workaround
As a workaround, after I edit the source file, I can either hit F7 to save and rebuild and re-run tests, or I can save and click "Refresh Tests" in the testing panel, which rebuilds and re-runs tests.

Logs
No TestMate logs are produced when I modify and save the test source file. I tried both testMate.cpp.log.logpanel: true and setting testMate.cpp.log.logfile.

Desktop

  • Extension Version: 4.12.0
  • VS Code Version: 1.93.1
  • Catch2 / Google Test / DOCTest Version: catch2 3.7.0
  • OS Type and Version: Windows 11
  • Using remote-ssh/docker/wsl?: No
@matepek
Copy link
Owner

matepek commented Oct 17, 2024

This is C++, you have to rebuild your exec to run it.
Executables are watched, don't need dependsOn for them separately.
If you continuous run is enabled you just have to start a build and they will be run.

@matepek matepek closed this as completed Oct 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants