unity_config.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #ifndef UNITY_CONFIG_H
  2. #define UNITY_CONFIG_H
  3. // This file gets included from unity.h via unity_internals.h
  4. // It is inside #ifdef __cplusplus / extern "C" block, so we can
  5. // only use C features here
  6. #include <esp_err.h>
  7. #include <stddef.h>
  8. #include "sdkconfig.h"
  9. #ifdef CONFIG_UNITY_ENABLE_FLOAT
  10. #define UNITY_INCLUDE_FLOAT
  11. #else
  12. #define UNITY_EXCLUDE_FLOAT
  13. #endif //CONFIG_UNITY_ENABLE_FLOAT
  14. #ifdef CONFIG_UNITY_ENABLE_DOUBLE
  15. #define UNITY_INCLUDE_DOUBLE
  16. #else
  17. #define UNITY_EXCLUDE_DOUBLE
  18. #endif //CONFIG_UNITY_ENABLE_DOUBLE
  19. #ifdef CONFIG_UNITY_ENABLE_COLOR
  20. #define UNITY_OUTPUT_COLOR
  21. #endif
  22. #define UNITY_EXCLUDE_TIME_H
  23. void unity_flush(void);
  24. void unity_putc(int c);
  25. void unity_gets(char* dst, size_t len);
  26. void unity_exec_time_start(void);
  27. void unity_exec_time_stop(void);
  28. uint32_t unity_exec_time_get_ms(void);
  29. #define UNITY_OUTPUT_CHAR(a) unity_putc(a)
  30. #define UNITY_OUTPUT_FLUSH() unity_flush()
  31. #define UNITY_EXEC_TIME_START() unity_exec_time_start()
  32. #define UNITY_EXEC_TIME_STOP() unity_exec_time_stop()
  33. #define UNITY_EXEC_TIME_MS() unity_exec_time_get_ms()
  34. #ifdef CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER
  35. #include "unity_test_runner.h"
  36. #endif //CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER
  37. // shorthand to check esp_err_t return code
  38. #define TEST_ESP_OK(rc) TEST_ASSERT_EQUAL_HEX32(ESP_OK, rc)
  39. #define TEST_ESP_ERR(err, rc) TEST_ASSERT_EQUAL_HEX32(err, rc)
  40. #endif //UNITY_CONFIG_H