A unit testing framework for AVR software development.
- A minimalist test framework i.e SLOC < 120 including USART support
- Test result could be stored in EEPROM (default) or sent to host using USART.
- Tested with GCC and CMake with avr-toolchain.cmake
- Include a header file
avrunit.h
in the test unit source code - Declare
AU_OUTPUT_SETUP()
and redefineAU_OUTPUT()
to redirect results to different output interface i.e. USART. - Define AU_SERIAL macro (i.e. -DAU_SERIAL) to enable unittest result dump through USART
- Include the following files
- Build, configure and upload. See avrunit own unit test.
avrunit provides elementary assert test to reduce binary footprint size. The assert test available are
AU_ASSERT(condition)
Evaluates whether condition is TRUE
AU_IGNORED(condition)
Ignore the unit test. Useful if you want to exclude the unit test result.
AU_BROKEN(condition)
Mark the unit test as broken.
Unit testing for avrunit.h using CMake is included in tests folder. Run the test as follows:
cmake -S . -B build
cmake --build build
cmake --build build --target test