This will build a set of executable files in the obj/test folder, one for each *_ file. From the root folder of the project simply do: The tests and test build system is very simple and based off the googletest example files, it will be improved in due course.
CLEANFLIGHT FIRMWARE FOR BEE CORE CODE
All code is also instrumented using gcov to make test coverage analysis possible. Note: Tests are written in C++ and linked with with firmware's C code. This project could really do with some functional tests which test the behaviour of the application.Īll pull requests to add/improve the testability of the code or testing methods are highly sought! This allows you to develop tests and code and actually execute it to make sure it works without needing a development board or simulator. The tests are compiled and run natively on your development machine and not on the target platform. Tests currently live in the test folder and they use the google test framework. If you want to make changes and want to make sure it's tested then focus on the minimal set of changes required to add a test. However, since this is a legacy codebase which was not designed to be tested this might be a bit difficult. Ideally, there should be tests for any new code.
It is also advised to read about clean code, here are some useful links: Know that there's always more than one way to do something and that code is never final - but it does have to work.
CLEANFLIGHT FIRMWARE FOR BEE CORE PROFESSIONAL
This document is primarily for developers.