Crate avr_tester

source ·
Expand description

Functional testing framework for AVR binaries, powered by simavr:

use avr_tester::*;

// Assuming `yourproject` implements a ROT-13 encoder:

#[test]
fn test() {
    let mut avr = AvrTester::atmega328p()
        .with_clock_of_16_mhz()
        .load("../../yourproject/target/atmega328p/release/yourproject.elf");

    // Let's give our firmware a moment to initialize:
    avr.run_for_ms(1);

    // Now, let's send the string:
    avr.uart0().write("Hello, World!");

    // ... give the AVR a moment to retrieve it & send back, encoded:
    avr.run_for_ms(1);

    // ... and, finally, let's assert the outcome:
    assert_eq!("Uryyb, Jbeyq!", avr.uart0().read::<String>());
}

For more details, please see README.

Structs

Enums

Traits

Functions