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