Skip to content
This repository has been archived by the owner on Sep 27, 2021. It is now read-only.

How To: Unit Testing

gokuldharan edited this page Oct 6, 2018 · 5 revisions

The following steps will ensure that code can be thoroughly tested independent of the hardware it will be running on.

  1. Add source file (e.g. newInterface.cpp) under Common/ that does not depend on any board-specific drivers.
  2. Write a test source file using the GoogleTest/GoogleMock framework add it under Common/test.
  3. Navigate to the new source and test files within the linked resources to Common/ in RobotTest and uncheck "Exclude resource from build" under Properties->C/C++ Build->Settings for all relevant configurations.
  4. Run Unit Tests under all configurations (eg. Test_F4 and Test_F7) to ensure the new code is portable to all required hardware options.