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

runTask always reporting "Task not found" #418

Closed Ext3h closed 9 months ago

Ext3h commented 10 months ago

Checklist

Describe the bug

Expected behavior

Actual behavior

To Reproduce

I have a task configured in tasks.json in my VSCode user directory:

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "cmake",
            "label": "build_all",
            "command": "build",
            "targets": [
                "all"
            ],
            "preset": "${command:cmake.activeBuildPresetName}",
            "group": "build",
            "problemMatcher": [],
            "detail": "CMake template build task"
        }
    ]
}

I can run this task via Tasks: Run Task by the name build_all - so I'm confident that the task exists and it can run without errors.

I have configured TestMate to run this task:

    "testMate.cpp.test.advancedExecutables": [
        {
            "pattern":  "${command:cmake.buildDirectory}/**/test*",
            "runTask": {
                "before": [
                    "build_all"
                ]
            }
        }
    ]
  1. Go to Test Explorer
  2. Click on "Debug" Icon next to any test
  3. See error

Screenshots (optional)

image

Desktop

Log

testmate.log redacted by matepek

matepek commented 9 months ago

I think the issue is related to this extension. This variable resolve to empty: "preset": "${command:cmake.activeBuildPresetName}",. And this causing issue.

matepek commented 9 months ago

Sorry but I'm not familiar of cmake extension.