unity_fixture_extras.h 823 B

12345678910111213141516171819202122232425
  1. /* IDF-specific additions to "Unity Fixture" */
  2. #pragma once
  3. #ifndef CONFIG_IDF_TARGET
  4. /* A shorthand for running one test group from the main function */
  5. #define UNITY_MAIN(group_) do { \
  6. const char* argv[] = { "test", "-v" }; \
  7. const int argc = sizeof(argv)/sizeof(argv[0]); \
  8. int rc = UnityMain(argc, argv, TEST_ ## group_ ## _GROUP_RUNNER); \
  9. printf("\nTests finished, rc=%d\n", rc); \
  10. exit(rc); \
  11. } while(0)
  12. #else // CONFIG_IDF_TARGET
  13. /* A shorthand for running one test group from the main function */
  14. #define UNITY_MAIN(group_) do { \
  15. const char* argv[] = { "test", "-v" }; \
  16. const int argc = sizeof(argv)/sizeof(argv[0]); \
  17. int rc = UnityMain(argc, argv, TEST_ ## group_ ## _GROUP_RUNNER); \
  18. printf("\nTests finished, rc=%d\n", rc); \
  19. } while(0)
  20. #endif // CONFIG_IDF_TARGET