Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update config for debugging in VSCode #295

Merged
merged 2 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
213 changes: 186 additions & 27 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,35 +1,194 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in library 'torrust-index-backend'",
"cargo": {
"args": [
"test",
"--no-run",
"--lib",
"--package=torrust-index-backend"
],
"filter": {
"name": "torrust-index-backend",
"kind": "lib"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'main'",
"cargo": {
"args": [
"build",
"--bin=main",
"--package=torrust-index-backend"
],
"filter": {
"name": "main",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'main'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=main",
"--package=torrust-index-backend"
],
"filter": {
"name": "main",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'import_tracker_statistics'",
"cargo": {
"args": [
"build",
"--bin=import_tracker_statistics",
"--package=torrust-index-backend"
],
"filter": {
"name": "import_tracker_statistics",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'import_tracker_statistics'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=import_tracker_statistics",
"--package=torrust-index-backend"
],
"filter": {
"name": "import_tracker_statistics",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'parse_torrent'",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/target/debug/parse_torrent",
"args": ["./tests/fixtures/torrents/MC_GRID.zip-3cd18ff2d3eec881207dcc5ca5a2c3a2a3afe462.torrent"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "cargo build",
"miDebuggerPath": "/usr/bin/gdb",
"linux": {
"miDebuggerPath": "/usr/bin/gdb"
},
"windows": {
"miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe"
},
"osx": {
"miDebuggerPath": "/usr/local/bin/gdb"
}
"cargo": {
"args": [
"build",
"--bin=parse_torrent",
"--package=torrust-index-backend"
],
"filter": {
"name": "parse_torrent",
"kind": "bin"
}
},
"args": ["./tests/fixtures/torrents/not-working-with-two-nodes.torrent"],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'parse_torrent'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=parse_torrent",
"--package=torrust-index-backend"
],
"filter": {
"name": "parse_torrent",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug executable 'upgrade'",
"cargo": {
"args": [
"build",
"--bin=upgrade",
"--package=torrust-index-backend"
],
"filter": {
"name": "upgrade",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug unit tests in executable 'upgrade'",
"cargo": {
"args": [
"test",
"--no-run",
"--bin=upgrade",
"--package=torrust-index-backend"
],
"filter": {
"name": "upgrade",
"kind": "bin"
}
},
"args": [],
"cwd": "${workspaceFolder}"
},
{
"type": "lldb",
"request": "launch",
"name": "Debug integration test 'mod'",
"cargo": {
"args": [
"test",
"--no-run",
"--test=mod",
"--package=torrust-index-backend"
],
"filter": {
"name": "mod",
"kind": "test"
}
},
"args": [],
"cwd": "${workspaceFolder}"
}
]
}
1 change: 1 addition & 0 deletions tests/fixtures/torrents/not-working-with-two-nodes.torrent
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d4:infod6:lengthi8e4:name11:minimal.txt12:piece lengthi16384e6:pieces20:0��QJ� Ќ4B&g��#Mxe5:nodesll15:188.163.121.224i56711eel14:162.250.131.26i13386eeee
1 change: 1 addition & 0 deletions tests/fixtures/torrents/working-with-one-node.torrent
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
d4:infod6:lengthi8e4:name11:minimal.txt12:piece lengthi16384e6:pieces20:0��QJ� Ќ4B&g��#Mxe5:nodesll15:188.163.121.224i56711eeee