tests.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #ifndef TESTS_H
  2. #define TESTS_H
  3. #define TEST_ASSERT_VAL(text, cond) \
  4. do { \
  5. if (!(cond)) { \
  6. pr_debug("FAILED %s:%d %s\n", __FILE__, __LINE__, text); \
  7. return -1; \
  8. } \
  9. } while (0)
  10. #define TEST_ASSERT_EQUAL(text, val, expected) \
  11. do { \
  12. if (val != expected) { \
  13. pr_debug("FAILED %s:%d %s (%d != %d)\n", \
  14. __FILE__, __LINE__, text, val, expected); \
  15. return -1; \
  16. } \
  17. } while (0)
  18. enum {
  19. TEST_OK = 0,
  20. TEST_FAIL = -1,
  21. TEST_SKIP = -2,
  22. };
  23. struct test {
  24. const char *desc;
  25. int (*func)(void);
  26. };
  27. /* Tests */
  28. int test__vmlinux_matches_kallsyms(void);
  29. int test__openat_syscall_event(void);
  30. int test__openat_syscall_event_on_all_cpus(void);
  31. int test__basic_mmap(void);
  32. int test__PERF_RECORD(void);
  33. int test__perf_evsel__roundtrip_name_test(void);
  34. int test__perf_evsel__tp_sched_test(void);
  35. int test__syscall_openat_tp_fields(void);
  36. int test__pmu(void);
  37. int test__attr(void);
  38. int test__dso_data(void);
  39. int test__dso_data_cache(void);
  40. int test__dso_data_reopen(void);
  41. int test__parse_events(void);
  42. int test__hists_link(void);
  43. int test__python_use(void);
  44. int test__bp_signal(void);
  45. int test__bp_signal_overflow(void);
  46. int test__task_exit(void);
  47. int test__sw_clock_freq(void);
  48. int test__code_reading(void);
  49. int test__sample_parsing(void);
  50. int test__keep_tracking(void);
  51. int test__parse_no_sample_id_all(void);
  52. int test__dwarf_unwind(void);
  53. int test__hists_filter(void);
  54. int test__mmap_thread_lookup(void);
  55. int test__thread_mg_share(void);
  56. int test__hists_output(void);
  57. int test__hists_cumulate(void);
  58. int test__switch_tracking(void);
  59. int test__fdarray__filter(void);
  60. int test__fdarray__add(void);
  61. int test__kmod_path__parse(void);
  62. int test__thread_map(void);
  63. int test__llvm(void);
  64. int test__bpf(void);
  65. int test_session_topology(void);
  66. #if defined(__arm__) || defined(__aarch64__)
  67. #ifdef HAVE_DWARF_UNWIND_SUPPORT
  68. struct thread;
  69. struct perf_sample;
  70. int test__arch_unwind_sample(struct perf_sample *sample,
  71. struct thread *thread);
  72. #endif
  73. #endif
  74. #endif /* TESTS_H */