tc_comm.h 979 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. *
  8. */
  9. #ifndef __TC_COMM_H__
  10. #define __TC_COMM_H__
  11. /*
  12. * RT-Thread TestCase
  13. *
  14. */
  15. #include <rtthread.h>
  16. #ifdef RT_USING_FINSH
  17. #include <finsh.h>
  18. #endif
  19. #if RT_THREAD_PRIORITY_MAX == 8
  20. #define THREAD_PRIORITY 6
  21. #elif RT_THREAD_PRIORITY_MAX == 32
  22. #define THREAD_PRIORITY 25
  23. #elif RT_THREAD_PRIORITY_MAX == 256
  24. #define THREAD_PRIORITY 200
  25. #endif
  26. #define THREAD_STACK_SIZE 512
  27. #define THREAD_TIMESLICE 5
  28. #define TC_STAT_END 0x00
  29. #define TC_STAT_RUNNING 0x01
  30. #define TC_STAT_FAILED 0x10
  31. #define TC_STAT_PASSED 0x00
  32. #ifdef RT_USING_TC
  33. void tc_start(const char* tc_prefix);
  34. void tc_stop(void);
  35. void tc_done(rt_uint8_t state);
  36. void tc_stat(rt_uint8_t state);
  37. void tc_cleanup(void (*cleanup)(void));
  38. #else
  39. #define tc_start(x)
  40. #define tc_stop()
  41. #define tc_done(s)
  42. #define tc_stat(s)
  43. #define tc_cleanup(c)
  44. #endif
  45. #endif