Zig NEWS

Discussion on: Setting up Visual Studio Code for writing Zig

 
guidorice profile image
guidorice • Edited

Figured it out: to run the test executable in a debugger, first run zig build test, then a test executable will be in the cache dir:

$ find zig-cache -name test
zig-cache/o/31202ceebbfdf2cf8ee2be9565e64183/test
Enter fullscreen mode Exit fullscreen mode

An example launch.json using the CodeLLDB extension:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "lldb",
            "request": "launch",
            "name": "Debug test runner",
            "program": "${workspaceFolder}/zig-cache/o/31202ceebbfdf2cf8ee2be9565e64183/test",
            "args": ["src/main.zig"],
            "cwd": "${workspaceFolder}"
        }
    ]
}
Enter fullscreen mode Exit fullscreen mode

Now try hitting some breakpoints in your tests- it works for me.

Thread Thread
 
drew profile image
Drew

Tried this today, but there's nothing in there called test. Have you found a solution that works with 0.11?