mirror of
				https://github.com/espressif/esp-idf.git
				synced 2025-10-31 04:59:55 +00:00 
			
		
		
		
	 40d80b981a
			
		
	
	40d80b981a
	
	
	
		
			
			* Created compile switch for UNITY_MAIN since it was using exit() syscall leading to abort() on ESP
		
			
				
	
	
		
			26 lines
		
	
	
		
			823 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			823 B
		
	
	
	
		
			C
		
	
	
	
	
	
| /* 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" }; \
 | |
|     const int argc = sizeof(argv)/sizeof(argv[0]); \
 | |
|     int rc = UnityMain(argc, argv, TEST_ ## group_ ## _GROUP_RUNNER); \
 | |
|     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
 |