Skip to content
Snippets Groups Projects
Unity_notes.md 1.17 KiB

Unity Notes

  • When using Unity, be sure to define UNITY_INCLUDE_CONFIG_H to use the unity_config.h. (Details on why are in the Unity Configuration Guide.)
    • For the quad directory, this is done at compile-time of the Unity library here and at compile-time of the test runner here. Both rely on the flag defined here.
  • Follow the examples in the Unity/examples for a guide, as well as the documentation in Unity/docs
    • The Unity Getting Started guide and the [Unity Assertions Cheat Sheet Suitable for Printing and Possibly Framing] (/Unity/docs/UnityAssertionsCheatSheetSuitableforPrintingandPossiblyFraming.pdf) are nice references
    • Generally, the format is to start main() with UNITY_BEGIN(), followed by calls to RUN_TEST(test_function) where test_function is a test to run, ended with return UNITY_END(). Additionally, each test_function should be a void and call the appropriate asserts.