Skip to content

Commit

Permalink
Merge torrust#295: Update config for debugging in VSCode
Browse files Browse the repository at this point in the history
3cf9c44 test: add two more test torrents (Jose Celano)
50cef81 chore: update config for debuggin in Visual Studio Code (Jose Celano)

Pull request description:

  Updated configuration for debugging in Visual Studio Code following this guide:

  https://www.forrestthewoods.com/blog/how-to-debug-rust-with-visual-studio-code/

  by @forrestthewoods

  Thank you very much @forrestthewoods!

  I've also added a minimal torrent to reproduce a bug described [here](torrust#266).

ACKs for top commit:
  josecelano:
    ACK 3cf9c44

Tree-SHA512: 6a093101ca3172727610cd49abc94ef9a4bde20edb5d9bc7a718f105511d9c1a709ed39b132f3301b46e4a6c52120ffe4390bcf259d3a97b3fcb5b6f08cabcfd
  • Loading branch information
josecelano committed Sep 15, 2023
2 parents 52926a3 + 3cf9c44 commit bf989a1
Show file tree
Hide file tree
Showing 3 changed files with 188 additions and 27 deletions.
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

0 comments on commit bf989a1

Please sign in to comment.