使用以下tasks.json
对于log库的输出(info,debug,warn...) 需要 在test方法上一行加
#[test_log::test]
(来自test-log
https://crates.io/crates/test-log)
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"problemMatcher": [
"$rustc"
],
"command": "cargo",
"args": [
"test",
"'--'",
"--nocapture",
],
"group": "test",
"label": "rust: cargo test nocapture"
}
],
"options": {
"env": {
"RUST_LOG": "DEBUG"
}
}
}
标签:cargo,tasks,nocapture,log,vscode,test
From: https://www.cnblogs.com/jing332/p/17608024.html