Skip to content
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
1 change: 0 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion tooling/debugger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,4 @@ serde_json.workspace = true
[dev-dependencies]
assert_cmd = "2.0.12"
rexpect = "0.5.0"
test-binary = "3.0.1"
tempfile.workspace = true
12 changes: 5 additions & 7 deletions tooling/debugger/tests/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,27 @@ mod tests {

use rexpect::spawn_bash;

test_binary::build_test_binary_once!(mock_backend, "../backend_interface/test-binaries");

// include tests generated by `build.rs`
include!(concat!(env!("OUT_DIR"), "/debug.rs"));

pub fn debugger_execution_success(test_program_dir: &str) {
let nargo_bin =
cargo_bin("nargo").into_os_string().into_string().expect("Cannot parse nargo path");

let mock_backend_path =
path_to_mock_backend().into_string().expect("Cannot parse mock_backend path");

let mut dbg_session = spawn_bash(Some(10000)).expect("Could not start bash session");

// Set backend to `/dev/null` to force an error if nargo tries to speak to a backend.
dbg_session
.send_line(&format!("export NARGO_BACKEND_PATH={}", mock_backend_path))
.send_line("export NARGO_BACKEND_PATH=/dev/null")
.expect("Could not export NARGO_BACKEND_PATH.");
dbg_session.wait_for_prompt().expect("Could not export NARGO_BACKEND_PATH.");

// Start debugger and test that it loads for the given program.
dbg_session
.execute(
&format!("{} debug --program-dir {} --force-brillig", nargo_bin, test_program_dir),
&format!(
"{nargo_bin} debug --program-dir {test_program_dir} --force-brillig --expression-width 3"
),
".*\\Starting debugger.*",
)
.expect("Could not start debugger");
Expand Down