Jiri Olsa | 0a4e1ae | 2012-11-10 01:46:41 +0100 | [diff] [blame] | 1 | #ifndef TESTS_H |
| 2 | #define TESTS_H |
| 3 | |
Jiri Olsa | 450ac18 | 2013-06-07 15:37:03 +0200 | [diff] [blame] | 4 | #define TEST_ASSERT_VAL(text, cond) \ |
| 5 | do { \ |
| 6 | if (!(cond)) { \ |
| 7 | pr_debug("FAILED %s:%d %s\n", __FILE__, __LINE__, text); \ |
| 8 | return -1; \ |
| 9 | } \ |
| 10 | } while (0) |
| 11 | |
Arnaldo Carvalho de Melo | 8f19601 | 2015-05-11 16:30:20 -0300 | [diff] [blame^] | 12 | #define TEST_ASSERT_EQUAL(text, val, expected) \ |
| 13 | do { \ |
| 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 | |
Jiri Olsa | f4c1ea5 | 2012-12-19 11:33:39 -0300 | [diff] [blame] | 21 | enum { |
| 22 | TEST_OK = 0, |
| 23 | TEST_FAIL = -1, |
| 24 | TEST_SKIP = -2, |
| 25 | }; |
| 26 | |
Jiri Olsa | d3b59a3 | 2012-11-10 01:46:42 +0100 | [diff] [blame] | 27 | /* Tests */ |
Jiri Olsa | 0a4e1ae | 2012-11-10 01:46:41 +0100 | [diff] [blame] | 28 | int test__vmlinux_matches_kallsyms(void); |
Jiri Olsa | d3b59a3 | 2012-11-10 01:46:42 +0100 | [diff] [blame] | 29 | int test__open_syscall_event(void); |
Jiri Olsa | bd90517 | 2012-11-10 01:46:43 +0100 | [diff] [blame] | 30 | int test__open_syscall_event_on_all_cpus(void); |
Jiri Olsa | a65b9c6 | 2012-11-10 01:46:44 +0100 | [diff] [blame] | 31 | int test__basic_mmap(void); |
Jiri Olsa | 16d00fe | 2012-11-10 01:46:45 +0100 | [diff] [blame] | 32 | int test__PERF_RECORD(void); |
Jiri Olsa | bacf7e5 | 2012-11-10 01:46:46 +0100 | [diff] [blame] | 33 | int test__rdpmc(void); |
Jiri Olsa | cfffae2 | 2012-11-10 01:46:47 +0100 | [diff] [blame] | 34 | int test__perf_evsel__roundtrip_name_test(void); |
Jiri Olsa | 5e24a09 | 2012-11-10 01:46:48 +0100 | [diff] [blame] | 35 | int test__perf_evsel__tp_sched_test(void); |
Jiri Olsa | dc447ee | 2012-11-10 01:46:49 +0100 | [diff] [blame] | 36 | int test__syscall_open_tp_fields(void); |
Jiri Olsa | cff7f95 | 2012-11-10 01:46:50 +0100 | [diff] [blame] | 37 | int test__pmu(void); |
Jiri Olsa | c81251e | 2012-11-10 01:46:51 +0100 | [diff] [blame] | 38 | int test__attr(void); |
| 39 | int test__dso_data(void); |
Jiri Olsa | 4ebbcb8 | 2014-05-12 14:43:53 +0200 | [diff] [blame] | 40 | int test__dso_data_cache(void); |
Jiri Olsa | 45dc1bb5 | 2014-05-12 14:50:03 +0200 | [diff] [blame] | 41 | int test__dso_data_reopen(void); |
Jiri Olsa | c81251e | 2012-11-10 01:46:51 +0100 | [diff] [blame] | 42 | int test__parse_events(void); |
Namhyung Kim | f8ebb0c | 2012-12-10 17:29:57 +0900 | [diff] [blame] | 43 | int test__hists_link(void); |
Arnaldo Carvalho de Melo | 54359d3 | 2012-12-14 13:06:13 -0300 | [diff] [blame] | 44 | int test__python_use(void); |
Jiri Olsa | 5a6bef4 | 2013-03-10 19:41:10 +0100 | [diff] [blame] | 45 | int test__bp_signal(void); |
Jiri Olsa | 06933e3 | 2013-03-10 19:41:11 +0100 | [diff] [blame] | 46 | int test__bp_signal_overflow(void); |
Namhyung Kim | d723a55 | 2013-03-15 14:58:11 +0900 | [diff] [blame] | 47 | int test__task_exit(void); |
Namhyung Kim | bc96b36 | 2013-03-18 11:41:47 +0900 | [diff] [blame] | 48 | int test__sw_clock_freq(void); |
Adrian Hunter | 3bd5a5f | 2013-06-28 16:22:19 +0300 | [diff] [blame] | 49 | int test__perf_time_to_tsc(void); |
Adrian Hunter | b55ae0a | 2013-08-07 14:38:45 +0300 | [diff] [blame] | 50 | int test__code_reading(void); |
Adrian Hunter | 045f8cd8 | 2013-08-27 11:23:13 +0300 | [diff] [blame] | 51 | int test__sample_parsing(void); |
Adrian Hunter | 395c307 | 2013-08-31 21:50:53 +0300 | [diff] [blame] | 52 | int test__keep_tracking(void); |
Adrian Hunter | 53a277e | 2013-09-04 23:18:16 +0300 | [diff] [blame] | 53 | int test__parse_no_sample_id_all(void); |
Jiri Olsa | aa16b81 | 2014-01-07 13:47:22 +0100 | [diff] [blame] | 54 | int test__dwarf_unwind(void); |
Namhyung Kim | 3c3cfd9 | 2014-04-25 12:28:14 +0900 | [diff] [blame] | 55 | int test__hists_filter(void); |
Jiri Olsa | 4e85edf | 2014-03-05 17:20:31 +0100 | [diff] [blame] | 56 | int test__mmap_thread_lookup(void); |
Jiri Olsa | fabf01238 | 2014-03-17 14:39:00 +0100 | [diff] [blame] | 57 | int test__thread_mg_share(void); |
Namhyung Kim | f21d181 | 2014-05-12 14:43:18 +0900 | [diff] [blame] | 58 | int test__hists_output(void); |
Namhyung Kim | 0506aec | 2014-05-23 18:04:42 +0900 | [diff] [blame] | 59 | int test__hists_cumulate(void); |
Adrian Hunter | d44bc55 | 2014-08-15 22:08:36 +0300 | [diff] [blame] | 60 | int test__switch_tracking(void); |
Arnaldo Carvalho de Melo | 1b85337 | 2014-09-03 18:02:59 -0300 | [diff] [blame] | 61 | int test__fdarray__filter(void); |
| 62 | int test__fdarray__add(void); |
Jiri Olsa | 3c8a67f | 2015-02-05 15:40:25 +0100 | [diff] [blame] | 63 | int test__kmod_path__parse(void); |
Jiri Olsa | d3b59a3 | 2012-11-10 01:46:42 +0100 | [diff] [blame] | 64 | |
Jean Pihet | 90fa9de | 2014-05-16 10:41:11 +0200 | [diff] [blame] | 65 | #if defined(__x86_64__) || defined(__i386__) || defined(__arm__) |
Jiri Olsa | 9ff125d | 2014-01-07 13:47:28 +0100 | [diff] [blame] | 66 | #ifdef HAVE_DWARF_UNWIND_SUPPORT |
Jiri Olsa | aa16b81 | 2014-01-07 13:47:22 +0100 | [diff] [blame] | 67 | struct thread; |
| 68 | struct perf_sample; |
| 69 | int test__arch_unwind_sample(struct perf_sample *sample, |
| 70 | struct thread *thread); |
| 71 | #endif |
| 72 | #endif |
Jiri Olsa | 0a4e1ae | 2012-11-10 01:46:41 +0100 | [diff] [blame] | 73 | #endif /* TESTS_H */ |