Fixed unity fixture for ESP32/S2

* Created compile switch for UNITY_MAIN
  since it was using exit() syscall leading to
  abort() on ESP
This commit is contained in:
Jakob Hasse
2020-07-23 14:32:06 +08:00
committed by Fu Hanxi
parent f789380e19
commit 40d80b981a
6 changed files with 25 additions and 4 deletions

View File

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