tc_comm.h 826 B

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