diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-12-10 09:41:48 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-12-10 09:41:48 +0100 |
commit | ef9745b7faf42b1273c63de6f3e4afcbb896e568 (patch) | |
tree | 79d635ca00227de4eb6c43e2178b4081dae945df /lib/drmtest.h | |
parent | f1c4ec936c97c4b2f906638180357c8786776316 (diff) |
lib: igt_simple_main/init for subtest-less tests
Atm only used to print the version information.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'lib/drmtest.h')
-rw-r--r-- | lib/drmtest.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/drmtest.h b/lib/drmtest.h index 20e26205..a8de2b49 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -109,6 +109,17 @@ void igt_permute_array(void *array, unsigned size, unsigned j)); void igt_progress(const char *header, uint64_t i, uint64_t total); +/* init for simple tests without subtests */ +void igt_simple_init(void); +#define igt_simple_main \ + static void igt_tokencat(__real_main, __LINE__)(void); \ + int main(int argc, char **argv) { \ + igt_simple_init(); \ + igt_tokencat(__real_main, __LINE__)(); \ + exit(0); \ + } \ + static void igt_tokencat(__real_main, __LINE__)(void) \ + /* subtest infrastructure */ jmp_buf igt_subtest_jmpbuf; void igt_subtest_init(int argc, char **argv); |