matepek / vscode-catch2-test-adapter

Catch2, Google Test and doctest Adapter for the VSCode
https://marketplace.visualstudio.com/items?itemName=matepek.vscode-catch2-test-adapter
MIT License
210 stars 52 forks source link

Continuous run not working when dependsOn file is changed #448

Closed sargon2 closed 1 month ago

sargon2 commented 1 month ago

Checklist

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:

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

matepek commented 1 month ago

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.