https://github.com/dylanmckay/avr-compiler-integration-tests
AVR compiler test suite
https://github.com/dylanmckay/avr-compiler-integration-tests
avr microcontrollers testing-tools
Last synced: 26 days ago
JSON representation
AVR compiler test suite
- Host: GitHub
- URL: https://github.com/dylanmckay/avr-compiler-integration-tests
- Owner: dylanmckay
- License: mit
- Created: 2017-07-06T12:47:49.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2021-02-01T08:06:35.000Z (about 5 years ago)
- Last Synced: 2025-04-03T09:03:36.175Z (11 months ago)
- Topics: avr, microcontrollers, testing-tools
- Language: Rust
- Homepage:
- Size: 152 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# avr-test-suite
[](https://crates.io/crates/avr-test-suite)
[](https://travis-ci.org/dylanmckay/avr-test-suite)
[]()
A standalone test-suite for AVR compilers.
Uses [simavr](https://github.com/buserror/simavr) under the hood.
# Usage
```bash
git clone https://github.com/dylanmckay/avr-test-suite.git
cd avr-test-suite
# Run all tests
./run-tests.sh
```
# Binaries
There are two binaries included in this crate.
## `avr-lit`
The test runner.
Usage
```bash
cd avr-test-suite
# Run all tests with avr-gcc
cargo run --bin avr-lit -- --avr-gcc
# Run specific test with avr-gcc
cargo run --bin avr-lit -- --avr-gcc tests/memory/copy-immediate-to-sram/copy_u32.cpp
# Run all tests with llvm
cargo run --bin avr-lit -- --llvm-sysroot /path/to/llvm/buildtree
# Run specific test with avr-gcc
cargo run --bin avr-lit -- --llvm-sysroot /path/to/llvm/buildtree tests/memory/copy-immediate-to-sram/copy_string.cpp
```
## `avr-sim`
An avr simulator that will flash binaries given to it onto an emulated
AVR and execute the program until it goes into indefinite sleep mode with
interrupts disabled.
It will also connect the simulated UART to standard output, which can
then be used by tests or other stuff.
Usage
```bash
cd avr-test-suite
# Run a program by loading it via disk
cargo run --bin avr-sim MyExecutable.elf
# Compile a file and pipe it directly into the simulator to run.
echo 'int main() { return 0; }' > main.c
avr-gcc main.c -mmcu=atmega328 -o /dev/stdout | cargo run --bin avr-sim MyExecutable
```
# Test format
Uses the [lit](https://crates.io/crates/lit) crate.
# Coverage
* Basic copying of immediate integer values to SRAM
* Memory copying from one chunk of RAM to another chunk
# Tests yet to be implemented
* Calling convention tests
* Interrupt handler tests
* ... many more