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

Workspace path substitution accepts only some variables #51

Open w8jcik opened 11 months ago

w8jcik commented 11 months ago

In particular paths "cpputestTestAdapter.testExecutable" and "cpputestTestAdapter.testExecutablePath" accept workspaceFolder but not workspaceRoot.

I am not sure if workspaceFolder should be used instead of workspaceRoot for some reason, but this behavior is not consistent.

Other entries in settings.json accept workspaceRoot.

Additional issue is that with workspaceRoot used, there is no warning or error, just the test panel is empty. At least log should say something that executable doesn't exist.

The least confusing would be to offer notification.

VSCode 1.82.2 CppUTest Test Adapter 1.1.0

bneumann commented 4 months ago

I added some log information in the latest version. I know this is confusing but I am bound to replace everything manually unless https://github.com/microsoft/vscode/issues/46471 is fixed

ben-edna commented 3 months ago

Also workspaceFolders for multi-root workspaces are not accepted.

e.g.

    "folders": [
        {
            "name": "Tests",
            "path": "../Tests"
        },
        {
            "name": "Source",
            "path": "../Src"
        }
    ],
    "settings": {
        "cpputestTestAdapter.testExecutable": "${workspaceFolder:Tests}/Unit/build/myTest.exe",
        "cpputestTestAdapter.testExecutablePath": "${workspaceFolder:Tests}/Unit/build"
    },

The tests are also indexed twice with the above workspace as can be seen here:

image