[wip] unit testing

- tooling for code coverage measurement
This commit is contained in:
Jörn-Michael Miehe 2025-07-10 01:50:46 +00:00
parent 96ea0ddab9
commit cb5873b732
4 changed files with 52 additions and 17 deletions

View file

@ -47,7 +47,6 @@
"extensions": [ "extensions": [
"mhutchie.git-graph", "mhutchie.git-graph",
"Gruntfuggly.todo-tree", "Gruntfuggly.todo-tree",
"ms-vscode.live-server",
"ryanluker.vscode-coverage-gutters" "ryanluker.vscode-coverage-gutters"
] ]
} }

4
.gitignore vendored
View file

@ -1,3 +1,7 @@
# code coverage reports
coverage/
# https://github.com/github/gitignore/raw/refs/heads/main/Rust.gitignore # https://github.com/github/gitignore/raw/refs/heads/main/Rust.gitignore
# Generated by Cargo # Generated by Cargo

View file

@ -43,7 +43,6 @@
"black" "black"
], ],
"todo-tree.highlights.useColourScheme": true, "todo-tree.highlights.useColourScheme": true,
"coverage-gutters.coverageReportFileName": "target/llvm-cov/**/index.html",
// // override the default setting (`cargo check --all-targets`) which produces the following error // // override the default setting (`cargo check --all-targets`) which produces the following error
// // "can't find crate for `test`" when the default compilation target is a no_std target // // "can't find crate for `test`" when the default compilation target is a no_std target
// "rust-analyzer.checkOnSave.allTargets": false, // "rust-analyzer.checkOnSave.allTargets": false,

63
.vscode/tasks.json vendored
View file

@ -5,9 +5,6 @@
"label": "Build Project", "label": "Build Project",
"type": "cargo", "type": "cargo",
"command": "build", "command": "build",
// "presentation": {
// "reveal": "silent"
// },
"problemMatcher": "$rustc", "problemMatcher": "$rustc",
"group": "build" "group": "build"
}, },
@ -62,18 +59,6 @@
"problemMatcher": "$rustc", "problemMatcher": "$rustc",
"group": "test" "group": "test"
}, },
{
"label": "Run Coverage",
"type": "cargo",
"command": "llvm-cov",
"args": [
"--lcov",
"--output-path" ,
"target/lcov.info"
],
"problemMatcher": "$rustc",
"group": "test"
},
// { // {
// "label": "Run Integration Tests", // "label": "Run Integration Tests",
// "type": "cargo", // "type": "cargo",
@ -85,6 +70,54 @@
// "problemMatcher": "$rustc", // "problemMatcher": "$rustc",
// "group": "test" // "group": "test"
// }, // },
{
"label": "Test Coverage",
"hide": true,
"type": "cargo",
"command": "llvm-cov",
"args": [],
"problemMatcher": "$rustc",
"group": "test",
},
{
"label": "Report Coverage (html)",
"hide": true,
"type": "cargo",
"command": "llvm-cov",
"args": [
"report",
"--html",
"--output-dir" ,
"coverage",
],
"problemMatcher": "$rustc",
"group": "test"
},
{
"label": "Report Coverage (lcov)",
"hide": true,
"type": "cargo",
"command": "llvm-cov",
"args": [
"report",
"--lcov",
"--output-path" ,
"coverage/lcov.info",
],
"problemMatcher": "$rustc",
"group": "test"
},
{
"label": "Run Coverage",
"type": "shell",
"dependsOn": [
"Test Coverage",
"Report Coverage (html)",
"Report Coverage (lcov)",
],
"dependsOrder": "sequence",
"group": "test"
},
{ {
"label": "Run All Tests", "label": "Run All Tests",
"type": "shell", "type": "shell",