Files
bproto/.vscode/tasks.json
2025-04-14 14:43:03 +02:00

155 lines
4.7 KiB
JSON

{
"version": "2.0.0",
"tasks": [
{"label": "Antlr: Generate Parser",
"type": "shell",
"command": "antlr4",
"args": [
"-Dlanguage=Python3",
"-visitor",
"-o",
"src/gen",
"bprotoV1.g4"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": []
},
{"label": "Bproto compiler C",
"type": "shell",
"command": "${command:python.interpreterPath}",
"args": [
"src/main.py",
"-i", "test/test_protocol.bproto",
"-o", "test/backend_output",
"-t", "c"
],
"problemMatcher": []
},
{"label": "CMake: Configure C Test",
"type": "cmake",
"options": {
"cwd": "${workspaceFolder}/test/output/c"
},
"command": "configure",
"args": [
"-DCMAKE_BUILD_TYPE=Debug"
],
"problemMatcher": []
},
{"label": "CMake: Build C Tests",
"type": "cmake",
"options": {
"cwd": "${workspaceFolder}/test/output/c"
},
"command": "build",
"args": [
"all"
],
"problemMatcher": ["$gcc"],
"dependsOn": ["Bproto compiler C"],
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "dedicated",
"showReuseMessage": true,
"clear": true
}
},
{"label": "Run C Tests",
"type": "shell",
"command": "build/test_runner",
"problemMatcher": ["$gcc"],
"dependsOn": ["CMake: Build C Tests"],
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "dedicated",
"showReuseMessage": true,
"clear": true
}
},
{"label": "gcovr: Generate C Coverage",
"type": "shell",
"command": "gcovr",
"args": [
"-p", "--txt",
"--xml", "coverage/cov_c.xml",
"--root", ".",
"--object-directory", "build/CMakeFiles/test_runner.dir/src/"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [],
"dependsOn": ["Run C Tests"],
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "dedicated",
"showReuseMessage": true,
"clear": true
}
},
{"label": "Run Compiler Python",
"type": "shell",
"command": "${command:python.interpreterPath}",
"args": [
"src/main.py",
"-i", "test/test_protocol.bproto",
"-o", "test/backend_output",
"-t", "python"
],
"problemMatcher": []
},
{"label": "pytest coverage",
"type": "shell",
"command": "${command:python.interpreterPath}",
"options": {
"cwd": "${workspaceFolder}",
"env": {
"TEST_COVERAGE": "1" // This cause integration tests to be ignored, as they push up the coverage
}
},
"args": [
"-m",
"pytest",
"--cov",
"--cov-report=term",
"--cov-report=xml",
],
"problemMatcher": [],
"dependsOn": ["Run Compiler Python"]
},
{"label": "pytest test",
"type": "shell",
"command": "${command:python.interpreterPath}",
"options": {
"cwd": "${workspaceFolder}",
},
"args": [
"-m",
"pytest",
"--cov",
"--cov-report=term",
"--cov-report=xml",
],
"problemMatcher": [],
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "dedicated",
"showReuseMessage": true,
"clear": true
},
"dependsOn": [ "Run Compiler Python" ]
},
]
}