diff options
-rw-r--r-- | lib/drmtest.c | 5 | ||||
-rw-r--r-- | lib/drmtest.h | 11 | ||||
-rw-r--r-- | tests/gem_exec_big.c | 4 |
3 files changed, 17 insertions, 3 deletions
diff --git a/lib/drmtest.c b/lib/drmtest.c index 943a6cfc..3d79a4d3 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -932,6 +932,11 @@ void igt_subtest_init(int argc, char **argv) optind = 1; } +void igt_simple_init(void) +{ + print_version(); +} + /* * Note: Testcases which use these helpers MUST NOT output anything to stdout * outside of places protected by igt_run_subtest checks - the piglit 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); diff --git a/tests/gem_exec_big.c b/tests/gem_exec_big.c index 79ec6b2d..4be8559f 100644 --- a/tests/gem_exec_big.c +++ b/tests/gem_exec_big.c @@ -97,7 +97,7 @@ static int exec(int fd, uint32_t handle, uint32_t reloc_ofs) return ret; } -int main(int argc, char **argv) +igt_simple_main { uint32_t batch[2] = {MI_BATCH_BUFFER_END}; uint32_t handle; @@ -120,6 +120,4 @@ int main(int argc, char **argv) gem_close(fd, handle); close(fd); - - return 0; } |