ipa_ut_i.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright (c) 2016-2018, The Linux Foundation. All rights reserved.
  4. */
  5. #ifndef _IPA_UT_I_H_
  6. #define _IPA_UT_I_H_
  7. /* Suite data global structure name */
  8. #define _IPA_UT_SUITE_DATA(__name) ipa_ut_ ##__name ##_data
  9. /* Suite meta-data global structure name */
  10. #define _IPA_UT_SUITE_META_DATA(__name) ipa_ut_ ##__name ##_meta_data
  11. /* Suite global array of tests */
  12. #define _IPA_UT_SUITE_TESTS(__name) ipa_ut_ ##__name ##_tests
  13. /* Global array of all suites */
  14. #define _IPA_UT_ALL_SUITES ipa_ut_all_suites_data
  15. /* Meta-test "all" name - test to run all tests in given suite */
  16. #define _IPA_UT_RUN_ALL_TEST_NAME "all"
  17. /**
  18. * Meta-test "regression" name -
  19. * test to run all regression tests in given suite
  20. */
  21. #define _IPA_UT_RUN_REGRESSION_TEST_NAME "regression"
  22. /* Test Log buffer name and size */
  23. #define _IPA_UT_TEST_LOG_BUF_NAME ipa_ut_tst_log_buf
  24. #define _IPA_UT_TEST_LOG_BUF_SIZE 8192
  25. /* Global structure for test fail execution result information */
  26. #define _IPA_UT_TEST_FAIL_REPORT_DATA ipa_ut_tst_fail_report_data
  27. #define _IPA_UT_TEST_FAIL_REPORT_SIZE 5
  28. #define _IPA_UT_TEST_FAIL_REPORT_IDX ipa_ut_tst_fail_report_data_index
  29. /* Start/End definitions of the array of suites */
  30. #define IPA_UT_DEFINE_ALL_SUITES_START \
  31. static struct ipa_ut_suite *_IPA_UT_ALL_SUITES[] =
  32. #define IPA_UT_DEFINE_ALL_SUITES_END
  33. /**
  34. * Suites iterator - Array-like container
  35. * First index, number of elements and element fetcher
  36. */
  37. #define IPA_UT_SUITE_FIRST_INDEX 0
  38. #define IPA_UT_SUITES_COUNT \
  39. ARRAY_SIZE(_IPA_UT_ALL_SUITES)
  40. #define IPA_UT_GET_SUITE(__index) \
  41. _IPA_UT_ALL_SUITES[__index]
  42. /**
  43. * enum ipa_ut_test_result - Test execution result
  44. * @IPA_UT_TEST_RES_FAIL: Test executed and failed
  45. * @IPA_UT_TEST_RES_SUCCESS: Test executed and succeeded
  46. * @IPA_UT_TEST_RES_SKIP: Test was not executed.
  47. *
  48. * When running all tests in a suite, a specific test could
  49. * be skipped and not executed. For example due to mismatch of
  50. * IPA H/W version.
  51. */
  52. enum ipa_ut_test_result {
  53. IPA_UT_TEST_RES_FAIL,
  54. IPA_UT_TEST_RES_SUCCESS,
  55. IPA_UT_TEST_RES_SKIP,
  56. };
  57. /**
  58. * enum ipa_ut_meta_test_type - Type of suite meta-test
  59. * @IPA_UT_META_TEST_ALL: Represents all tests in suite
  60. * @IPA_UT_META_TEST_REGRESSION: Represents all regression tests in suite
  61. */
  62. enum ipa_ut_meta_test_type {
  63. IPA_UT_META_TEST_ALL,
  64. IPA_UT_META_TEST_REGRESSION,
  65. };
  66. #endif /* _IPA_UT_I_H_ */