MCPcopy Index your code
hub / github.com/endbasic/endbasic / build_machine

Method build_machine

std/src/testutils.rs:612–637  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

610
611impl Tester {
612 fn build_machine(&self) -> Machine {
613 // Default to the no-op pins that always return errors. GPIO unit tests use MockPins
614 // directly via `make_mock_machine` to validate operation; this Tester wiring is only used
615 // for the error-path tests that go through the real (NoopPins) backend.
616 let gpio_pins = Rc::from(RefCell::from(gpio::NoopPins::default()));
617 let mut builder = MachineBuilder::default()
618 .with_console(self.console.clone())
619 .with_datetime(self.datetime.clone())
620 .with_globals(self.global_defs.clone())
621 .with_gpio_pins(gpio_pins)
622 .with_signals_chan((self.signals_tx.clone(), self.signals_rx.clone()));
623
624 for callable in self.callables.clone() {
625 builder.add_callable(callable);
626 }
627
628 if self.interactive {
629 builder
630 .make_interactive()
631 .with_program(self.program.clone())
632 .with_storage(self.storage.clone())
633 .build()
634 } else {
635 builder.build()
636 }
637 }
638
639 /// Creates a new tester with an empty `Machine`.
640 pub fn empty() -> Self {

Callers 3

runMethod · 0.80
continue_from_hereMethod · 0.80
run_nMethod · 0.80

Calls 10

with_signals_chanMethod · 0.80
with_gpio_pinsMethod · 0.80
with_globalsMethod · 0.80
with_datetimeMethod · 0.80
with_consoleMethod · 0.80
with_storageMethod · 0.80
with_programMethod · 0.80
make_interactiveMethod · 0.80
add_callableMethod · 0.45
buildMethod · 0.45

Tested by

no test coverage detected