tc_comm.h 853 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef __TC_COMM_H__
  2. #define __TC_COMM_H__
  3. /*
  4. * RT-Thread TestCase
  5. *
  6. */
  7. #include <rtthread.h>
  8. #ifdef RT_USING_FINSH
  9. #include <finsh.h>
  10. #endif
  11. #if RT_THREAD_PRIORITY_MAX == 8
  12. #define THREAD_PRIORITY 6
  13. #elif RT_THREAD_PRIORITY_MAX == 32
  14. #define THREAD_PRIORITY 25
  15. #elif RT_THREAD_PRIORITY_MAX == 256
  16. #define THREAD_PRIORITY 200
  17. #endif
  18. #define THREAD_STACK_SIZE 512
  19. #define THREAD_TIMESLICE 5
  20. #define TC_STAT_END 0x00
  21. #define TC_STAT_RUNNING 0x01
  22. #define TC_STAT_FAILED 0x10
  23. #define TC_STAT_PASSED 0x00
  24. #ifdef RT_USING_TC
  25. void tc_start(const char* tc_prefix);
  26. void tc_stop(void);
  27. void tc_done(rt_uint8_t state);
  28. void tc_stat(rt_uint8_t state);
  29. void tc_cleanup(void (*cleanup)(void));
  30. #else
  31. #define tc_start(x)
  32. #define tc_stop()
  33. #define tc_done(s)
  34. #define tc_stat(s)
  35. #define tc_cleanup(c)
  36. #endif
  37. #endif