This repository has been archived by the owner on Jul 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rust-tide: Move to gdb remote and add vscode support (#825)
* Move to gdb remote and add vscode support * remove launch.json comments and gdb install info * update to tide 0.10 * dockerfile for base * fix copy error * add logging to base server * update base reference * include test library implementation Co-authored-by: Kamran Shamsi <[email protected]>
- Loading branch information
Showing
12 changed files
with
108 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
experimental/rust-tide/image/project/server/bin/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM rust:1.43.1-buster | ||
# This file is used to publish the server as a base image. | ||
# docker build -t docker.io/number9/rust-tide-base:v1.0.0 . | ||
# docker push docker.io/number9/rust-tide-base:v1.0.0 . | ||
|
||
WORKDIR "/project/server/bin" | ||
|
||
COPY Cargo.toml ./ | ||
|
||
WORKDIR "/project/server/bin/src" | ||
|
||
COPY src ./ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
cargo build --manifest-path ../server/bin/Cargo.toml | ||
cargo run --manifest-path ../server/bin/Cargo.toml & | ||
|
||
until $(curl --output /dev/null --silent --head --fail http://127.0.0.1:8000); do | ||
printf '.'; | ||
sleep 0.2; | ||
done | ||
|
||
cargo test --manifest-path ../server/bin/Cargo.toml -p rust-tide-default | ||
kill -9 $(pidof rust-tide-server) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
experimental/rust-tide/templates/default/.vscode/launch.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "(gdb) Launch", | ||
"type": "cppdbg", | ||
"request": "launch", | ||
"program": "${workspaceFolder}/rust-tide-server", | ||
"args": [], | ||
"stopAtEntry": false, | ||
"cwd": "${workspaceFolder}", | ||
"environment": [], | ||
"externalConsole": false, | ||
"MIMode": "gdb", | ||
"miDebuggerServerAddress": "localhost:1234", | ||
"serverLaunchTimeout": 1000, | ||
"setupCommands": [ | ||
{ | ||
"description": "Enable pretty-printing for gdb", | ||
"text": "-enable-pretty-printing", | ||
"ignoreFailures": true | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
experimental/rust-tide/templates/default/tests/test-lib.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
use async_std::task; | ||
|
||
#[test] | ||
fn hello_world() -> Result<(), http_types::Error> { | ||
task::block_on(async { | ||
let string = surf::get(format!("http://127.0.0.1:{}", 8000)) | ||
.recv_string() | ||
.await | ||
.unwrap(); | ||
assert_eq!(string, "Hello, world!".to_string()); | ||
Ok(()) | ||
}) | ||
} |