简体   繁体   中英

How to run rust tests with backtrace in vscode on Linux?

Using VSCode on Linux, how can I run cargo test with a backtrace?

Open the menu item at Terminal | Configure Default Build TaskTerminal | Configure Default Build Task and add an entry to the JSON configuration file as follows:

{
    "version": "2.0.0",
    "tasks": [
        {
            "type": "shell",
            "command": "RUST_BACKTRACE=1 cargo test",
            "problemMatcher": [
                "$rustc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "label": "cargo test with backtrace"
        }
    ]
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM