implements PLN-0108

This commit is contained in:
2026-06-15 06:04:29 +01:00
parent f45b3a38cb
commit 117a18ee72
5 changed files with 155 additions and 147 deletions
@@ -372,7 +372,7 @@ impl HostDebugger {
#[cfg(test)]
mod tests {
use super::*;
use prometeu_drivers::hardware::Hardware;
use prometeu_drivers::TestPlatform;
use prometeu_hal::debugger_protocol::DebugCommand;
#[test]
@@ -396,15 +396,19 @@ mod tests {
fn handle_command_updates_pause_and_step_flags_without_host_io() {
let mut debugger = HostDebugger::new();
let mut firmware = Firmware::new(None);
let mut hardware = Hardware::new();
let mut platform = TestPlatform::new();
debugger.handle_command(DebugCommand::Pause, &mut firmware, &mut hardware);
debugger.handle_command(DebugCommand::Pause, &mut firmware, platform.local_hardware_mut());
assert!(firmware.os.vm().paused());
debugger.handle_command(DebugCommand::Resume, &mut firmware, &mut hardware);
debugger.handle_command(DebugCommand::Resume, &mut firmware, platform.local_hardware_mut());
assert!(!firmware.os.vm().paused());
debugger.handle_command(DebugCommand::StepFrame, &mut firmware, &mut hardware);
debugger.handle_command(
DebugCommand::StepFrame,
&mut firmware,
platform.local_hardware_mut(),
);
assert!(!firmware.os.vm().paused());
assert!(firmware.os.vm().debug_step_requested());
}
@@ -413,12 +417,12 @@ mod tests {
fn handle_command_start_leaves_waiting_for_start_mode() {
let mut debugger = HostDebugger::new();
let mut firmware = Firmware::new(None);
let mut hardware = Hardware::new();
let mut platform = TestPlatform::new();
debugger.waiting_for_start = true;
firmware.os.vm().set_paused(true);
debugger.handle_command(DebugCommand::Start, &mut firmware, &mut hardware);
debugger.handle_command(DebugCommand::Start, &mut firmware, platform.local_hardware_mut());
assert!(!debugger.waiting_for_start);
assert!(!firmware.os.vm().paused());